protected void btn_Save_Click(object sender, EventArgs e) { try { bool status = false; _obj_smhr_formsixtn.BUID = Convert.ToInt32(rcmb_BusinessUnit.SelectedItem.Value); _obj_smhr_formsixtn.EMPLOYEE = Convert.ToInt32(rcmb_Employee.SelectedItem.Value); _obj_smhr_formsixtn.PERIOD = Convert.ToInt32(rcmb_Period.SelectedItem.Value); _obj_smhr_formsixtn.AMOUNT = rtxt_Amount.Text; if (Convert.ToDateTime(txt_Receiveddate.SelectedDate.Value) <= System.DateTime.Now) { _obj_smhr_formsixtn.PAYMENT_DATE = Convert.ToDateTime(txt_Receiveddate.SelectedDate.Value); } else { BLL.ShowMessage(this, "Payment date cannot be ahead of Today Date"); return; } //_obj_smhr_formsixtn._PAYMENT_DATE = Convert.ToDateTime(txt_Receiveddate.SelectedDate.Value); _obj_smhr_formsixtn.CHALLAN_NUMBER = rtxt_ChalanNumber.Text; _obj_smhr_formsixtn.BANK = Convert.ToInt32(rcmb_Bank.SelectedItem.Value); _obj_smhr_formsixtn.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_smhr_formsixtn.CREATEDBY = Convert.ToInt32(Session["USER_ID"]); _obj_smhr_formsixtn.CREATEDDATE = DateTime.Now; _obj_smhr_formsixtn.LASTMDFBY = Convert.ToInt32(Session["USER_ID"]); _obj_smhr_formsixtn.LASTMDFDATE = DateTime.Now; _obj_smhr_formsixtn.STATUS = Convert.ToInt16(rcmb_Status.SelectedItem.Value); _obj_smhr_formsixtn.OPERATION = operation.Select; dt_new = BLL.set_Selectnew(_obj_smhr_formsixtn); if (Convert.ToString(dt_new.Rows[0][0]) == "TRUE") { BLL.ShowMessage(this, "Employee Chalan Details Already Exists"); RMP_Formsixtn.SelectedIndex = 0; LoadGrid(); RMP_Formsixtn.DataBind(); return; } else { _obj_smhr_formsixtn.OPERATION = operation.Insert; status = BLL.set_TDSPAYMENTVOUCHER(_obj_smhr_formsixtn); if (status == true) { BLL.ShowMessage(this, "Employee Chalan Details Inserted Successfully"); RMP_Formsixtn.SelectedIndex = 0; LoadGrid(); RMP_Formsixtn.DataBind(); return; } } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "FORM16", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); return; } }
protected void btn_Update_Click(object sender, EventArgs e) { try { bool status = false; _obj_smhr_formsixtn.AMOUNT = rtxt_Amount.Text; _obj_smhr_formsixtn.Id = Convert.ToInt32(lbl_Id.Text); if (Convert.ToDateTime(txt_Receiveddate.SelectedDate.Value) <= System.DateTime.Now) { _obj_smhr_formsixtn.PAYMENT_DATE = Convert.ToDateTime(txt_Receiveddate.SelectedDate.Value); } else { BLL.ShowMessage(this, "Payment date cannot be ahead of Today Date"); return; } //_obj_smhr_formsixtn._PAYMENT_DATE = Convert.ToDateTime(txt_Receiveddate.SelectedDate.Value); _obj_smhr_formsixtn.CHALLAN_NUMBER = Convert.ToString(rtxt_ChalanNumber.Text); // _obj_smhr_formsixtn._BANK = Convert.ToInt32(rcmb_Bank.SelectedItem.Value); _obj_smhr_formsixtn.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_smhr_formsixtn.OPERATION = operation.Update; _obj_smhr_formsixtn.STATUS = Convert.ToInt16(rcmb_Status.SelectedItem.Value); status = BLL.set_TDSPAYMENTVOUCHER(_obj_smhr_formsixtn); if (status == true) { BLL.ShowMessage(this, "Employee Chalan Details Updated Successfully"); RMP_Formsixtn.SelectedIndex = 0; LoadGrid(); RMP_Formsixtn.DataBind(); return; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "FORM16", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); return; } }