protected void btnDelete_Click(object sender, EventArgs e)
    {
        try
        {
            RmsPM.BLL.SupplierSurveyOpinion cSupplierSurveyOpinion = new RmsPM.BLL.SupplierSurveyOpinion();
            cSupplierSurveyOpinion.SupplierSurveyOpinionCode = this.ucOperationControl.ApplicationCode;



            EntityData entity = cSupplierSurveyOpinion.GetSupplierSurveyOpinionByCode(this.ucOperationControl.ApplicationCode);
            if (entity.HasRecord())
            {
                entity.DeleteAllTableRow("SupplierSurveyOpinion");
                RmsPM.BLL.SupplierSurveyOpinion.DeleteStandard_Grade(entity);
            }


            Response.Write(Rms.Web.JavaScript.ScriptStart);
            Response.Write(Rms.Web.JavaScript.OpenerReload(false));
            Response.Write(Rms.Web.JavaScript.WinClose(false));
            Response.Write(Rms.Web.JavaScript.ScriptEnd);
            //Response.End();
        }
        catch (Exception ex)
        {
            ApplicationLog.WriteLog(this.ToString(), ex, "删除评分错误");
            Response.Write(Rms.Web.JavaScript.Alert(true, "删除评分出错:" + ex.Message));
        }
    }
    /// <summary>
    /// 保存控件数据
    /// </summary>
    public string SubmitData()
    {
        try
        {
            string ErrMsg = "";

            RmsPM.BLL.SupplierSurveyOpinion cSupplierSurveyOpinion = new RmsPM.BLL.SupplierSurveyOpinion();

            cSupplierSurveyOpinion.SupplierSurveyOpinionCode = this.ApplicationCode;


            if (this.inputSystemGroup.Value.Trim() == "")
            {
                ErrMsg += "请选择工种名称 !";
                return(ErrMsg);
            }
            if (this.TxtPersonName.Value.Trim() == "")
            {
                ErrMsg += "请填写专员姓名 !";
                return(ErrMsg);
            }

            cSupplierSurveyOpinion.WorkName     = this.inputSystemGroup.Value.Trim();
            cSupplierSurveyOpinion.ZYName       = this.TxtPersonName.Value.Trim();
            cSupplierSurveyOpinion.SupplierCode = this.SupplierCode;
            cSupplierSurveyOpinion.SurveyDate   = this.Txtdate.Value;
            cSupplierSurveyOpinion.Remark       = this.TxtRemark.Value.Trim();

            cSupplierSurveyOpinion.Grade       = this.selectGrade.Items[this.selectGrade.SelectedIndex].Text;
            cSupplierSurveyOpinion.AdviceGrade = this.selectAdviceGrade.Items[this.selectAdviceGrade.SelectedIndex].Text;
            cSupplierSurveyOpinion.State       = "1";
            cSupplierSurveyOpinion.SupplierSurveyOpinionAdd();
            this.ApplicationCode = cSupplierSurveyOpinion.SupplierSurveyOpinionCode;



            return(ErrMsg);
        }
        catch (Exception ex)
        {
            Response.Write(Rms.Web.JavaScript.Alert(true, "保存出错:" + ex.Message));
            throw ex;
        }
    }
    public void LoadData()
    {
        string SupplierCode = Request["suppliercode"] + "";

        this.ApplicationCode = Request["ApplicationCode"] + "";
        RmsPM.BLL.SupplierSurveyOpinion cSupplierSurveyOpinion = new RmsPM.BLL.SupplierSurveyOpinion();
        EntityData entity = cSupplierSurveyOpinion.GetSupplierSurveyOpinionByCode(ApplicationCode);



        this.ucOperationControl.SupplierCode = SupplierCode;
        if (this.ApplicationCode == "")
        {
            this.btnModify.Visible        = false;
            this.btnDelete.Visible        = false;
            this.btnOldCheck.Visible      = false;
            this.btnCheck.Visible         = false;
            this.btnSave.Visible          = this.user.HasRight("141704");
            this.ucOperationControl.State = ModuleState.Operable;
        }
        else
        {
            this.ucOperationControl.ApplicationCode = this.ApplicationCode;

            this.btnSave.Visible          = false;
            this.btnModify.Visible        = this.user.HasRight("141702");
            this.btnDelete.Visible        = this.user.HasRight("141701");
            this.btnOldCheck.Visible      = this.user.HasRight("141705");
            this.btnCheck.Visible         = this.user.HasRight("141706");
            this.ucOperationControl.State = ModuleState.Eyeable;
        }
        this.ucOperationControl.InitControl();

        this.WorkFlowList1.ProcedureNameAndApplicationCodeList = GetWorkFlowListString(ApplicationCode);
        this.WorkFlowList1.DataBound();


        this.btnCheck.Attributes["OnClick"] = "javascript:opendoSurvey();return false;";
        if (entity.HasRecord())
        {
            switch (entity.GetString("State"))
            {
            case "0":    //已审
                this.btnModify.Style["display"]   = "none";
                this.btnDelete.Style["display"]   = "none";
                this.btnCheck.Style["display"]    = "none";
                this.btnOldCheck.Style["display"] = "none";



                break;

            case "7":    //审核中

                this.btnModify.Style["display"]   = "none";
                this.btnDelete.Style["display"]   = "none";
                this.btnCheck.Style["display"]    = "none";
                this.btnOldCheck.Style["display"] = "none";

                break;

            default:
                break;
            }
        }
    }
Beispiel #4
0
        public static bool SupplierSurveyOpinionStatusChange(string SupplierSurveyOpinionCode, int gm_iStatus, int?gm_iOriginalStatus, bool gm_bSubmitData)
        {
            SupplierSurveyOpinion opinion = new SupplierSurveyOpinion();

            return(SupplierSurveyOpinionStatusChange(opinion.GetSupplierSurveyOpinionByCode(SupplierSurveyOpinionCode), SupplierSurveyOpinionCode, gm_iStatus, gm_iOriginalStatus, gm_bSubmitData));
        }
    /// <summary>
    /// 装载控件数据
    /// </summary>
    public void LoadData(bool flag)
    {
        try
        {
            if (this.ApplicationCode != "")
            {
                this.OperationCode = this.ApplicationCode;
            }
            else if (this.OperationCode != "")
            {
                this.ApplicationCode = this.OperationCode;
            }



            if (flag)
            {
                if (this.ApplicationCode != "")
                {
                    RmsPM.BLL.SupplierSurveyOpinion cSupplierSurveyOpinion = new RmsPM.BLL.SupplierSurveyOpinion();
                    cSupplierSurveyOpinion.SupplierSurveyOpinionCode = this.ApplicationCode;
                    DataTable dSupplierSurveyOpinion = cSupplierSurveyOpinion.GetSupplierSurveyOpinions();
                    if (dSupplierSurveyOpinion != null)
                    {
                        foreach (DataRow dr in dSupplierSurveyOpinion.Select())
                        {
                            DataTable dttype = RmsPM.BLL.SupplierSurveyOpinion.GetSupplierGradeType();
                            if (dttype != null)
                            {
                                if (dttype.Rows.Count != 0)
                                {
                                    this.selectGrade.DataSource     = dttype;
                                    this.selectGrade.DataTextField  = "TypeName";
                                    this.selectGrade.DataValueField = "TypeName";
                                    this.selectGrade.DataBind();



                                    this.selectAdviceGrade.DataSource     = dttype;
                                    this.selectAdviceGrade.DataTextField  = "TypeName";
                                    this.selectAdviceGrade.DataValueField = "TypeName";
                                    this.selectAdviceGrade.DataBind();

                                    for (int i = 0; i < dttype.Rows.Count; i++)
                                    {
                                        if (this.selectGrade.Items[i].Value == dr["Grade"].ToString())
                                        {
                                            this.selectGrade.SelectedIndex = i;
                                        }
                                        if (this.selectAdviceGrade.Items[i].Value == dr["AdviceGrade"].ToString())
                                        {
                                            this.selectAdviceGrade.SelectedIndex = i;
                                        }
                                    }
                                }
                            }


                            this.txtState.Text = RmsPM.BLL.SupplierSurveyOpinion.GetSupplierSurveyOpinionStatusName(dr["State"].ToString());

                            this.inputSystemGroup.Value = dr["WorkName"].ToString();

                            this.TxtPersonName.Value = dr["ZYName"].ToString();
                            this.TxtCompanyName.Text = RmsPM.BLL.SupplierRule.GetSupplierName(dr["SupplierCode"].ToString());
                            this.Txtdate.Text        = dr["SurveyDate"].ToString();
                            this.TxtRemark.Value     = dr["Remark"].ToString();
                            //this.TxtGrade.Value = dr["Grade"].ToString();
                            //this.TxtAdviceGrade.Value = dr["AdviceGrade"].ToString();
                        }
                    }
                }
                else
                {
                    DataTable dttype = RmsPM.BLL.SupplierSurveyOpinion.GetSupplierGradeType();
                    if (dttype != null)
                    {
                        if (dttype.Rows.Count != 0)
                        {
                            this.selectGrade.DataSource     = dttype;
                            this.selectGrade.DataTextField  = "TypeName";
                            this.selectGrade.DataValueField = "TypeName";
                            this.selectGrade.DataBind();

                            this.selectAdviceGrade.DataSource     = dttype;
                            this.selectAdviceGrade.DataTextField  = "TypeName";
                            this.selectAdviceGrade.DataValueField = "TypeName";
                            this.selectAdviceGrade.DataBind();
                        }
                    }


                    this.inputSystemGroup.ClassCode = "1401";

                    this.TxtCompanyName.Text = RmsPM.BLL.SupplierRule.GetSupplierName(this.SupplierCode);
                    this.Txtdate.ReadOnly    = false;
                }
            }
            else
            {
                RmsPM.BLL.SupplierSurveyOpinion cSupplierSurveyOpinion = new RmsPM.BLL.SupplierSurveyOpinion();
                cSupplierSurveyOpinion.SupplierSurveyOpinionCode = this.ApplicationCode;
                DataTable dSupplierSurveyOpinion = cSupplierSurveyOpinion.GetSupplierSurveyOpinions();
                if (dSupplierSurveyOpinion != null)
                {
                    foreach (DataRow dr in dSupplierSurveyOpinion.Select())
                    {
                        this.lblstate.Text             = RmsPM.BLL.SupplierSurveyOpinion.GetSupplierSurveyOpinionStatusName(dr["State"].ToString());
                        this.SpanlblTaskname.InnerHtml = RmsPM.BLL.ProjectRule.GetSupplierTypeName(dr["WorkName"].ToString());

                        this.lblPersonName.Text  = dr["ZYName"].ToString();
                        this.lblCompanyname.Text = RmsPM.BLL.SupplierRule.GetSupplierName(dr["SupplierCode"].ToString());
                        this.lblDate.Text        = dr["SurveyDate"].ToString();
                        this.lblRemark.InnerHtml = System.Convert.ToString(dr["Remark"]).Replace("\n", "<br>");
                        this.lblGrade.Text       = dr["Grade"].ToString();
                        this.lblAdviceGrade.Text = dr["AdviceGrade"].ToString();
                    }
                }
            }
        }
        catch (Exception ex)
        {
        }
    }