Esempio n. 1
0
        private void DBGrid_DoubleClick(object sender, EventArgs e)
        {
            if (DBGrid.CurrentRow == null)
            {
                return;
            }
            string statuslist = "9";

            if (chkNotAudit.Checked)
            {
                statuslist += ",0";
            }
            if (chkAudited.Checked)
            {
                statuslist += ",1";
            }

            BindingCollection <modProductionForm> list = new BindingCollection <modProductionForm>();

            if (DBGrid.CurrentRow.Index == DBGrid.RowCount - 1)
            {
                list = _dal.GetIList(statuslist, string.Empty, string.Empty, string.Empty, txtInvNo.Text.Trim(), txtDeptId.Text.Trim(), dtpFrom.Text, dtpTo.Text, out Util.emsg);
            }
            else
            {
                modProductionSummary moditem = (modProductionSummary)DBGrid.CurrentRow.DataBoundItem;
                list = _dal.GetIList(statuslist, string.Empty, string.Empty, string.Empty, txtInvNo.Text.Trim(), moditem.DeptId, dtpFrom.Text, dtpTo.Text, out Util.emsg);
            }
            if (list != null && list.Count > 0)
            {
                frmViewList frm = new frmViewList();
                frm.InitViewList(clsTranslate.TranslateString("Production Form"), list);
                frm.ShowDialog();
            }
        }
Esempio n. 2
0
 private void LoadData()
 {
     try
     {
         this.Cursor = Cursors.WaitCursor;
         DBGrid.toolCancelFrozen_Click(null, null);
         BindingCollection <modProductionForm> list = _dal.GetIList("1", string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, dtpFrom.Text, dtpTo.Text, out Util.emsg);
         DBGrid.DataSource = list;
         if (list == null && !string.IsNullOrEmpty(Util.emsg))
         {
             MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         }
         else
         {
             AddComboBoxColumns();
             for (int i = 0; i < list.Count; i++)
             {
                 if (list[i].PriceStatus >= 1)
                 {
                     DBGrid.Rows[i].DefaultCellStyle.ForeColor = Color.DarkGray;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }
Esempio n. 3
0
 private void LoadData()
 {
     try
     {
         this.Cursor = Cursors.WaitCursor;
         BindingCollection <modProductionForm> list = _dal.GetIList(rbStatus0.Checked ? "0" : "1", string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, rbStatus0.Checked ? string.Empty : dtpFrom.Text, rbStatus0.Checked ? string.Empty : dtpTo.Text, out Util.emsg);
         DBGrid.DataSource = list;
         if (list == null && !string.IsNullOrEmpty(Util.emsg))
         {
             MessageBox.Show(Util.emsg, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         }
         else
         {
             AddComboBoxColumns();
             DBGrid.Columns["MaterialMny"].Visible = false;
             DBGrid.Columns["WareMny"].Visible     = false;
             DBGrid.Columns["ProcessMny"].Visible  = false;
             DBGrid.Columns["KillMny"].Visible     = false;
             DBGrid.Columns["OtherMny"].Visible    = false;
             DBGrid.Columns["PriceStatus"].Visible = false;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }