Exemple #1
0
 void getValue(FishEntity.ReviewEntity model)
 {
     model.programId    = this.programId;
     model.Numbering    = model.code = this.oddNum;
     model.content      = richOpinion.Text;
     model.createMan    = model.modifyMan = FishEntity.Variable.User.username;
     model.userName     = FishEntity.Variable.User.username;
     model.SingleNumber = Number;
     if (rabExamine.Checked == true)
     {
         model.state = rabExamine.Text;
     }
     //else if (rabReview.Checked == true)
     //    model.state = rabReview.Text;
     //else if (rabReject.Checked == true)
     //    model.state = rabReject.Text;
     else if (radioAdopt.Checked == true)
     {
         model.state = radioAdopt.Text;
     }
     else if (radioInform.Checked == true)
     {
         model.state = radioInform.Text;
     }
 }
        public FishEntity.ReviewEntity UserName(string Numbering)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select b.userName from t_salesorder a inner join t_review b on a.Numbering=b.Numbering where programId='FormSalesRContract'and state='提交' ");
            strSql.Append("and a.Numbering='" + Numbering + "'");
            DataSet ds = MySqlHelper.Query(strSql.ToString());

            if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
            {
                FishEntity.ReviewEntity model = new FishEntity.ReviewEntity(); DataRow row = ds.Tables[0].Rows[0];
                if (row != null)
                {
                    if (row["userName"] != null)
                    {
                        model.userName = row["userName"].ToString();
                    }
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
        public FishEntity.ReviewEntity getM(DataRow row)
        {
            FishEntity.ReviewEntity model = new FishEntity.ReviewEntity();

            if (row != null)
            {
                if (row["userName"] != null)
                {
                    model.userName = row["userName"].ToString();
                }
                if (row["realname"] != null)
                {
                    model.realName = row["realName"].ToString();
                }
                if (row["programId"] != null)
                {
                    model.programId = row["programId"].ToString();
                }
                if (row["programName"] != null)
                {
                    model.programName = row["programName"].ToString();
                }
                if (row["code"] != null)
                {
                    model.code = row["code"].ToString();
                }
                if (row["date"] != null && row["date"].ToString() != "")
                {
                    model.date = DateTime.Parse(row["date"].ToString());
                }
                if (row["content"] != null)
                {
                    model.content = row["content"].ToString();
                }
                if (row["state"] != null)
                {
                    model.state = row["state"].ToString();
                }
                if (row["Numbering"] != null)
                {
                    model.Numbering = row["Numbering"].ToString();
                }
            }

            return(model);
        }
Exemple #4
0
        private void btnOk_Click(object sender, System.EventArgs e)
        {
            //if (rabReview.Checked == false && rabReject.Checked == false && rabExamine.Checked == false && radioAdopt.Checked == false && radioInform.Checked == false)
            //{
            //    MessageBox.Show("请选择");
            //    return;
            //}
            if (rabExamine.Checked == false && string.IsNullOrEmpty(texReview.Text))
            {
                MessageBox.Show("请选择送审对象");
                return;
            }

            List <FishEntity.ReviewEntity> modelList = new List <FishEntity.ReviewEntity>();

            string[] strUser;
            if (texReview.Text.Contains("|"))
            {
                string[] strSplit = texReview.Text.Split('|');

                foreach (string s in strSplit)
                {
                    model   = new FishEntity.ReviewEntity();
                    strUser = s.Trim().Split(' ');
                    if (strUser.Length >= 2)
                    {
                        getValue(model);
                        model.userNameReview = strUser[0];
                        modelList.Add(model);
                    }
                }
            }
            else if (!string.IsNullOrEmpty(texReview.Text))
            {
                strUser = texReview.Text.Trim().Split(' ');
                if (strUser.Length >= 2)
                {
                    model = new FishEntity.ReviewEntity();
                    getValue(model);
                    model.userNameReview = strUser[0];
                    modelList.Add(model);
                }
            }
            else
            {
                model = new FishEntity.ReviewEntity();
                getValue(model);
                model.userNameReview = string.Empty;
                modelList.Add(model);
            }
            if (model.state.Equals("撤审") == false)
            {
                bool result = _bll.Review(modelList);
                if (result == true)
                {
                    MessageBox.Show("送审成功");
                    this.DialogResult = DialogResult.OK;
                }
                else
                {
                    MessageBox.Show("送审失败");
                }
            }
            else if (model.state.Equals("撤审") == true)
            {
                if (_bll.examine_1(model.Numbering, model.programId, Number) == true)
                {
                    MessageBox.Show("撤审成功");
                    this.DialogResult = DialogResult.OK;
                }
                else
                {
                    if (_bll.examine(model.Numbering, model.programId) == true)
                    {
                        MessageBox.Show("撤审成功");
                        this.DialogResult = DialogResult.OK;
                    }
                    else
                    {
                        MessageBox.Show("撤审失败");
                    }
                }
            }
        }
Exemple #5
0
        void getValue(int i, FishEntity.ProcessStateEntity _list)
        {
            int             idx = dataGridView1.Rows.Add();
            DataGridViewRow row = dataGridView1.Rows[idx];

            row.Cells["id"].Value        = _list.id;
            row.Cells["code"].Value      = _list.code;
            row.Cells["Numbering"].Value = _list.Numbering;
            switch (_list.Effect)
            {
            case "有效": row.Cells["effect"].Value = false; break;

            case "无效": row.Cells["effect"].Value = true; break;

            default: row.Cells["effect"].Value = false; break;
            }
            _createmanSet = _createmanGet.createmanGet(_list.Numbering);
            if (_createmanSet != null)
            {
                row.Cells["xssqBool"].Value = _createmanSet.createman.ToString();
                row.Cells["demand"].Value   = _createmanSet.demand.ToString();
                row.Cells["Signdate"].Value = _createmanSet.Signdate.ToString();
                row.Cells["Purchasecontractnumber"].Value = _createmanSet.Purchasecontractnumber.ToString();
            }
            row.Cells["xssqExBool"].Value = string.Empty;
            //送审提交Name
            _ReviewModel = _Reviewbll.UserName(_list.Numbering);
            if (_ReviewModel != null)
            {
                row.Cells["xshtBool"].Value = _ReviewModel.userName.ToString();
            }
            row.Cells["xshtExBool"].Value = string.Empty;
            row.Cells["fksqBool"].Value   = string.Empty;
            row.Cells["fksqExBool"].Value = string.Empty;
            row.Cells["thdCode"].Value    = _list.ThdCode;
            row.Cells["thdBool"].Value    = string.Empty;
            row.Cells["bdCode"].Value     = _list.BdCode;
            row.Cells["bdBool"].Value     = string.Empty;
            row.Cells["bdExBool"].Value   = string.Empty;
            row.Cells["hwfkCode"].Value   = _list.HwfkCode;
            row.Cells["hwfkBool"].Value   = string.Empty;
            row.Cells["hwfkExBool"].Value = string.Empty;
            row.Cells["wtfkCode"].Value   = _list.WtfkCode;
            row.Cells["wtfkBool"].Value   = string.Empty;
            row.Cells["wtfkExBool"].Value = string.Empty;
            row.Cells["skjlBool"].Value   = string.Empty;
            row.Cells["skjlExBool"].Value = string.Empty;
            row.Cells["tchsBool"].Value   = string.Empty;
            row.Cells["tchsExBool"].Value = string.Empty;

            if (_list.xssqBool == true)
            {
                dataGridView1.Rows[i].Cells["xssqBool"].Style.BackColor = Color.FromName("Red");
            }
            else
            {
                dataGridView1.Rows[i].Cells["xssqBool"].Style.BackColor = Color.FromName("Blue");
            }
            if (_list.xssqExBool == true)
            {
                dataGridView1.Rows[i].Cells["xssqExBool"].Style.BackColor = Color.FromName("Red");
            }
            else
            {
                dataGridView1.Rows[i].Cells["xssqExBool"].Style.BackColor = Color.FromName("Blue");
            }
            if (_list.xshtBool == true)
            {
                dataGridView1.Rows[i].Cells["xshtBool"].Style.BackColor = Color.FromName("Red");
            }
            else
            {
                dataGridView1.Rows[i].Cells["xshtBool"].Style.BackColor = Color.FromName("Blue");
            }
            if (_list.xshtExBool == true)
            {
                dataGridView1.Rows[i].Cells["xshtExBool"].Style.BackColor = Color.FromName("Red");
            }
            else
            {
                dataGridView1.Rows[i].Cells["xshtExBool"].Style.BackColor = Color.FromName("Blue");
            }
            switch (_list.fksqBool)
            {
            case '1':  dataGridView1.Rows[i].Cells["fksqBool"].Style.BackColor = Color.FromName("Red"); break;

            case '2': dataGridView1.Rows[i].Cells["fksqBool"].Style.BackColor = Color.FromName("yellow"); break;

            case '0': dataGridView1.Rows[i].Cells["fksqBool"].Style.BackColor = Color.FromName("Blue"); break;

            case '3': dataGridView1.Rows[i].Cells["fksqBool"].Style.BackColor = Color.FromName("green"); break;

            default:
                /// <summary>
                /// null
                /// </summary>
                dataGridView1.Rows[i].Cells["fksqBool"].Style.BackColor = Color.FromName("Blue");
                break;
            }
            if (_list.fksqExBool == true)
            {
                dataGridView1.Rows[i].Cells["fksqExBool"].Style.BackColor = Color.FromName("Red");
            }
            else
            {
                dataGridView1.Rows[i].Cells["fksqExBool"].Style.BackColor = Color.FromName("Blue");
            }
            switch (_list.thdBool)
            {
            case '1': dataGridView1.Rows[i].Cells["thdBool"].Style.BackColor = Color.FromName("Red"); break;

            case '2': dataGridView1.Rows[i].Cells["thdBool"].Style.BackColor = Color.FromName("yellow"); break;

            case '0': dataGridView1.Rows[i].Cells["thdBool"].Style.BackColor = Color.FromName("Blue"); break;

            default:
                /// <summary>
                /// null
                /// </summary>
                dataGridView1.Rows[i].Cells["thdBool"].Style.BackColor = Color.FromName("Blue");
                break;
            }
            switch (_list.bdBool)
            {
            case '1': dataGridView1.Rows[i].Cells["bdBool"].Style.BackColor = Color.FromName("Red"); break;

            case '2': dataGridView1.Rows[i].Cells["bdBool"].Style.BackColor = Color.FromName("yellow"); break;

            case '0': dataGridView1.Rows[i].Cells["bdBool"].Style.BackColor = Color.FromName("Blue"); break;

            default:
                /// <summary>
                /// null
                /// </summary>
                dataGridView1.Rows[i].Cells["bdBool"].Style.BackColor = Color.FromName("Blue");
                break;
            }
            if (_list.bdExBool == true)
            {
                dataGridView1.Rows[i].Cells["bdExBool"].Style.BackColor = Color.FromName("Red");
                dataGridView1.Rows[i].Cells["bdBool"].Style.BackColor   = Color.FromName("Red");
            }
            else
            {
                dataGridView1.Rows[i].Cells["bdExBool"].Style.BackColor = Color.FromName("Blue");
            }
            switch (_list.hwfkBool)
            {
            case '1': dataGridView1.Rows[i].Cells["hwfkBool"].Style.BackColor = Color.FromName("Red"); break;

            case '2': dataGridView1.Rows[i].Cells["hwfkBool"].Style.BackColor = Color.FromName("yellow"); break;

            case '0': dataGridView1.Rows[i].Cells["hwfkBool"].Style.BackColor = Color.FromName("Blue"); break;

            default:
                /// <summary>
                /// null
                /// </summary>
                dataGridView1.Rows[i].Cells["hwfkBool"].Style.BackColor = Color.FromName("Blue");
                break;
            }
            if (_list.hwfkExBool == true)
            {
                dataGridView1.Rows[i].Cells["hwfkExBool"].Style.BackColor = Color.FromName("Red");
            }
            else
            {
                dataGridView1.Rows[i].Cells["hwfkExBool"].Style.BackColor = Color.FromName("Blue");
            }
            switch (_list.wtfkBool)
            {
            case '1': dataGridView1.Rows[i].Cells["wtfkBool"].Style.BackColor = Color.FromName("Red"); break;

            case '2': dataGridView1.Rows[i].Cells["wtfkBool"].Style.BackColor = Color.FromName("yellow"); break;

            case '0': dataGridView1.Rows[i].Cells["wtfkBool"].Style.BackColor = Color.FromName("Blue"); break;

            default:
                /// <summary>
                /// null
                /// </summary>
                dataGridView1.Rows[i].Cells["wtfkBool"].Style.BackColor = Color.FromName("Blue");
                break;
            }
            if (_list.wtfkExBool == true)
            {
                dataGridView1.Rows[i].Cells["wtfkExBool"].Style.BackColor = Color.FromName("Red");
            }
            else
            {
                dataGridView1.Rows[i].Cells["wtfkExBool"].Style.BackColor = Color.FromName("Blue");
            }
            switch (_list.skjlBool)
            {
            case '1': dataGridView1.Rows[i].Cells["skjlBool"].Style.BackColor = Color.FromName("Red"); break;

            case '2': dataGridView1.Rows[i].Cells["skjlBool"].Style.BackColor = Color.FromName("yellow"); break;

            case '0': dataGridView1.Rows[i].Cells["skjlBool"].Style.BackColor = Color.FromName("Blue"); break;

            default:
                /// <summary>
                /// null
                /// </summary>
                dataGridView1.Rows[i].Cells["skjlBool"].Style.BackColor = Color.FromName("Blue");
                break;
            }
            if (_list.skjlExBool == true)
            {
                dataGridView1.Rows[i].Cells["skjlExBool"].Style.BackColor = Color.FromName("Red");
            }
            else
            {
                dataGridView1.Rows[i].Cells["skjlExBool"].Style.BackColor = Color.FromName("Blue");
            }
            if (_list.tchsBool == true)
            {
                dataGridView1.Rows[i].Cells["tchsBool"].Style.BackColor = Color.FromName("Red");
            }
            else
            {
                dataGridView1.Rows[i].Cells["tchsBool"].Style.BackColor = Color.FromName("Blue");
            }
            if (_list.tchsExBool == true)
            {
                dataGridView1.Rows[i].Cells["tchsExBool"].Style.BackColor = Color.FromName("Red");
            }
            else
            {
                dataGridView1.Rows[i].Cells["tchsExBool"].Style.BackColor = Color.FromName("Blue");
            }
        }