protected void lnk_AddOtherMembers_Click(object sender, EventArgs e) { try { if (rcmb_OtherMembers.SelectedValue == string.Empty) { BLL.ShowMessage(this, "Please Select Other Member"); return; } DataTable dtMember = new DataTable(); dtMember.Columns.Add("COMMITTEEMEMBERID"); dtMember.Columns.Add("COMMITTEEMEMBER"); dtMember.Columns.Add("POSITIONS_CODE"); foreach (GridDataItem item in rg_OtherMembers.Items) { if (item["COMMITTEEMEMBERID"].Text == " ") { item.Dispose(); } if (item["COMMITTEEMEMBERID"].Text != " ") { if (rcmb_OtherMembers.SelectedValue != item["COMMITTEEMEMBERID"].Text) { dtMember.Rows.Add(item["COMMITTEEMEMBERID"].Text, item["COMMITTEEMEMBER"].Text, item["POSITIONS_CODE"].Text); } else { BLL.ShowMessage(this, "Member Already Added"); return; } } } if (Convert.ToString(rcmb_OtherMembers.SelectedValue) != string.Empty) { SMHR_ACTIONTAKEN _obj = new SMHR_ACTIONTAKEN(); _obj.OPERATION = operation.Check; _obj.ACTION_CREATED_BY = Convert.ToInt32(rcmb_OtherMembers.SelectedValue); DataTable dt = BLL.get_SMHR_ACTIONTAKEN(_obj); dtMember.Rows.Add(rcmb_OtherMembers.SelectedValue, rcmb_OtherMembers.Text, Convert.ToString(dt.Rows[0]["POSITIONS_CODE"])); } rg_OtherMembers.DataSource = dtMember; rg_OtherMembers.DataBind(); rcmb_OtherMembers.SelectedValue = string.Empty; rcmb_OtherMembers.Text = string.Empty; } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "RecordIncident", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void btn_TakeAction_Click(object sender, EventArgs e) { try { string filename = string.Empty; if (upload_CourtRuling.HasFile) { filename = Convert.ToString(DateTime.Now) + "_" + (upload_CourtRuling.FileName).Replace(" ", "_"); filename = filename.Replace("/", "").Replace(":", ""); string path = MapPath(filename); string name = Path.GetFileName(path); string ext = Path.GetExtension(filename); if (System.IO.Directory.Exists(Server.MapPath("~/Attachments/")) == false) { System.IO.Directory.CreateDirectory(Server.MapPath("~/Attachments/")); } upload_CourtRuling.PostedFile.SaveAs(System.IO.Path.Combine(Server.MapPath("~/Attachments/"), filename)); } SMHR_ACTIONTAKEN _OBJ_SMHR_ACTIONTAKEN = new SMHR_ACTIONTAKEN(); _OBJ_SMHR_ACTIONTAKEN.ACTION_COURT_ATTACHMENT = filename; _OBJ_SMHR_ACTIONTAKEN.ACTION_DISPORGRIV_ID = Convert.ToInt32(rcmb_DisciplinaryGrievanceAction.SelectedItem.Value); _OBJ_SMHR_ACTIONTAKEN.ACTION_DATE = Convert.ToDateTime(rdp_ActionDate.SelectedDate); if (rdp_SuspendedFrom.Visible == true) { _OBJ_SMHR_ACTIONTAKEN.ACTION_SUSPDFROMDATE = Convert.ToDateTime(rdp_SuspendedFrom.SelectedDate); _OBJ_SMHR_ACTIONTAKEN.ACTION_SUSPDTODATE = Convert.ToDateTime(rdp_SuspendedTo.SelectedDate); } else { //_OBJ_SMHR_ACTIONTAKEN.ACTION_SUSPDFROMDATE = null; //_OBJ_SMHR_ACTIONTAKEN.ACTION_SUSPDTODATE = null; } _OBJ_SMHR_ACTIONTAKEN.ACTION_DISCUSSEDDATE = Convert.ToDateTime(rdp_DiscussionDate.SelectedDate); _OBJ_SMHR_ACTIONTAKEN.ACTION_GRIVENCE_ID = Convert.ToInt32(Session["GREVE_ID"]); _OBJ_SMHR_ACTIONTAKEN.ACTION_CREATED_DATE = DateTime.Now; _OBJ_SMHR_ACTIONTAKEN.ACTION_LASTMODIFIEDDATE = DateTime.Now; _OBJ_SMHR_ACTIONTAKEN.ACTION_LASTMODIFIED_BY = Convert.ToInt32(Session["USER_ID"]); _OBJ_SMHR_ACTIONTAKEN.ACTION_CREATED_BY = Convert.ToInt32(Session["USER_ID"]); _OBJ_SMHR_ACTIONTAKEN.ACTION_REASON = Txt_reason.Text; CheckBox chk = new CheckBox(); string strEMPIDs = string.Empty; string strotherIDs = string.Empty; int count = 0; for (int index = 0; index < rg_CommitteeMembers.Items.Count; index++) { chk = rg_CommitteeMembers.Items[index].FindControl("chkSelect") as CheckBox; if (chk.Checked) { GridDataItem item = (GridDataItem)rg_CommitteeMembers.MasterTableView.Items[index]; strEMPIDs += item["COMMITTEEMEMBERID"].Text + ","; } } if (strEMPIDs == string.Empty) { BLL.ShowMessage(this, "Please Select Committee Members"); return; } _OBJ_SMHR_ACTIONTAKEN.ACTION_DISCUSSEDWITH = strEMPIDs; //_OBJ_SMHR_ACTIONTAKEN.ACTION_CREATED_BY= rg_OtherMembers if (rg_OtherMembers.Items.Count > 0) { for (int index = 0; index < rg_OtherMembers.Items.Count; index++) { GridDataItem item = (GridDataItem)rg_OtherMembers.MasterTableView.Items[index]; strotherIDs += item["COMMITTEEMEMBERID"].Text + ","; } } _OBJ_SMHR_ACTIONTAKEN.ACTION_OTHERMEMBERS = strotherIDs; _OBJ_SMHR_ACTIONTAKEN.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); switch (((Button)sender).ID.ToUpper()) { case "BTN_TAKEACTION": _OBJ_SMHR_ACTIONTAKEN.OPERATION = operation.Insert; if (BLL.set_SMHR_ACTIONTAKEN(_OBJ_SMHR_ACTIONTAKEN)) { if ((rdp_SuspendedFrom.Visible == true) || (Convert.ToString(rcmb_DisciplinaryGrievanceAction.SelectedItem.Text).ToUpper() == "TERMINATE")) { //ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), "ShowPop('" + Convert.ToInt32(comlainton_empid.Text) + "','" + Convert.ToString(Session["GREVE_ID"]) + "');", true); BLL.ShowMessage(this, "Information Saved Successfully"); Rm_CY_page.SelectedIndex = 0; } else { BLL.ShowMessage(this, "Information Saved Successfully"); Rm_CY_page.SelectedIndex = 0; } } break; case "BTN_UPDATETAKEACTIN": _OBJ_SMHR_ACTIONTAKEN.OPERATION = operation.Update; if (BLL.set_SMHR_ACTIONTAKEN(_OBJ_SMHR_ACTIONTAKEN)) { BLL.ShowMessage(this, "Information Updated Successfully"); Rm_CY_page.SelectedIndex = 0; } break; } Rm_CY_page.SelectedIndex = 0; } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "RecordIncident", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void lnk_TakeAction_Command(object sender, CommandEventArgs e) { try { CheckBox chk = new CheckBox(); CheckBox chk1 = new CheckBox(); Rm_CY_page.SelectedIndex = 0; rdp_ActionDate.Clear(); rdp_DiscussionDate.Clear(); rdp_SuspendedTo.Clear(); rdp_SuspendedFrom.Clear(); Txt_reason.Text = string.Empty; btn_TakeAction.Visible = true; rdp_ActionDate.Enabled = true; rdp_DiscussionDate.Enabled = true; rdp_SuspendedTo.Enabled = true; HIDN_COMETID.Value = string.Empty; rdp_SuspendedFrom.Enabled = true; Txt_reason.Enabled = true; susdfd.Visible = false; Btn_letter.Visible = true; susdtd.Visible = false; rg_CommitteeMembers.Enabled = true; //rg_OtherMembers.Enabled = true; //rg_OtherMembers.DataSource = new DataTable(); //rg_OtherMembers.DataBind(); lnk_AddOtherMembers.Enabled = true; rcmb_OtherMembers.Enabled = true; rcmb_DisciplinaryGrievanceAction.SelectedIndex = -1; SMHR_ACTIONTAKEN _OBJ_SMHR_ACTIONTAKEN = new SMHR_ACTIONTAKEN(); LinkButton lnkTakeAction = sender as LinkButton; Session.Remove("GREVE_ID"); Session["GREVE_ID"] = Convert.ToString(e.CommandArgument); GridDataItem item = lnkTakeAction.NamingContainer as GridDataItem; rtxt_ActionIncidentID.Text = item["GRIEVANCE_INCIDENTID"].Text; rtxt_ActionIncident.Text = item["GRIEVANCE_INCIDENT"].Text; rtxt_ActionIncidentType.Text = item["GRIEVANCE_INCIDENTTYPE"].Text; rtxt_ActionReportedDate.Text = item["GRIEVANCE_REPORTEDDATE"].Text; rtxt_ActionCommittee.Text = item["COMMITTEE_CODE"].Text; rtxt_cmplantby.Text = item["GRIEVANCE_REPORTEDBYNAME"].Text; rtxt_cmplainton.Text = item["GRIEVANCE_REPORTEDONNAME"].Text; comlainton_empid.Text = item["GRIEVANCE_REPORTEDON"].Text; LoadActionDropDowns(); LoadActionCommittee(Convert.ToInt32(item["GRIEVANCE_COMMITTEEID"].Text)); rg_CommitteeMembers.DataBind(); HIDN_COMETID.Value = item["GRIEVANCE_COMMITTEEID"].Text; _OBJ_SMHR_ACTIONTAKEN.ACTION_GRIVENCE_ID = Convert.ToInt32(e.CommandArgument); _OBJ_SMHR_ACTIONTAKEN.OPERATION = operation.Edit; DataTable dt_edit = BLL.get_SMHR_ACTIONTAKEN(_OBJ_SMHR_ACTIONTAKEN); if (dt_edit.Rows.Count > 0) { Btn_updatetakeactin.Visible = true; rcmb_DisciplinaryGrievanceAction.Enabled = false; btn_TakeAction.Visible = false; rdp_ActionDate.Enabled = false; rdp_DiscussionDate.Enabled = false; Txt_reason.Enabled = false; rdp_SuspendedTo.Enabled = false; rdp_SuspendedFrom.Enabled = false; rg_CommitteeMembers.Enabled = false; lnk_AddOtherMembers.Enabled = false; rcmb_OtherMembers.Enabled = false; rg_OtherMembers.Enabled = false; rcmb_DisciplinaryGrievanceAction.SelectedIndex = rcmb_DisciplinaryGrievanceAction.FindItemIndexByValue((dt_edit.Rows[0]["ACTION_DISPORGRIV_ID"]).ToString()); if ((rcmb_DisciplinaryGrievanceAction.SelectedItem.Text.ToUpper() == "SUSPEND")) { susdfd.Visible = true; susdtd.Visible = true; // Btn_letter.Visible = true; if (Convert.ToString(dt_edit.Rows[0]["ACTION_SUSPDFROMDATE"]) != string.Empty) { rdp_SuspendedFrom.SelectedDate = Convert.ToDateTime(dt_edit.Rows[0]["ACTION_SUSPDFROMDATE"]); } if (Convert.ToString(dt_edit.Rows[0]["ACTION_SUSPDTODATE"]) != string.Empty) { rdp_SuspendedTo.SelectedDate = Convert.ToDateTime(dt_edit.Rows[0]["ACTION_SUSPDTODATE"]); } } else { susdfd.Visible = false; susdtd.Visible = false; // Btn_letter.Visible = false; } if ((rcmb_DisciplinaryGrievanceAction.SelectedItem.Text.ToUpper() == "SUSPEND") || (rcmb_DisciplinaryGrievanceAction.SelectedItem.Text.ToUpper() == "TERMINATE")) { Btn_letter.Visible = true; } else { Btn_letter.Visible = false; } rdp_ActionDate.SelectedDate = Convert.ToDateTime(dt_edit.Rows[0]["ACTION_DATE"]); rdp_DiscussionDate.SelectedDate = Convert.ToDateTime(dt_edit.Rows[0]["ACTION_DISCUSSEDDATE"]); Txt_reason.Text = Convert.ToString(dt_edit.Rows[0]["ACTION_REASON"]); // Lnk_Download.Text = Convert.ToString(dt_edit.Rows[0]["ACTION_COURT_ATTACHMENT"]); if (Convert.ToString(dt_edit.Rows[0]["ACTION_COURT_ATTACHMENT"]) != string.Empty) { D1.Visible = true; } else { D1.Visible = false; } D1.HRef = "~/Attachments/" + Convert.ToString(dt_edit.Rows[0]["ACTION_COURT_ATTACHMENT"]); _OBJ_SMHR_ACTIONTAKEN.OPERATION = operation.Delete1; DataTable dt_cmtimem = BLL.get_SMHR_ACTIONTAKEN(_OBJ_SMHR_ACTIONTAKEN); _OBJ_SMHR_ACTIONTAKEN.OPERATION = operation.Delete; DataTable dt_othmem = BLL.get_SMHR_ACTIONTAKEN(_OBJ_SMHR_ACTIONTAKEN); rg_OtherMembers.DataSource = dt_othmem; rg_OtherMembers.DataBind(); for (int index = 0; index < dt_cmtimem.Rows.Count; index++) { for (int j = 0; j < rg_CommitteeMembers.Items.Count; j++) { chk = rg_CommitteeMembers.Items[index].FindControl("chkSelect") as CheckBox; GridDataItem itemcm = (GridDataItem)rg_CommitteeMembers.MasterTableView.Items[j]; if (Convert.ToInt32(dt_cmtimem.Rows[index]["COMMITTEEMEMBERID"]) == Convert.ToInt32(itemcm["COMMITTEEMEMBERID"].Text)) { chk.Checked = true; } } } } else { D1.Visible = false; Btn_updatetakeactin.Visible = false; btn_TakeAction.Visible = true; rg_OtherMembers.DataSource = new DataTable(); rg_OtherMembers.DataBind(); rg_OtherMembers.Enabled = true; rcmb_DisciplinaryGrievanceAction.Enabled = true; rg_CommitteeMembers.Enabled = true; } Rm_CY_page.SelectedIndex = 2; } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "RecordIncident", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }