コード例 #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            string sErr = "";

            BUS.LIST_TASKControl ctr = new BUS.LIST_TASKControl();
            DTO.LIST_TASKInfo    inf = new DTO.LIST_TASKInfo();

            if (_processStatus == "C")
            {
                if (!ctr.IsExist(_dtb, txtCode.Text))
                {
                    ctr.Add(GetDataFromForm(inf), ref sErr);
                }
                else
                {
                    sErr = txtCode.Text.Trim() + " is exist!";
                }
            }
            else if (_processStatus == "A")
            {
                sErr = ctr.InsertUpdate(GetDataFromForm(inf));
            }
            if (sErr == "")
            {
                _processStatus = "V";
                EnableForm(false);
            }
            else
            {
                lbErr.Text = sErr;
            }
        }
コード例 #2
0
        private static string TaskCmd(Dictionary <string, object> valueList)
        {
            BUS.LIST_TASKControl ctr = new BUS.LIST_TASKControl();
            if (_appConnect != "")
            {
                BUS.CommonControl.SetConnection(_appConnect);
            }
            object id = null;

            if (valueList.TryGetValue("id", out id))
            {
                DTO.LIST_TASKInfo infTask = ctr.Get(_db, id.ToString(), ref sErr);
                if (infTask.IsUse == "N")
                {
                    return("Task is suppend");
                }
                try
                {
                    if (infTask.Type != "S")
                    {
                        EmailNormal(valueList, infTask);
                    }
                    else
                    {
                        EmailSingle(valueList, infTask);
                    }
                }
                catch (Exception ex)
                {
                    return(ex.Message);
                }
            }
            return(sErr);
        }
コード例 #3
0
ファイル: FrmTransferOut.cs プロジェクト: mwilian/demos
 private void FrmTransferOut_Load(object sender, EventArgs e)
 {
     if (_type == "QD")
     {
         BUS.LIST_QDControl control = new BUS.LIST_QDControl();
         dt = control.GetTransferOut_LIST_QD(_db, QD_CODE, ref sErr);
     }
     else if (_type == "QDADD")
     {
         BUS.LIST_QD_SCHEMAControl control = new BUS.LIST_QD_SCHEMAControl();
         if (QD_CODE != "")
         {
             DTO.LIST_QD_SCHEMAInfo inf = control.Get(_db, QD_CODE, ref sErr);
             dt = inf.ToDataTable();
             dt.Rows.Add(inf.ToDataRow(dt));
             dt.TableName = "Table";
         }
         else
         {
             dt = control.GetAll(_db, ref sErr);
         }
     }
     else if (_type == "TASK")
     {
         BUS.LIST_TASKControl control = new BUS.LIST_TASKControl();
         if (QD_CODE != "")
         {
             DTO.LIST_TASKInfo inf = control.Get(_db, QD_CODE, ref sErr);
             dt = DTO.LIST_TASKInfo.ToDataTable();
             dt.Rows.Add(inf.ToDataRow(dt));
             dt.TableName = "Table";
         }
         else
         {
             dt = control.GetAll(_db, ref sErr);
         }
     }
     else if (_type == "POD")
     {
         BUS.PODControl control = new BUS.PODControl();
         if (QD_CODE != "")
         {
             DTO.PODInfo inf = control.Get(QD_CODE, ref sErr);
             dt = DTO.PODInfo.ToDataTable();
             dt.Rows.Add(inf.ToDataRow(dt));
             dt.TableName = "Table";
         }
         else
         {
             dt = control.GetAll(ref sErr);
         }
     }
     dtEnd = dt.Copy();
     radGridView1.DataSource = dtEnd;
     radGridView1.RetrieveStructure();
 }
コード例 #4
0
 private void btnEdit_Click(object sender, EventArgs e)
 {
     BUS.LIST_TASKControl ctr = new BUS.LIST_TASKControl();
     if (ctr.IsExist(_dtb, txtCode.Text))
     {
         EnableForm(true);
         //ddlQD.Enabled = false;
         txtCode.Enabled = false;
         _processStatus  = "A";
     }
 }
コード例 #5
0
        private void btnLoad_Click(object sender, EventArgs e)
        {
            if (_type == "QD")
            {
                BUS.LIST_QDControl control = new BUS.LIST_QDControl();
                dt           = control.ToTransferInStruct();
                dt.TableName = "Table";
                foreach (DataColumn col in dt.Columns)
                {
                    col.DataType = typeof(string);
                }
            }
            else if (_type == "QDADD")
            {
                BUS.LIST_QD_SCHEMAControl control = new BUS.LIST_QD_SCHEMAControl();
                dt           = control.ToTransferInStruct();
                dt.TableName = "Table";
                foreach (DataColumn col in dt.Columns)
                {
                    col.DataType = typeof(string);
                }
            }
            else if (_type == "TASK")
            {
                BUS.LIST_TASKControl control = new BUS.LIST_TASKControl();
                dt           = control.ToTransferInStruct();
                dt.TableName = "Table";
                foreach (DataColumn col in dt.Columns)
                {
                    col.DataType = typeof(string);
                }
            }
            else if (_type == "POD")
            {
                BUS.PODControl control = new BUS.PODControl();
                dt           = control.ToTransferInStruct();
                dt.TableName = "Table";
                foreach (DataColumn col in dt.Columns)
                {
                    col.DataType = typeof(string);
                }
            }
            BUS.CommonControl commonCtr = new BUS.CommonControl();

            try
            {
                dt.ReadXml(txtFileName.Text);
                dt = commonCtr.ValidatedDataTransferIn(dt, _type);
                radGridView1.DataSource = dt;
                radGridView1.RetrieveStructure();
                radGridView1.RootTable.Columns["tmp_Validated"].Visible = false;
            }
            catch { }
        }
コード例 #6
0
        private void btnRun_Click(object sender, EventArgs e)
        {
            BUS.LIST_TASKControl ctr = new BUS.LIST_TASKControl();
            if (ctr.IsExist(_dtb, txtCode.Text))
            {
                DTO.LIST_TASKInfo inf = new DTO.LIST_TASKInfo();
                inf = GetDataFromForm(inf);
                frmTestMail frm = new frmTestMail(GetDataFromForm(inf));

                frm.ShowDialog();
            }
        }
コード例 #7
0
 private void btnCopy_Click(object sender, EventArgs e)
 {
     BUS.LIST_TASKControl ctr = new BUS.LIST_TASKControl();
     if (ctr.IsExist(_dtb, txtCode.Text))
     {
         EnableForm(true);
         txtCode.Focus();
         txtCode.SelectAll();
         //txtCode.Text = "";
         //_code = "";
         _processStatus = "C";
     }
 }
コード例 #8
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     BUS.LIST_TASKControl ctr = new BUS.LIST_TASKControl();
     if (ctr.IsExist(_dtb, txtCode.Text))
     {
         if (MessageBox.Show("Do you want to delete " + txtCode.Text + " schema?", "Message", MessageBoxButtons.OKCancel) == DialogResult.OK)
         {
             string sErr = ctr.Delete(_dtb, txtCode.Text);
             RefreshForm("");
             EnableForm(false);
             _processStatus = "";
         }
     }
 }
コード例 #9
0
        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            frmEmail frm = new frmEmail(_dtb);

            if (frm.ShowDialog() == DialogResult.OK)
            {
                LoadListEmail();
                BUS.LIST_TASKControl ctr = new BUS.LIST_TASKControl();
                if (ctr.IsExist(_dtb, txtCode.Text))
                {
                    DTO.LIST_TASKInfo inf = new DTO.LIST_TASKInfo();
                    inf = GetDataFromForm(inf);
                    SetListEmail(inf.Emails);
                }
            }
        }
コード例 #10
0
        private void btnView_Click(object sender, EventArgs e)
        {
            string sErr = "";

            _processStatus = "V";
            frmTaskView frm = new frmTaskView(_dtb, _user);

            //frm.Connect = Form_QD._dtb;
            if (frm.ShowDialog() == DialogResult.OK)
            {
                if (frm.returnValue != null)
                {
                    BUS.LIST_TASKControl ctr = new BUS.LIST_TASKControl();
                    DTO.LIST_TASKInfo    inf = ctr.Get(_dtb, ((object[])frm.returnValue)[0].ToString(), ref sErr);
                    SetDataToForm(inf);
                }
            }
            if (sErr == "")
            {
                EnableForm(false);
                _processStatus = "V";
            }
        }
コード例 #11
0
        private void btnImport_Click(object sender, EventArgs e)
        {
            string sErr = "";

            BUS.LIST_QDControl        control     = new BUS.LIST_QDControl();
            BUS.LIST_QD_SCHEMAControl controlADD  = new BUS.LIST_QD_SCHEMAControl();
            BUS.LIST_TASKControl      controlTASK = new BUS.LIST_TASKControl();
            BUS.PODControl            controlPOD  = new BUS.PODControl();
            try
            {
                foreach (DataRow row in dt.Rows)
                {
                    if ((bool)row["tmp_Validated"] == true)
                    {
                        if (_type == "QD")
                        {
                            control.TransferIn(row, ref sErr);
                        }
                        else if (_type == "QDADD")
                        {
                            sErr = controlADD.TransferIn(row);
                        }
                        else if (_type == "TASK")
                        {
                            sErr = controlTASK.TransferIn(row);
                        }
                        else if (_type == "POD")
                        {
                            sErr = controlPOD.TransferIn(row);
                        }
                    }
                }
                Close();
            }
            catch { }
        }