//protected void ddlUnit_SelectedIndexChanged(object sender, EventArgs e) //{ // if (ddlUnit.SelectedIndex < 1) // { // ddlSection.DataSource = null; // ddlSection.DataBind(); // } // else // { // int org_id = int.Parse(this.ddlOrganization.SelectedValue.ToString()); // int unit_id = int.Parse(this.ddlUnit.SelectedValue.ToString()); // List<ATTOrganizationSection> LSTOrgSec = BLLOrganizationSection.GetOrgSection(org_id, unit_id); // LSTOrgSec.Insert(0, new ATTOrganizationSection(0, 0, 0, "छान्नुहोस्", "", "")); // ddlSection.DataSource = LSTOrgSec; // ddlSection.DataValueField = "SectionID"; // ddlSection.DataTextField = "SectionName"; // ddlSection.DataBind(); // } //} protected void btnSearch_Click(object sender, EventArgs e) { List <ATTEmployeeDeputaion> LSTEmp = new List <ATTEmployeeDeputaion>(); if (this.ddlOrganization.SelectedIndex < 1) { this.lblStatusMessage.Text = "Select An Organization"; this.programmaticModalPopup.Show(); } else { try { LSTEmp = BLLEmployeeDeputation.GetEmpForDeputation(GetEmployeeFilter(), "wod"); if (LSTEmp.Count == 0) { lblSearch.Text = "No records found"; } } catch (Exception ex) { throw ex; } } grdEmployee.DataSource = LSTEmp; this.grdEmployee.DataBind(); this.grdEmployee.SelectedIndex = -1; Session["EmpDeputation"] = LSTEmp; }
protected void btnAdd_Click(object sender, EventArgs e) { ATTUserLogin user = ((ATTUserLogin)Session["Login_User_Detail"]); ATTEmployeeDeputaion obj = (ATTEmployeeDeputaion)Session["EmployeeDuptation"]; ATTEmployeePosting objEcp = (ATTEmployeePosting)Session["EmployeeCurentPosting"]; obj.EmpID = user.PID; obj.OrgID = user.OrgID; obj.DesID = objEcp.DesID; obj.CreatedDate = objEcp.CreatedDate; obj.PostID = objEcp.PostID; obj.FromDate = objEcp.FromDate; obj.ApplicationDate = txtAppdate_DT.Text; obj.DepOrgID = int.Parse(ddlOrganization.SelectedValue); //obj.DecisionVerifiedBy = ""; //obj.LeaveDate = ""; //obj.LeaveVerifiedBy = ""; //obj.ReturnDate = ""; //obj.ReturnVerifiedBy = ""; obj.Responsibilities = txtdescription.Text; obj.Active = "Y"; obj.EntryBy = user.UserName; //obj.TipOrgID = ""; // obj.TippaniID = ""; //obj.DecisionDate = ""; obj.Action = "A"; if (this.ddlOrganization.SelectedIndex <= 0) { this.lblStatusMessage.Text = "Please select organization Name."; this.programmaticModalPopup.Show(); this.lblStatus.Focus(); return; } if (this.txtAppdate_DT.Text == "") { this.lblStatusMessage.Text = "Please Enter Application Date."; this.programmaticModalPopup.Show(); this.lblStatus.Focus(); return; } if (this.txtdescription.Text == "") { this.lblStatusMessage.Text = "Please Enter Responsibilities."; this.programmaticModalPopup.Show(); this.lblStatus.Focus(); return; } if (BLLEmployeeDeputation.AddEmpForDeputationDetail(obj)) { this.lblStatusMessage.Text = "Information Saved"; this.programmaticModalPopup.Show(); } else { this.lblStatusMessage.Text = "Information could not be Saved"; this.programmaticModalPopup.Show(); } ClearControl(); }
protected void btnSearch_Click(object sender, EventArgs e) { List <ATTEmployeeDeputaion> lst; this.lblSearch.Text = ""; if (this.txtSymbolNo.Text.Trim() == "" && this.txtFName.Text.Trim() == "" && this.txtMName.Text.Trim() == "" && this.txtSurName.Text.Trim() == "" && this.ddlGender.SelectedIndex == 0 && this.txtDOB.Text.Trim() == "" && this.ddlOrganization.SelectedIndex == 0) { this.lblStatusMessage.Text = "All Fields Cannot Be Empty."; this.programmaticModalPopup.Show(); } else { try { //lst = BLLEmployeeSearch.SearchEmployee(GetFilter()); Session["EmpSearchResult"] = BLLEmployeeDeputation.SearchEmployeeDeputation(GetFilter(), GetSearchType()); lst = (List <ATTEmployeeDeputaion>)Session["EmpSearchResult"]; this.lblSearch.Text = lst.Count.ToString() + " records found."; this.grdEmployee.DataSource = lst; this.grdEmployee.DataBind(); grdDiv.Visible = true; } catch (Exception ex) { this.lblStatusMessage.Text = ex.Message; this.programmaticModalPopup.Show(); } } }
protected void btnSubmit_Click(object sender, EventArgs e) { List <ATTEmployeeDeputaion> LSTEmpDeputation = (List <ATTEmployeeDeputaion>)Session["EmpDepReturn"]; int countErr = 0; for (int j = 0; j <= this.grdEmpDepReturn.Rows.Count - 1; j++) { bool val = true; LSTEmpDeputation[j].ReturnDate = ((TextBox)grdEmpDepReturn.Rows[j].FindControl("TextBox1")).Text; string leavedate = LSTEmpDeputation[j].LeaveDate; string returndate = LSTEmpDeputation[j].ReturnDate; if (returndate.Trim() != "") { val = (CheckDateIsValid(leavedate, returndate)); } if (!val) { countErr++; } LSTEmpDeputation[j].Action = "ER"; } try { if (countErr == 0) { List <ATTEmployeeDeputaion> LST = LSTEmpDeputation.FindAll( delegate(ATTEmployeeDeputaion obj) { return(obj.ReturnDate != ""); } ); if (BLLEmployeeDeputation.SaveEmpForDeputation(LST)) { this.lblStatusMessage.Text = "**Employee Deputation Return Successfully Save"; this.programmaticModalPopup.Show(); int orgid = int.Parse(Session["Orgid"].ToString()); string active = "Y"; List <ATTEmployeeDeputaion> LSTEmpDepReturn = BLLEmployeeDeputation.GetEmpForDeputationReturn(orgid, active); this.grdEmpDepReturn.DataSource = LSTEmpDepReturn; this.grdEmpDepReturn.DataBind(); return; } } else { this.lblStatusMessage.Text = countErr.ToString() + ". data has invalid date<br/>**Leave Date Is Greater Than Return Date"; this.programmaticModalPopup.Show(); } } catch (Exception ex) { throw ex; } }
private void LoadEmpDeputation() { List <ATTEmployeeDeputaion> LSTEmpDeputation = BLLEmployeeDeputation.GetEmpForDeputation(GetEmployeeFilterDep(), "wld"); Session["EmpDepNoLeave"] = LSTEmpDeputation; this.grdEmpDepRamana.DataSource = LSTEmpDeputation; this.grdEmpDepRamana.DataBind(); }
private void LoadEmpDeputationInfo() { ATTUserLogin user = ((ATTUserLogin)Session["Login_User_Detail"]); List <ATTEmployeeDeputaion> LSTEmpDeputation = BLLEmployeeDeputation.GetEmpForDeputationInfo(user.OrgID, "Y", user.PID); // Session["EmpDeputionInfo"] = LSTEmpDeputation; this.grdDeputation.DataSource = LSTEmpDeputation; this.grdDeputation.DataBind(); }
private void LoadEmpDepReturn() { int orgid = int.Parse(Session["Orgid"].ToString()); string active = "Y"; List <ATTEmployeeDeputaion> LSTEmpDepReturn = BLLEmployeeDeputation.GetEmpForDeputationReturn(orgid, active); Session["EmpDepReturn"] = LSTEmpDepReturn; this.grdEmpDepReturn.DataSource = LSTEmpDepReturn; this.grdEmpDepReturn.DataBind(); }
protected void btnRawanaSave_Click(object sender, EventArgs e) { List <ATTEmployeeDeputaion> LSTEmpDepLeave = (List <ATTEmployeeDeputaion>)Session["EmpDepNoLeave"]; if (LSTEmpDepLeave.Count == 0) { this.lblStatusMessage.Text = "**Sorry! There Is No Data To Save"; this.programmaticModalPopup.Show(); return; } //List<ATTEmployeeDeputaion> LSTEmpDepOther = new List<ATTEmployeeDeputaion>(); try { for (int j = 0; j <= this.grdEmpDepRamana.Rows.Count - 1; j++) { LSTEmpDepLeave[j].LeaveDate = ((TextBox)grdEmpDepRamana.Rows[j].FindControl("TextBox1")).Text; bool check = ((CheckBox)grdEmpDepRamana.Rows[j].Cells[14].FindControl("chkBox")).Checked; if (check) { LSTEmpDepLeave[j].Active = "Y"; LSTEmpDepLeave[j].Action = "E"; } else { LSTEmpDepLeave[j].Active = "N"; LSTEmpDepLeave[j].Action = "E"; } } if (BLLEmployeeDeputation.SaveEmpForDeputation(LSTEmpDepLeave)) { this.lblStatusMessage.Text = "**Employee Deputation Leave Successfully Save"; this.programmaticModalPopup.Show(); this.ddlDeputaionOrgEdit.SelectedIndex = -1; this.txtDecisionDateEdit.Text = ""; this.txtResponsibilityEdit.Text = ""; this.txtDecision.Text = ""; Session["EmpDepNoLeave"] = BLLEmployeeDeputation.GetEmpForDeputation(GetEmployeeFilterDep(), "wld"); grdEmpDepRamana.DataSource = Session["EmpDepNoLeave"]; grdEmpDepRamana.DataBind(); grdEmployee.DataSource = BLLEmployeeDeputation.GetEmpForDeputation(GetEmployeeFilter(), "wod"); //grdEmpDepRamana.DataSource = Session["EmpDepNoLeave"]; //grdEmpDepRamana.DataBind(); return; } } catch (Exception ex) { throw ex; } }
protected void btnSave_Click(object sender, EventArgs e) { if (this.txtDecisionDate.Text == "") { this.lblStatusMessage.Text = "र्कपया काज निर्णय मिति बर्नुहोस्"; this.programmaticModalPopup.Show(); return; } double empId = double.Parse(Server.HtmlDecode(grdEmployee.Rows[grdEmployee.SelectedIndex].Cells[0].Text).ToString()); foreach (GridViewRow row in this.grdEmpDepRamana.Rows) { if (int.Parse(row.Cells[0].Text) == empId) { this.lblStatusMessage.Text = "**कर्मचारी काजको लागि सिफारिस भैसकेको छ"; this.programmaticModalPopup.Show(); return; } } int orgId = int.Parse(Server.HtmlDecode(grdEmployee.Rows[grdEmployee.SelectedIndex].Cells[3].Text).ToString()); int desId = int.Parse(Server.HtmlDecode(grdEmployee.Rows[grdEmployee.SelectedIndex].Cells[5].Text).ToString()); string createdDate = Server.HtmlDecode(grdEmployee.Rows[grdEmployee.SelectedIndex].Cells[7].Text).ToString(); int postId = int.Parse(Server.HtmlDecode(grdEmployee.Rows[grdEmployee.SelectedIndex].Cells[8].Text).ToString()); string fromDate = Server.HtmlDecode(grdEmployee.Rows[grdEmployee.SelectedIndex].Cells[9].Text).ToString(); string decisionDate = this.txtDecisionDate.Text; int dep_org_id = int.Parse(this.ddlDeputationOrganization.SelectedValue); int dicision_ver_by = 0; string responsibility = this.txtResponsibility.Text; string active = "Y"; string entry_by = Session["UserName"].ToString(); List <ATTEmployeeDeputaion> LSTAddDep; if (Session["EmpDepNoLeave"] != null) { LSTAddDep = (List <ATTEmployeeDeputaion>)Session["EmpDepNoLeave"]; } else { LSTAddDep = new List <ATTEmployeeDeputaion>(); } if (this.ddlDeputationOrganization.SelectedIndex < -1) { this.lblStatusMessage.Text = "काज कार्यालय छान्नुहोस्"; this.programmaticModalPopup.Show(); } else if (this.ddlDeputationOrganization.SelectedIndex > 0) { ATTEmployeeDeputaion objAddDep = new ATTEmployeeDeputaion(); objAddDep.EmpID = empId; objAddDep.OrgID = orgId; objAddDep.DesID = desId; objAddDep.CreatedDate = createdDate; objAddDep.PostID = postId; objAddDep.FromDate = fromDate; objAddDep.DecisionDate = decisionDate; objAddDep.DepOrgID = dep_org_id; objAddDep.DecisionVerifiedBy = dicision_ver_by; objAddDep.Responsibilities = responsibility; objAddDep.Active = active; objAddDep.EntryBy = entry_by; objAddDep.Action = "A"; objAddDep.LeaveDate = ""; objAddDep.LeaveVerifiedBy = 0; LSTAddDep.Add(objAddDep); //Session["DeputaionWOLeave"] = LSTAddDep; if (BLLEmployeeDeputation.SaveEmpForDeputation(LSTAddDep)) { this.lblStatusMessage.Text = "Employee Deputation Saved Successfully"; this.programmaticModalPopup.Show(); Session["EmpDepNoLeave"] = BLLEmployeeDeputation.GetEmpForDeputation(GetEmployeeFilterDep(), "wld"); grdEmpDepRamana.DataSource = Session["EmpDepNoLeave"]; grdEmpDepRamana.DataBind(); //grdEmployee.DataSource = BLLEmployeeDeputation.GetEmpForDeputation(GetEmployeeFilter(), "wod"); //this.grdEmployee.DataBind(); this.ddlDeputationOrganization.SelectedIndex = -1; this.txtDecisionDate.Text = ""; this.txtResponsibility.Text = ""; this.txtVerifiedBy.Text = ""; return; } } }