コード例 #1
0
        /// <summary>
        /// Insert incident record
        /// </summary>
        /// <param name="_obj_Smhr_Grievance"></param>
        /// <returns></returns>
        public static bool record_Incident(SMHR_GRIEVANCE _obj_Smhr_Grievance)
        {
            bool status = false;

            switch (_obj_Smhr_Grievance.OPERATION)
            {
            case operation.Insert:
                if (ExecuteNonQuery("EXEC USP_SMHR_GRIEVANCE @Operation = 'Insert', @GRIEVANCE_ID='" + _obj_Smhr_Grievance.GRIEVANCE_ID
                                    + "', @GRIEVANCE_ORGANISATION_ID = '" + _obj_Smhr_Grievance.ORGANISATION_ID
                                    + "', @GRIEVANCE_REPORTEDBY='" + _obj_Smhr_Grievance.GRIEVANCE_REPORTEDBY
                                    + "', @GRIEVANCE_REPORTEDON='" + _obj_Smhr_Grievance.GRIEVANCE_REPORTEDON
                                    + "', @GRIEVANCE_INCIDENTID='" + Convert.ToString(_obj_Smhr_Grievance.GRIEVANCE_INCIDENTID)
                                    + " ', @GRIEVANCE_INCIDENT='" + Convert.ToString(_obj_Smhr_Grievance.GRIEVANCE_INCIDENT)
                                    + "', @GRIEVANCE_INCIDENTTYPE_ID='" + _obj_Smhr_Grievance.GRIEVANCE_INCIDENTTYPE_ID
                                    + "', @GRIEVANCE_REPORTEDDATE='" + _obj_Smhr_Grievance.GRIEVANCE_REPORTEDDATE
                                    + "', @GRIEVANCE_INCIDENTDESCRIPTION='" + _obj_Smhr_Grievance.GRIEVANCE_INCIDENTDESCRIPTION
                                    + "', @GRIEVANCE_COMMITTEEID='" + _obj_Smhr_Grievance.GRIEVANCE_COMMITTEEID
                                    + " ', @GRIEVANCE_CREATEDBY= '" + Convert.ToString(_obj_Smhr_Grievance.CREATEDBY)
                                    + " ', @GRIEVANCE_CREATEDDATE='" + _obj_Smhr_Grievance.CREATEDDATE.ToString("MM/dd/yyyy")
                                    + "', @GRIEVANCE_LASTMDFBY  ='" + Convert.ToString(_obj_Smhr_Grievance.LASTMDFBY)
                                    + "' , @GRIEVANCE_LASTMDFDATE ='" + _obj_Smhr_Grievance.LASTMDFDATE.ToString("MM/dd/yyyy") + "'"))
                {
                    status = true;
                }
                else
                {
                    status = false;
                }
                break;

            case operation.Update:
                if (ExecuteNonQuery("EXEC USP_SMHR_GRIEVANCE @Operation = 'Update', @GRIEVANCE_ID='" + _obj_Smhr_Grievance.GRIEVANCE_ID
                                    + "', @GRIEVANCE_ORGANISATION_ID = '" + _obj_Smhr_Grievance.ORGANISATION_ID
                                    + "', @GRIEVANCE_INCIDENTDESCRIPTION='" + _obj_Smhr_Grievance.GRIEVANCE_INCIDENTDESCRIPTION
                                    + "', @GRIEVANCE_LASTMDFBY  ='" + Convert.ToString(_obj_Smhr_Grievance.LASTMDFBY)
                                    + "' , @GRIEVANCE_LASTMDFDATE ='" + _obj_Smhr_Grievance.LASTMDFDATE.ToString("MM/dd/yyyy") + "'"))
                {
                    status = true;
                }
                else
                {
                    status = false;
                }
                break;

            default:
                break;
            }
            return(status);
        }
コード例 #2
0
    private DataTable LoadIncidentGrid()
    {
        SMHR_GRIEVANCE _obj_Smhr_Grievance = new SMHR_GRIEVANCE();

        try
        {
            _obj_Smhr_Grievance.GRIEVANCE_ID    = 0;
            _obj_Smhr_Grievance.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            _obj_Smhr_Grievance.OPERATION       = operation.Select;
        }
        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");
        }
        return(BLL.get_Incidents(_obj_Smhr_Grievance));
    }
コード例 #3
0
 /// <summary>
 /// Get Recorded Incidents
 /// </summary>
 /// <param name="_obj_Smhr_Grievance"></param>
 /// <returns></returns>
 public static DataTable get_Incidents(SMHR_GRIEVANCE _obj_Smhr_Grievance)
 {
     if (_obj_Smhr_Grievance.OPERATION == operation.Select)
     {
         if (_obj_Smhr_Grievance.GRIEVANCE_ID.ToString() == "0")
         {
             return(ExecuteQuery("EXEC USP_SMHR_GRIEVANCE @Operation = 'select',@GRIEVANCE_ORGANISATION_ID = '" + _obj_Smhr_Grievance.ORGANISATION_ID + "'"));
         }
         else
         {
             return(ExecuteQuery("EXEC USP_SMHR_GRIEVANCE @Operation = 'select', @GRIEVANCE_ID =" + Convert.ToString(_obj_Smhr_Grievance.GRIEVANCE_ID) + ",@GRIEVANCE_ORGANISATION_ID = '" + _obj_Smhr_Grievance.ORGANISATION_ID + "'"));
         }
     }
     else if (_obj_Smhr_Grievance.OPERATION == operation.Check)
     {
         return(ExecuteQuery("EXEC USP_SMHR_GRIEVANCE @Operation = 'Check', @GRIEVANCE_INCIDENTTYPE_ID =" + Convert.ToString(_obj_Smhr_Grievance.GRIEVANCE_INCIDENTTYPE_ID) + ",@GRIEVANCE_ORGANISATION_ID = '" + _obj_Smhr_Grievance.ORGANISATION_ID + "'"));
     }
     else
     {
         return(new DataTable());
     }
 }
コード例 #4
0
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        try
        {
            SMHR_GRIEVANCE _obj_Smhr_Grievance = new SMHR_GRIEVANCE();
            _obj_Smhr_Grievance.GRIEVANCE_INCIDENT            = rcmb_Incident.SelectedItem.Text;
            _obj_Smhr_Grievance.GRIEVANCE_INCIDENTID          = rtxt_IncidentID.Text;
            _obj_Smhr_Grievance.GRIEVANCE_INCIDENTTYPE_ID     = Convert.ToInt32(rcmb_IncidentType.SelectedValue);
            _obj_Smhr_Grievance.GRIEVANCE_REPORTEDDATE        = rdp_ReportedDate.SelectedDate;
            _obj_Smhr_Grievance.GRIEVANCE_INCIDENTDESCRIPTION = rtxt_Description.Text;
            if (Convert.ToString(rcmb_ReportedByEmployee.SelectedValue) == string.Empty)
            {
                BLL.ShowMessage(this, "Plrase select Complaint By clearly"); return;
            }
            else
            {
                _obj_Smhr_Grievance.GRIEVANCE_REPORTEDBY = Convert.ToInt32(rcmb_ReportedByEmployee.SelectedValue);
            }
            if (Convert.ToString(rcmb_ReportedOnEmployee.SelectedValue) == string.Empty)
            {
                BLL.ShowMessage(this, "Plrase select Complaint On clearly"); return;
            }
            else
            {
                _obj_Smhr_Grievance.GRIEVANCE_REPORTEDON = Convert.ToInt32(rcmb_ReportedOnEmployee.SelectedValue);
            }
            if ((Convert.ToString(rcmb_ReportedByEmployee.SelectedValue) != string.Empty) && (Convert.ToString(rcmb_ReportedOnEmployee.SelectedValue) != string.Empty))
            {
                if ((Convert.ToString(rcmb_ReportedByEmployee.SelectedValue)) == (Convert.ToString(rcmb_ReportedOnEmployee.SelectedValue)))
                {
                    BLL.ShowMessage(this, "Complaint By and Complaint On cannot be same");
                    return;
                }
            }
            _obj_Smhr_Grievance.GRIEVANCE_COMMITTEEID = Convert.ToInt32(rcmb_Committee.SelectedValue);
            _obj_Smhr_Grievance.ORGANISATION_ID       = Convert.ToInt32(Session["ORG_ID"]);
            _obj_Smhr_Grievance.CREATEDBY             = Convert.ToInt32(Session["USER_ID"]); // ### Need to Get the Session
            _obj_Smhr_Grievance.CREATEDDATE           = DateTime.Now;
            _obj_Smhr_Grievance.LASTMDFBY             = Convert.ToInt32(Session["USER_ID"]); // ### Need to Get the Session
            _obj_Smhr_Grievance.LASTMDFDATE           = DateTime.Now;

            SMHR_EMPLOYEE _obj_employee = new SMHR_EMPLOYEE();
            _obj_employee.EMP_ID    = Convert.ToInt32(rcmb_ReportedOnEmployee.SelectedValue);
            _obj_employee.OPERATION = operation.Select;
            DataTable dt_employee = BLL.get_Employeedetail(_obj_employee);
            if (rdp_ReportedDate.SelectedDate < Convert.ToDateTime(dt_employee.Rows[0]["EMP_DOJ"]))
            {
                BLL.ShowMessage(this, "Report Date Should not be less than complaint On employee join date"); return;
            }
            switch (((Button)sender).ID.ToUpper())
            {
            case "BTN_UPDATE":
                _obj_Smhr_Grievance.GRIEVANCE_ID = Convert.ToInt32(ViewState["GRIEVANCE_ID"]);
                _obj_Smhr_Grievance.GRIEVANCE_INCIDENTDESCRIPTION = rtxt_Description.Text;
                _obj_Smhr_Grievance.OPERATION = operation.Update;
                if (BLL.record_Incident(_obj_Smhr_Grievance))
                {
                    BLL.ShowMessage(this, "Record Complaint Updated Successfully");
                }
                else
                {
                    BLL.ShowMessage(this, "Record Complaint Not Updated");
                }

                break;

            case "BTN_SAVE":

                _obj_Smhr_Grievance.OPERATION = operation.Insert;
                if (BLL.record_Incident(_obj_Smhr_Grievance))
                {
                    BLL.ShowMessage(this, "Record Complaint Saved Successfully");
                }
                else
                {
                    BLL.ShowMessage(this, "Record Complaint Not Saved");
                }
                break;

            default:
                break;
            }
            Rm_CY_page.SelectedIndex     = 0;
            Rg_RecordIncident.DataSource = LoadIncidentGrid();

            Rg_RecordIncident.DataBind();
            ViewState["GRIEVANCE_ID"] = null;
            Rm_CY_page.SelectedIndex  = 0;

            // Response.Redirect("RecordIncident.aspx");
        }
        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");
        }
    }