Example #1
0
        private void 补打PToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (dataGridView1.SelectedRows.Count == 0)
            {
                MessageBox.Show(this, "请选中一条单证!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            string caseNo = this.dataGridView1.SelectedRows[0].Cells["colCaseNo"].Value.ToString();
            PolicyResponseEntity response = ws.GetPolicy(GlobalVar.IAUsername, GlobalVar.IAPassword, caseNo);

            if (string.IsNullOrEmpty(response.Trace.ErrorMsg))
            {
                if (MessageBox.Show(this, "请在打印机中准备好单证,确定补打?", this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Information)
                    == System.Windows.Forms.DialogResult.OK)
                {
                    t_Case policy = response.Policy;
                    Insurance.Instance.PrintIt(policy);
                    this.dataGridView1.SelectedRows[0].DefaultCellStyle.BackColor = Color.Gray;
                }
            }
            else
            {
                MessageBox.Show(this, response.Trace.ErrorMsg, response.Trace.Detail, MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Example #2
0
        public static PolicyResponseEntity GetPolicy(string username, string password, string caseNo)
        {
            PolicyResponseEntity response = new PolicyResponseEntity();

            try
            {
                UserLoginResponse userLogin = UserClass.AccessCheck(username, password);

                if (string.IsNullOrEmpty(userLogin.Trace.ErrorMsg))
                {
                    response.Policy = Case.Get(caseNo);
                }
                else
                {
                    response.Trace = userLogin.Trace;
                }
            }
            catch (Exception e)
            {
                response.Trace.ErrorMsg = e.Message;
                Common.LogIt(e.ToString());
            }

            return(response);
        }