Exemplo n.º 1
0
    /// <summary>
    /// Added By Ashok Kumar and Above Method
    /// </summary>
    /// <param name="objRSMCancellation"></param>
    /// <returns></returns>
    public int ApproveDisapproveComplaintByRsm(RSMCancellation objRSMCancellation)
    {
        int    suc = 0;
        string msg = "";

        SqlParameter[] param =
        {
            new SqlParameter("@Type",                this.Type),
            new SqlParameter("@Id",                  this.Id),
            new SqlParameter("@CreatedBy",           this.CreatedBy),
            new SqlParameter("@RsmComment",          this.RsmComment),
            new SqlParameter("@Status",              this.Status),
            new SqlParameter("@MessageOut",          SqlDbType.NVarChar,        1000),
            new SqlParameter("@BaselineId",          this.BaselineId),
            new SqlParameter("@ComplaintNo",         this.ComplaintNo),
            new SqlParameter("@SplitComplaintRefNo", this.SplitComplaintRefNo),
            new SqlParameter("@AscName",             this.AscName),
        };
        param[5].Direction = ParameterDirection.Output;
        suc = objSql.ExecuteNonQuery(CommandType.StoredProcedure, "uspGetComplaintForRSM", param);
        msg = param[5].Value.ToString();
        return(Convert.ToInt32(msg));
    }
Exemplo n.º 2
0
    public string SaveComplaintDetails(RSMCancellation objRSMCancellation)
    {
        string msg = "";

        SqlParameter[] param =
        {
            new SqlParameter("@Type",                this.Type),
            new SqlParameter("@BaselineId",          this.BaselineId),
            new SqlParameter("@ComplaintNo",         this.ComplaintNo),
            new SqlParameter("@ComplaintRefNo",      this.ComplaintRefNo),
            new SqlParameter("@SplitComplaintRefNo", this.SplitComplaintRefNo),
            new SqlParameter("@CallStatus",          this.CallStatus),
            new SqlParameter("@CallStatusNew",       this.CallStatusNew),
            new SqlParameter("@Sc_Sno",              this.SCSNo),
            new SqlParameter("@Comment",             this.Comment),
            new SqlParameter("@CreatedBy",           this.CreatedBy),
            new SqlParameter("@Status",              this.Status),
            new SqlParameter("@MessageOut",          SqlDbType.NVarChar, 1000)
        };
        param[11].Direction = ParameterDirection.Output;
        objSql.ExecuteNonQuery(CommandType.StoredProcedure, "uspGetComplaintForRSM", param);
        msg = param[10].Value.ToString();
        return(msg);
    }
    private void PostPutDetails(string strFlag, string sortOrder)
    {
        try
        {
            if (gvDetails.Rows.Count > 0)
            {
                foreach (GridViewRow gvr in gvDetails.Rows)
                {
                    CheckBox chkChild = (CheckBox)gvr.FindControl("chkChild");
                    if (chkChild != null && chkChild.Checked)
                    {
                        RSMCancellation objRSMCancellation = new RSMCancellation();
                        int             id      = 0;
                        bool            status  = false;
                        string          comment = string.Empty;
                        status = true;
                        HiddenField hdnId          = (HiddenField)gvr.FindControl("hdnId");
                        HiddenField hdnBaselineId  = (HiddenField)gvr.FindControl("hdnBaselineid");
                        HiddenField hdnComplaintNo = (HiddenField)gvr.FindControl("hndComplaintNo");
                        HiddenField hdnSplitNo     = (HiddenField)gvr.FindControl("hdnSplitNo");
                        HiddenField hdnAscName     = (HiddenField)gvr.FindControl("hdnAscName");
                        if (hdnId != null)
                        {
                            id = int.Parse(hdnId.Value);
                        }

                        TextBox txtComment = (TextBox)gvr.FindControl("txtComment");
                        if (txtComment != null)
                        {
                            comment = txtComment.Text.Trim();
                        }

                        objRSMCancellation.AscName             = hdnAscName != null ? hdnAscName.Value : "";
                        objRSMCancellation.SplitComplaintRefNo = hdnSplitNo != null?int.Parse(hdnSplitNo.Value) : 1;

                        objRSMCancellation.ComplaintNo = hdnComplaintNo.Value != null ? hdnComplaintNo.Value : "";
                        objRSMCancellation.Id          = id;
                        if (strFlag.Equals("APPROVE", StringComparison.CurrentCultureIgnoreCase))
                        {
                            objRSMCancellation.RsmComment = "Approved : " + comment;
                        }
                        else
                        {
                            objRSMCancellation.RsmComment = "Rejected : " + comment;
                        }

                        objRSMCancellation.Status     = status;
                        objRSMCancellation.CreatedBy  = Membership.GetUser().UserName.ToString();
                        objRSMCancellation.BaselineId = int.Parse(hdnBaselineId.Value);
                        objRSMCancellation.Type       = strFlag;

                        int success = objRSMCancellation.ApproveDisapproveComplaintByRsm(objRSMCancellation);
                        if (success > 0)
                        {
                            BindGrid(sortOrder);
                            lblMsg.Text = strFlag.Equals("APPROVE") ? "Selected Complaint Closed." : "Selected Complaint Canceled";
                        }
                        else
                        {
                            lblMsg.Text = "Unable To Process, Please Try Again..!";
                        }
                    }
                }
            }
        }
        catch (Exception ex)
        {
        }
    }
    //protected void ddlAsc_SelectedIndexChanged(object sender, EventArgs e)
    //{
    //    objRSMCancellation.SCSNo =int.Parse(ddlAsc.SelectedValue);
    //    if(objRSMCancellation.SCSNo!=0)
    //    objRSMCancellation.BindSCProductDivision(ddlProductDivision);
    //    else
    //        //objCommonClass.BindProductDivision(ddlProductDivision);
    //        objRSMCancellation.GetUserProductDivisions(ddlProductDivision);// Added on 16.04.15 By Ashok Kumar
    //    if (ddlProductDivision.Items.FindByText("Select") != null)
    //    {
    //        ddlProductDivision.Items.FindByText("Select").Text = "All";
    //    }
    //}

    protected void BindGrid(string strOrder)
    {
        try
        {
            // get the complaint details on the bais
            RSMCancellation objRSMCancellation = new RSMCancellation();
            objRSMCancellation.EmpId = Membership.GetUser().UserName;
            if (ddlRegion.SelectedIndex != 0)
            {
                objRSMCancellation.RegionSno = int.Parse(ddlRegion.SelectedItem.Value);
            }
            if (ddlBranch.SelectedIndex != 0)
            {
                objRSMCancellation.BranchSno = int.Parse(ddlBranch.SelectedItem.Value);
            }
            if (ddlAsc.SelectedIndex != 0)
            {
                objRSMCancellation.SCSNo = int.Parse(ddlAsc.SelectedItem.Value);
            }
            if (ddlProductDivision.SelectedIndex != 0)
            {
                objRSMCancellation.ProductDiv_Sno = int.Parse(ddlProductDivision.SelectedItem.Value);
            }
            if (!string.IsNullOrEmpty(Convert.ToString(txtFromDate.Text.Trim())))
            {
                objRSMCancellation.FromDate = txtFromDate.Text.Trim();
            }
            if (!string.IsNullOrEmpty(Convert.ToString(txtToDate.Text.Trim())))
            {
                objRSMCancellation.ToDate = txtToDate.Text.Trim();
            }
            objRSMCancellation.Type     = "SELECT_COMPLAINT";
            objRSMCancellation.RoleType = this.Role; //Added By Mukesh on 4.5.15
            DataSet ds = objRSMCancellation.BindCompGrid(gvDetails);

            if (ds != null && ds.Tables.Count > 0)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (!string.IsNullOrEmpty(strOrder.Trim()))
                    {
                        DataView dvSource = default(DataView);
                        dvSource             = ds.Tables[0].DefaultView;
                        dvSource.Sort        = strOrder;
                        gvDetails.DataSource = dvSource;
                        gvDetails.DataBind();
                        ds = null;
                        dvSource.Dispose();
                        dvSource = null;
                    }
                    else
                    {
                        gvDetails.DataSource = ds.Tables[0];
                        gvDetails.DataBind();
                    }
                    trSubmit.Visible = true;
                }
                else
                {
                    trSubmit.Visible     = false;
                    gvDetails.DataSource = ds;
                    gvDetails.DataBind();
                }
                if (ds.Tables[1] != null)
                {
                    lblTotalComplaintCount.Text = string.IsNullOrEmpty(ds.Tables[1].Rows[0][0].ToString()) ? "0" : ds.Tables[1].Rows[0][0].ToString();
                }
                else
                {
                    lblTotalComplaintCount.Text = "0";
                }
            }
            else
            {
                trSubmit.Visible     = false;
                gvDetails.DataSource = ds;
                gvDetails.DataBind();
                lblTotalComplaintCount.Text = "0";
            }
        }
        catch (Exception ex)
        {
        }
    }