Пример #1
0
        private void imbt_OK_Click(object sender, EventArgs e)
        {
            bool chkFlag = true;

            for (int i = 0; i < dgvDuty.Rows.Count; i++)
            {
                if (dgvDuty.Rows[i].Cells[0].Value.ToString() == tb_Duty.Text.Trim())
                {
                    chkFlag = false;
                    break;
                }
            }

            if (!chkFlag)
            {
                MessageBox.Show("责任单位重复");
                return;
            }

            string Err = refWebRepairInfo.Instance.InsertDutyInfo(tb_Duty.Text.Trim(), tb_DutyDesc.Text.Trim());

            if (Err == "OK")
            {
                GetDutyData = new GetDuty(GetDutyInfo);
                GetDutyData.BeginInvoke(null, null);
                MessageBox.Show("新增责任单位完成", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                tb_Duty.Text     = "";
                tb_DutyDesc.Text = "";
            }
            else
            {
                MessageBox.Show(string.Format("新增责任单位失败[{0}]", Err), "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #2
0
 private void dgvDuty_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     if (e.RowIndex != -1)
     {
         string DutyCode = dgvDuty.Rows[e.RowIndex].Cells[0].Value.ToString();
         if (MessageBox.Show(string.Format("确定要删除责任单位[{0}]吗?", DutyCode), "信息提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.OK)
         {
             string Err = refWebRepairInfo.Instance.DeleteDutyInfo(DutyCode);
             if (Err == "OK")
             {
                 GetDutyData = new GetDuty(GetDutyInfo);
                 GetDutyData.BeginInvoke(null, null);
                 MessageBox.Show("删除责任单位完成", "删除信息提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
             else
             {
                 MessageBox.Show(string.Format("删除责任单位失败[{0}]", Err), "删除信息提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
     }
 }
Пример #3
0
 private void FrmDuty_Load(object sender, EventArgs e)
 {
     GetDutyData = new GetDuty(GetDutyInfo);
     GetDutyData.BeginInvoke(null, null);
 }
Пример #4
0
        private void FrmRepair_Load(object sender, EventArgs e)
        {
            try
            {
                #region 添加应用程序
                if (this.sMain.gUserInfo.rolecaption == "系统开发员")
                {
                    IList <IDictionary <string, object> > lsfunls = new List <IDictionary <string, object> >();
                    IDictionary <string, object>          funls   = new Dictionary <string, object>();
                    funls = new Dictionary <string, object>();
                    funls.Add("FUNID", "PD_Transfer".ToUpper());
                    funls.Add("PROGID", this.Name);
                    funls.Add("FUNNAME", "生产转账");
                    funls.Add("FUNDESC", "生产转账");
                    lsfunls.Add(funls);

                    Dictionary <string, object> dic = new Dictionary <string, object>();
                    dic.Add("PROGID", this.Name);
                    dic.Add("PROGNAME", this.Text);
                    dic.Add("PROGDESC", this.Text);

                    FrmBLL.publicfuntion.GetFromCtls(this, ref lsfunls);
                    FrmBLL.publicfuntion.AddProgInfo(dic, lsfunls);
                }
                #endregion
            }
            catch (Exception ex)
            {
                this.sMain.ShowPrgMsg(ex.Message, MainParent.MsgType.Error);
            }



            tbrepairuser.Text = sMain.gUserInfo.userId;

            RCList = new GetRCList(GetReasonCode);
            RCList.BeginInvoke(null, null);
            CraftInfo = new GetCraftInfo(GetAllCraftInfo);
            CraftInfo.BeginInvoke(null, null);
            GetDutyData = new GetDuty(GetDutyInfo);
            GetDutyData.BeginInvoke(null, null);

            #region 单元格交替颜色
            this.dgvallrepairinfo.RowsDefaultCellStyle.BackColor            = Color.Bisque;
            this.dgvallrepairinfo.AlternatingRowsDefaultCellStyle.BackColor = Color.Beige;

            this.dgvRepairReport.RowsDefaultCellStyle.BackColor            = Color.Bisque;
            this.dgvRepairReport.AlternatingRowsDefaultCellStyle.BackColor = Color.Beige;

            this.dgvQrepair.RowsDefaultCellStyle.BackColor            = Color.Bisque;
            this.dgvQrepair.AlternatingRowsDefaultCellStyle.BackColor = Color.Beige;
            #endregion

            tabSelect.SelectedIndex = 3;


            //for (int i = 0; i < 24; i++)
            //{
            //    combStime.Items.Add(i.ToString().PadLeft(2, '0') + ":30");
            //    combEtime.Items.Add(i.ToString().PadLeft(2, '0') + ":30");
            //}
            CB_Class.Items.Clear();
            CB_Class.Items.Add("ALL");
            CB_Class.Items.Add("D");
            CB_Class.Items.Add("N");
            CB_Class.SelectedIndex = 0;

            GetColnumName();

            FrmBLL.cdbAccess ass = new FrmBLL.cdbAccess();
            ass.ExecuteOracleCommand("delete from tProduct");
        }
Пример #5
0
 /// <summary>
 /// 刷新责任单位
 /// </summary>
 public void RefreshDutyInfo()
 {
     GetDutyData = new GetDuty(GetDutyInfo);
     GetDutyData.BeginInvoke(null, null);
 }