protected void btn_Click(object sender, EventArgs e)
{
lblMsg.Text = "";
int result = 0;
string UserProc = "PR_MST_TBL_STUD_PAYMENT_REFUND_Insert";
try
{
DateTime paydt=DateTime.ParseExact(txtDate.Text!=""?txtDate.Text:DateTime.Now.ToString("dd/MM/yyyy"),"dd/MM/yyyy",System.Globalization.CultureInfo.InvariantCulture);
SqlParameter[] para = new SqlParameter[]
{
new SqlParameter("@STUDREGID",txt_studregid.Text==""?null:txt_studregid.Text.Trim()),
new SqlParameter("@TPID", Session["trainingpartnercode"]!=null? Convert.ToString(Session["trainingpartnercode"]):null),
new SqlParameter("@DATEOFPAYMENT",paydt),
new SqlParameter("@AMOUNT",txt_amount.Text==""?0:Convert.ToDouble(txt_amount.Text)),
new SqlParameter("@PAYMENTMODE",ddlPayMode.SelectedItem.Text),
new SqlParameter("@CHEQDRAFTNO",txt_otherMode.Text==""?null:txt_otherMode.Text.Trim()),
new SqlParameter("@REASON", txt_reason.Text==""?null:txt_reason.Text.Trim()),
new SqlParameter("@BATCHID",Convert.ToInt32(batchHidden.Value)),
new SqlParameter("@INSTALLMENTNO",1),
new SqlParameter("@ISCOMPLETE",false),
new SqlParameter("@COURSEID",Convert.ToInt32(courseHidden.Value)),
new SqlParameter("@PAYMENTTYPE",Convert.ToInt32(drp_feesreturn.SelectedValue))
};
result = Luminious.DataAcessLayer.SqlHelper.ExecuteNonQuery(Luminious.Connection.Configuration.ConnectionString, CommandType.StoredProcedure, UserProc, para);
}
catch (SqlException ex)
{
lblMsg.Text = ex.Message.ToString();
lblMsg.ForeColor = System.Drawing.Color.Red;
ExceptionHandler.WriteException(ex.Message);
}
catch (Exception ex)
{
ExceptionHandler.WriteException(ex.Message);
}
finally
{
if (result > 0)
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "msg", "alert('Transction Completed');", true);
}
else
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "msg", "alert('Invalid Transction !');", true);
}
LuminiousUtility.Util.ButtonSetting obj = new LuminiousUtility.Util.ButtonSetting();
obj.ClearControlsMaster(this);
}
}
No comments:
Post a Comment