Ejemplo n.º 1
0
        public ReSubmitConTemp(SignSocketClient sc, HDJContract contract)
            : this()
        {
            this._sc = sc;
            this.Id = contract.Id;
            this.Contract = contract;

        }
Ejemplo n.º 2
0
        public HDJContract(HDJContract contract)
        {
            this.m_name           = contract.m_name;
            this.m_submitDate     = contract.m_submitDate;
            this.m_id             = contract.m_id;
            this.m_columnDatas    = contract.m_columnDatas;
            this.m_submitEmployee = contract.m_submitEmployee;
            this.m_conTemp        = contract.m_conTemp;
//            this.m_currLevel = contract.m_currLevel;
//            this.m_maxLevel = contract.m_maxLevel;
            this.m_signResults = contract.m_signResults;
            this.m_signRemarks = contract.m_signRemarks;
        }
Ejemplo n.º 3
0
 public HDJContract(HDJContract contract)
 {
     this.m_name = contract.m_name;
     this.m_submitDate = contract.m_submitDate;
     this.m_id = contract.m_id;
     this.m_columnDatas = contract.m_columnDatas;
     this.m_submitEmployee = contract.m_submitEmployee;
     this.m_conTemp = contract.m_conTemp;
     //            this.m_currLevel = contract.m_currLevel;
     //            this.m_maxLevel = contract.m_maxLevel;
     this.m_signResults = contract.m_signResults;
     this.m_signRemarks = contract.m_signRemarks;
 }
Ejemplo n.º 4
0
        private async void ReSubmitConTemp_Load(object sender, EventArgs e)
        {
            try
            {
                HDJContract hdj = new HDJContract();
                hdj = await _sc.GetHDJContract(Id);

                this.ConTempName.Text = hdj.Name;
                this.ConTempId.Text = hdj.Id;

                // 显示5个栏目的信息
                List<string> columnlist = new List<string>();
                columnlist = hdj.ConTemp.ColumnNames;
                this.Column1.Text = columnlist[0].ToString();
                this.Column2.Text = columnlist[1].ToString();
                this.Column3.Text = columnlist[2].ToString();
                this.Column4.Text = columnlist[3].ToString();
                this.Column5.Text = columnlist[4].ToString();

                // 2015-07-01 Modify by gatieme
                // 显示项目的信息
                List<String> columnInfo = hdj.ColumnDatas;
                this.Column1Info.Text = columnInfo[0].ToString();
                this.Column2Info.Text = columnInfo[1].ToString();
                this.Column3Info.Text = columnInfo[2].ToString();
                this.Column4Info.Text = columnInfo[3].ToString();
                this.Column5Info.Text = columnInfo[4].ToString();

                // 显示8个签字人的信息
                this.Sign1.Text = hdj.ConTemp.SignDatas[0].SignInfo.ToString();
                this.Sign2.Text = hdj.ConTemp.SignDatas[1].SignInfo.ToString();
                this.Sign3.Text = hdj.ConTemp.SignDatas[2].SignInfo.ToString();
                this.Sign4.Text = hdj.ConTemp.SignDatas[3].SignInfo.ToString();
                this.Sign5.Text = hdj.ConTemp.SignDatas[4].SignInfo.ToString();
                this.Sign6.Text = hdj.ConTemp.SignDatas[5].SignInfo.ToString();
                this.Sign7.Text = hdj.ConTemp.SignDatas[6].SignInfo.ToString();
                this.Sign8.Text = hdj.ConTemp.SignDatas[7].SignInfo.ToString();

                this.SignPer1.Text = hdj.ConTemp.SignDatas[0].SignEmployee.Name.ToString();
                this.SignPer2.Text = hdj.ConTemp.SignDatas[1].SignEmployee.Name.ToString();
                this.SignPer3.Text = hdj.ConTemp.SignDatas[2].SignEmployee.Name.ToString();
                this.SignPer4.Text = hdj.ConTemp.SignDatas[3].SignEmployee.Name.ToString();
                this.SignPer5.Text = hdj.ConTemp.SignDatas[4].SignEmployee.Name.ToString();
                this.SignPer6.Text = hdj.ConTemp.SignDatas[5].SignEmployee.Name.ToString();
                this.SignPer7.Text = hdj.ConTemp.SignDatas[6].SignEmployee.Name.ToString();
                this.SignPer8.Text = hdj.ConTemp.SignDatas[7].SignEmployee.Name.ToString();
            }
            catch
            {
                MessageBox.Show("加载数据失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);

                Logging.AddLog("重新提交时加载数据失败!");

                if (MessageBox.Show("好吧,我们的程序出现点问题需要重新启动\n点击\"确定\"重启\n点击\"取消\"退出程序?",
                    "程序异常",
                    MessageBoxButtons.OKCancel,
                    MessageBoxIcon.Question) == DialogResult.OK)
                {
                    Application.Restart();
                }
                else
                {
                    Application.Exit();
                }
            }
        }
Ejemplo n.º 5
0
        // 重新提交按钮单机以后,应该进行一次刷新
        // modify by gatieme 2015-07-02 9:47 修改提交方案wield异步
        private  void button1_Click(object sender, EventArgs e)
        {
            if (this.Column1Info.Text.Trim() != "" && this.Column2Info.Text.Trim() != "" &&
                this.Column3Info.Text.Trim() != "" && this.Column4Info.Text.Trim() != "" && this.Column5Info.Text.Trim() != "")
            {
                if (MessageBox.Show("您确定要提交所填方案吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    HDJContract hdj = new HDJContract();
                    hdj.Id = this.ConTempId.Text;

                    List<String> list = new List<string>();
                    list.Add(this.Column1Info.Text.ToString());
                    list.Add(this.Column2Info.Text.ToString());
                    list.Add(this.Column3Info.Text.ToString());
                    list.Add(this.Column4Info.Text.ToString());
                    list.Add(this.Column5Info.Text.ToString());
                    hdj.ColumnDatas = list;

                    string result =  _sc.ModifyContractTemplate(hdj);
                    if (result == Response.MODIFY_HDJCONTRACT_SUCCESS.ToString())
                    {
                        MessageBox.Show("提交成功!", "提示", MessageBoxButtons.OK);

                        //  2015-07-01 14:58 modify by gatieme
                        //  重新提交后,应该设置OK
                        //this.DialogResult = DialogResult.OK;
                        //this.Close();         // 不能关闭,否则会异常
                    }
                    else if (result == "服务器连接中断")
                    {
                        MessageBox.Show("服务器连接中断,提交失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    else
                    {
                        MessageBox.Show("提交失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
            }
        }
Ejemplo n.º 6
0
 public HDJContractWithWorkload(HDJContract contract)
     : base(contract)
 {
     this.WorkLoads = new List <ContractWorkload>();
 }
Ejemplo n.º 7
0
        /// <summary>
        /// 查询会签单信息
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public Task<HDJContract> GetHDJContract(string Id)
        {
            return Task.Factory.StartNew(() =>
            {
                try
                {
                    SocketMessage sm = new SocketMessage(Request.GET_HDJCONTRACT_REQUEST, Id);
                    ClientSocket.Send(Encoding.UTF8.GetBytes(sm.Package));
                    string recMsg = null;
                    lock (recivebuffer)
                    {
                        recLength = ClientSocket.Receive(recivebuffer);
                        recMsg = Encoding.UTF8.GetString(recivebuffer, 0, recLength);
                    }
                    string[] Msg = recMsg.Split(SocketMessage.DEFAULT_SEPARATOR);
                    
                    if (Msg[0] == Response.GET_HDJCONTRACT_SUCCESS.ToString())
                    {
                        HDJContract list = new HDJContract();
                        list = JsonConvert.DeserializeObject<HDJContract>(Msg[2]);

                        return list;
                    }
                    else
                    {
                        Logging.AddLog("查询会签单信息失败!");
                        return null;
                    }
                }
                catch
                {
                    Logging.AddLog("查询会签单信息失败(服务器连接中断)!");
                    return null;
                }
            });
        }
Ejemplo n.º 8
0
         /// <summary>
         /// 提交签单
         /// </summary>
         /// <param name="hdj"></param>
         /// <returns></returns>
        public string InsertHDJContract(HDJContract hdj)
        {
            //return Task.Factory.StartNew(() =>
            {
                try
                {
                    SocketMessage sm = new SocketMessage(Request.INSERT_HDJCONTRACT_REQUEST, hdj);
                    ClientSocket.Send(Encoding.UTF8.GetBytes(sm.Package));

                    recLength = ClientSocket.Receive(recivebuffer);
                    string recMsg = Encoding.UTF8.GetString(recivebuffer, 0, recLength);
                    string[] Msg = recMsg.Split(SocketMessage.DEFAULT_SEPARATOR);

                    if (Msg[0] == Response.INSERT_HDJCONTRACT_SUCCESS.ToString())
                    {
                        Logging.AddLog("提交签单成功!");
                    }
                    else
                    {
                        Logging.AddLog("提交签单失败!");
                    }
                    return Msg[0];
                }
                catch
                {
                    Logging.AddLog("提交签单失败(服务器连接中断)!");
                    return "服务器连接中断";
                }
            //});
            }
        }
Ejemplo n.º 9
0
 public HDJContractWithWorkload(HDJContract contract)
     : base(contract)
 {
     this.WorkLoads = new List<ContractWorkload>();
 }
Ejemplo n.º 10
0
        private void button1_Click(object sender, EventArgs e)                   //提交会签单信息
        {
            if (this.pName.SelectedText.Trim() != "" && this.xmName.Text.Trim() != "" &&
                this.ProjectPanel.Text.Trim() != "" && this.Column4Info.Text.Trim() != "" && this.Column5Info.Text.Trim() != ""
                && this.label3.Text.Trim() != "")
            {
                if (MessageBox.Show("您确定要提交所填方案吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    HDJContract hdj = new HDJContract();
                    hdj.Name = this.ConName.Text;
                    hdj.SubmitEmployee = UserHelper.UserInfo;
                    Templete temp = new Templete();
                    temp.TempId = UserHelper.SelectedTemp.TempId;
                    hdj.ConTemp = temp;
                    hdj.Id = this.IdNo.Text.Trim();

                    List<String> list = new List<string>();
                    list.Add(this.pName.SelectedValue.ToString());
                    list.Add(this.xmName.Text.ToString());
                    list.Add(this.ProjectPanel.Text.ToString());
                    list.Add(this.Column4Info.Text.ToString());
                    list.Add(this.Column5Info.Text.ToString());
                    hdj.ColumnDatas = list;

                    string result = _sc.InsertHDJContract(hdj);
                    if (result == Response.INSERT_HDJCONTRACT_SUCCESS.ToString())
                    {
                        this.ConTempInfo.Visible = false;
                        this.pName.Text = "";
                        this.xmName.Text = "";
                        this.ProjectPanel.Text = "";
                        this.Column4Info.Text = "";
                        this.Column5Info.Text = "";
                        this.IdNo.Text = "";

                        MessageBox.Show("提交成功!", "提示", MessageBoxButtons.OK);

                        //if(hdj.ConTemp.SignDatas.Where())
                        // 2015-07-03 11:25  提交成功后应该刷新一下待签字结构体
                        this.BindPenddingList(true);        //  强制刷新待审核的数据

                        /////////////////////////////////////////
                        /// 每次提交一个新的单子之后,待审核数目增加 1///
                        /////////////////////////////////////////
                        MainWindow mw = (MainWindow)this.MdiParent;
                        foreach (TreeNode t in mw.treeView1.Nodes)
                        {
                            if (t.Text.Contains("提交管理("))
                            {
                                int count = Convert.ToInt32(t.Text.Split('(')[1].Split(')')[0]);    // 提交管理

                                t.Text = "提交管理(" + (count + 1) + ")";

                                //t.Nodes[0]  -=>  提交方案
                                //t.Nodes[1]  -=>  审核中
                                //t.Nodes[2]  -=>  已拒绝
                                //t.Nodes[3]  -=>  已通过
                                int childcount = Convert.ToInt32(t.Nodes[1].Text.Split('(')[1].Split(')')[0]);
                                t.Nodes[1].Text = "审核中(" + (childcount + 1) + ")";

                            }
                        }
                    }
                    else if (result == "服务器连接中断")
                    {
                        MessageBox.Show("服务器连接中断,提交失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    else if (result == Response.INSERT_HDJCONTRACT_EXIST.ToString())
                    {
                        MessageBox.Show("该会签单编号已经存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    else
                    {
                        MessageBox.Show("提交失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
            }
            else
            {
                MessageBox.Show("请将所有空白处填完!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Ejemplo n.º 11
0
        private async void SignConTemp_Load(object sender, EventArgs e)
        {
            //cmd.ShowOpaqueLayer(this, 125, true);
            bool canview = false;
            try
            {
                //this.MinimizeBox = false;
                //this.MaximizeBox = false;

                if (_type == 1)
                {
                    this.RemarkList.Visible = true;
                    this.RemarkList.Height = 140;

                    canview = true;
                }
                if (_type == 2)
                {
                    this.RemarkList.Visible = true;
                    this.RemarkList.Height = 140;

                    canview = true;
                }
                if (_type == 3)
                {
                    this.RemarkList.Visible = true;
                    this.RemarkList.Height = 140;

                    canview = true;
                }
                if (_type == 4)
                {
                    this.Reason.Visible = true;
                    this.AgreeConTemp.Visible = true;
                    this.RefuseConTemp.Visible = true;
                }
                if (_type == 5)
                {
 
                }

                HDJContract hdj = new HDJContract();
                hdj = await  _sc.GetHDJContract(Id);

                this.ConTempName.Text = hdj.Name;
                this.ConTempId.Text = hdj.Id;
                List<string> columnlist = new List<string>();
                columnlist = hdj.ConTemp.ColumnNames;
                this.Column1.Text = columnlist[0].ToString();
                this.Column2.Text = columnlist[1].ToString();
                this.Column3.Text = columnlist[2].ToString();
                this.Column4.Text = columnlist[3].ToString();
                this.Column5.Text = columnlist[4].ToString();

                this.Sign1.Text = hdj.ConTemp.SignDatas[0].SignInfo.ToString();
                this.Sign2.Text = hdj.ConTemp.SignDatas[1].SignInfo.ToString();
                this.Sign3.Text = hdj.ConTemp.SignDatas[2].SignInfo.ToString();
                this.Sign4.Text = hdj.ConTemp.SignDatas[3].SignInfo.ToString();
                this.Sign5.Text = hdj.ConTemp.SignDatas[4].SignInfo.ToString();
                this.Sign6.Text = hdj.ConTemp.SignDatas[5].SignInfo.ToString();
                this.Sign7.Text = hdj.ConTemp.SignDatas[6].SignInfo.ToString();
                this.Sign8.Text = hdj.ConTemp.SignDatas[7].SignInfo.ToString();

                this.Column1Info.Text = hdj.ColumnDatas[0].ToString();
                this.Column2Info.Text = hdj.ColumnDatas[1].ToString(); 
                this.Column3Info.Text = hdj.ColumnDatas[2].ToString();
                this.Column4Info.Text = hdj.ColumnDatas[3].ToString();
                this.Column5Info.Text = hdj.ColumnDatas[4].ToString();

                for (int s = 0; s < hdj.ConTemp.SignDatas.Count; s++)
                {
                    if (hdj.ConTemp.SignDatas[s].SignEmployee.Name == UserHelper.UserInfo.Name)
                    {
                        if (hdj.ConTemp.SignDatas[s].CanView == 1)
                        {
                            canview = true;
                        }
                    }
                }

                if (canview)
                {
                    string result1 = hdj.SignResults[0] == 1 ? "(同意)" : (hdj.SignResults[0] == 0 ? "(未处理)" : "(拒绝)");
                    string result2 = hdj.SignResults[1] == 1 ? "(同意)" : (hdj.SignResults[1] == 0 ? "(未处理)" : "(拒绝)");
                    string result3 = hdj.SignResults[2] == 1 ? "(同意)" : (hdj.SignResults[2] == 0 ? "(未处理)" : "(拒绝)");
                    string result4 = hdj.SignResults[3] == 1 ? "(同意)" : (hdj.SignResults[3] == 0 ? "(未处理)" : "(拒绝)");
                    string result5 = hdj.SignResults[4] == 1 ? "(同意)" : (hdj.SignResults[4] == 0 ? "(未处理)" : "(拒绝)");
                    string result6 = hdj.SignResults[5] == 1 ? "(同意)" : (hdj.SignResults[5] == 0 ? "(未处理)" : "(拒绝)");
                    string result7 = hdj.SignResults[6] == 1 ? "(同意)" : (hdj.SignResults[6] == 0 ? "(未处理)" : "(拒绝)");
                    string result8 = hdj.SignResults[7] == 1 ? "(同意)" : (hdj.SignResults[7] == 0 ? "(未处理)" : "(拒绝)");

                    this.SignPer1.Text = hdj.ConTemp.SignDatas[0].SignEmployee.Name.ToString() + result1;
                    this.SignPer2.Text = hdj.ConTemp.SignDatas[1].SignEmployee.Name.ToString() + result2;
                    this.SignPer3.Text = hdj.ConTemp.SignDatas[2].SignEmployee.Name.ToString() + result3;
                    this.SignPer4.Text = hdj.ConTemp.SignDatas[3].SignEmployee.Name.ToString() + result4;
                    this.SignPer5.Text = hdj.ConTemp.SignDatas[4].SignEmployee.Name.ToString() + result5;
                    this.SignPer6.Text = hdj.ConTemp.SignDatas[5].SignEmployee.Name.ToString() + result6;
                    this.SignPer7.Text = hdj.ConTemp.SignDatas[6].SignEmployee.Name.ToString() + result7;
                    this.SignPer8.Text = hdj.ConTemp.SignDatas[7].SignEmployee.Name.ToString() + result8;

                    this.RemarkList.Visible = true;
                }
                else
                {
                    this.SignPer1.Text = hdj.ConTemp.SignDatas[0].SignEmployee.Name.ToString();
                    this.SignPer2.Text = hdj.ConTemp.SignDatas[1].SignEmployee.Name.ToString();
                    this.SignPer3.Text = hdj.ConTemp.SignDatas[2].SignEmployee.Name.ToString(); 
                    this.SignPer4.Text = hdj.ConTemp.SignDatas[3].SignEmployee.Name.ToString();
                    this.SignPer5.Text = hdj.ConTemp.SignDatas[4].SignEmployee.Name.ToString();
                    this.SignPer6.Text = hdj.ConTemp.SignDatas[5].SignEmployee.Name.ToString();
                    this.SignPer7.Text = hdj.ConTemp.SignDatas[6].SignEmployee.Name.ToString();
                    this.SignPer8.Text = hdj.ConTemp.SignDatas[7].SignEmployee.Name.ToString();

                    this.RemarkList.Visible = false;
                    this.Reason.Location = new Point(35, 524);
                    this.AgreeConTemp.Location = new Point(314, 604);
                    this.RefuseConTemp.Location = new Point(567, 604);
                    this.Height = 710;
                }

                this.RemarkList.Items.Add("备注信息:");
                if (hdj.SignRemarks != null)
                {
                    for (int i = 0; i < hdj.SignRemarks.Count; i++)
                    {
                        if ((hdj.SignRemarks[i]) != "")
                        {
                            this.RemarkList.Items.Add("   " + hdj.ConTemp.SignDatas[i].SignEmployee.Name.ToString() + ":" + hdj.SignRemarks[i].ToString());
                        }
                    }
                }
                if (this.RemarkList.Items.Count == 1)
                {
                    this.RemarkList.Visible = false;
                    this.Reason.Location = new Point(35,524);
                    this.AgreeConTemp.Location = new Point(314, 604);
                    this.RefuseConTemp.Location = new Point(567, 604);
                    this.Height = 710;
                }
                //cmd.HideOpaqueLayer();
            }
            catch
            {
                MessageBox.Show("加载数据失败!");
                Logging.AddLog("查看签单详细信息失败!");

                if (MessageBox.Show("好吧,我们的程序出现点问题需要重新启动\n点击\"确定\"重启\n点击\"取消\"退出程序?",
                    "提示",
                    MessageBoxButtons.OKCancel,
                    MessageBoxIcon.Question) == DialogResult.OK)
                {
                    Application.Restart();
                }
                else
                {
                    Application.Exit();
                }
            }
        }