Ejemplo n.º 1
0
        private void dgvItem_DoubleClick(object sender, EventArgs e)
        {
            DataGridViewRow row = this.dgvItem.SelectedRows[0];

            ddlDealer.SelectedIndex = APConfig.getSelectIndex(ddlDealer, row.Cells["dgvItem_Dealer"].Value.ToString());
            txtExportAmount.Text    = row.Cells["dgvItem_Amount"].Value.ToString();
            dpkExportDTTM.Value     = Convert.ToDateTime(row.Cells["dgvItem_ImportDTTM"].Value);
            txtExportComment.Text   = row.Cells["dgvItem_Comment"].Value.ToString();
        }
Ejemplo n.º 2
0
        private void dgvItem_DoubleClick(object sender, EventArgs e)
        {
            DataGridViewRow row = this.dgvItem.SelectedRows[0];

            ddlVendor.SelectedIndex = APConfig.getSelectIndex(ddlVendor, row.Cells["dgvItem_Vendor"].Value.ToString());
            txtName.Text            = row.Cells["dgvItem_Name"].Value.ToString();
            txtType.Text            = row.Cells["dgvItem_Type"].Value.ToString();
            txtColor.Text           = row.Cells["dgvItem_Color"].Value.ToString();
            txtSize.Text            = row.Cells["dgvItem_Size"].Value.ToString();
            txtAmount.Text          = row.Cells["dgvItem_Amount"].Value.ToString();
            dpkImportDTTM.Value     = Convert.ToDateTime(row.Cells["dgvItem_ImportDTTM"].Value);
            txtComment.Text         = row.Cells["dgvItem_Comment"].Value.ToString();
        }
Ejemplo n.º 3
0
 private void initView()
 {
     if (mode == mode.Add)
     {
         btnOK.ButtonText      = "新增";
         btnOK.IdleFillColor   = Color.FromArgb(33, 166, 117);
         btnOK.IdleLineColor   = Color.FromArgb(33, 166, 117);
         btnOK.ActiveFillColor = Color.FromArgb(33, 166, 117);
         btnOK.ActiveLineColor = Color.FromArgb(33, 166, 117);
     }
     else if (mode == mode.Edit)
     {
         btnOK.ButtonText      = "修改";
         btnOK.IdleFillColor   = Color.FromArgb(255, 161, 0);
         btnOK.IdleLineColor   = Color.FromArgb(255, 161, 0);
         btnOK.ActiveFillColor = Color.FromArgb(255, 161, 0);
         btnOK.ActiveLineColor = Color.FromArgb(255, 161, 0);
         ddlCategory.Enabled   = false;
         PhraseInfo view = new PhraseInfo(APConfig.Conn);
         view.Conditions  = " 1=1 ";
         view.Conditions += " AND " + view.getCondition(PhraseInfo.ncConditions.serno.ToString(), serno);
         if (view.load())
         {
             txtName.Text  = view.PHS_NAME;
             txtIndex.Text = view.PHS_INDEX.ToString();
             txtType.Text  = view.PHS_TYPE;
             txtColor.Text = view.PHS_COLOR;
             txtSize.Text  = view.PHS_SIZE;
             APConfig.getSelectIndex(ddlCategory, view.PHS_CATEGORY);
         }
     }
     else if (mode == mode.View)
     {
         DisableControls();
         btnOK.ButtonText = "確認";
         PhraseInfo view = new PhraseInfo(APConfig.Conn);
         view.Conditions  = " 1=1 ";
         view.Conditions += " AND " + view.getCondition(PhraseInfo.ncConditions.serno.ToString(), serno);
         if (view.load())
         {
             txtName.Text  = view.PHS_NAME;
             txtIndex.Text = view.PHS_INDEX.ToString();
             txtType.Text  = view.PHS_TYPE;
             txtColor.Text = view.PHS_COLOR;
             txtSize.Text  = view.PHS_SIZE;
             APConfig.getSelectIndex(ddlCategory, view.PHS_CATEGORY);
         }
     }
 }
Ejemplo n.º 4
0
 private void initView()
 {
     if (mode == mode.Add)
     {
         ddlVendor.SelectedIndex = 0;
         btnOK.ButtonText        = "新增";
         btnOK.IdleFillColor     = Color.FromArgb(33, 166, 117);
         btnOK.IdleLineColor     = Color.FromArgb(33, 166, 117);
         btnOK.ActiveFillColor   = Color.FromArgb(33, 166, 117);
         btnOK.ActiveLineColor   = Color.FromArgb(33, 166, 117);
         dpkImportDTTM.Value     = DateTime.Today;
     }
     else if (mode == mode.Edit)
     {
         btnOK.ButtonText      = "修改";
         btnOK.IdleFillColor   = Color.FromArgb(255, 161, 0);
         btnOK.IdleLineColor   = Color.FromArgb(255, 161, 0);
         btnOK.ActiveFillColor = Color.FromArgb(255, 161, 0);
         btnOK.ActiveLineColor = Color.FromArgb(255, 161, 0);
         btnItemAdd.Visible    = false;
         btnItemDel.Visible    = false;
         btnClear.Visible      = false;
         lblTotalAmt.Visible   = false;
         InventoryInfo view = new InventoryInfo(APConfig.Conn);
         view.Conditions  = " 1=1 ";
         view.Conditions += " AND " + view.getCondition(InventoryInfo.ncConditions.serno.ToString(), serno);
         view.load();
         if (view.load())
         {
             ddlVendor.SelectedIndex = APConfig.getSelectIndex(ddlVendor, view.INV_VENDOR);
             txtName.Text            = view.INV_NAME;
             txtType.Text            = view.INV_TYPE;
             txtSize.Text            = view.INV_SIZE;
             txtColor.Text           = view.INV_COLOR;
             txtAmount.Text          = view.INV_INAMT.ToString();
             txtComment.Text         = view.INV_INCOMMENT;
             dpkImportDTTM.Value     = view.INV_INDTTM;
         }
     }
     else if (mode == mode.View)
     {
         DisableControls();
         btnOK.ButtonText    = "確認";
         btnItemAdd.Visible  = false;
         btnItemDel.Visible  = false;
         btnClear.Visible    = false;
         lblTotalAmt.Visible = false;
         ddlVendor.Enabled   = false;
         InventoryInfo view = new InventoryInfo(APConfig.Conn);
         view.Conditions  = " 1=1 ";
         view.Conditions += " AND " + view.getCondition(InventoryInfo.ncConditions.serno.ToString(), serno);
         view.load();
         if (view.load())
         {
             ddlVendor.SelectedIndex = APConfig.getSelectIndex(ddlVendor, view.INV_VENDOR);
             txtName.Text            = view.INV_NAME;
             txtType.Text            = view.INV_TYPE;
             txtSize.Text            = view.INV_SIZE;
             txtColor.Text           = view.INV_COLOR;
             txtAmount.Text          = view.INV_INAMT.ToString();
             txtComment.Text         = view.INV_INCOMMENT;
             dpkImportDTTM.Value     = view.INV_INDTTM;
         }
     }
 }