Exemplo n.º 1
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);
         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;
         btnItemPost.Visible   = false;
         btnClear.Visible      = false;
         lblTotalAmt.Visible   = false;
         txtCode.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())
         {
             txtCode.Text        = view.INV_CODE;
             txtName.Text        = view.INV_NAME;
             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;
         btnItemPost.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())
         {
             txtCode.Text        = view.INV_CODE;
             txtName.Text        = view.INV_NAME;
             txtAmount.Text      = view.INV_INAMT.ToString();
             txtComment.Text     = view.INV_INCOMMENT;
             dpkImportDTTM.Value = view.INV_INDTTM;
         }
     }
 }
Exemplo n.º 2
0
        private void ItemSearch()
        {
            dgvItem.Rows.Clear();
            DataGridViewRowCollection rows = dgvItem.Rows;
            InventoryInfo             view = new InventoryInfo(APConfig.Conn);
            int totalamount = 0;

            view.Conditions  = " 1=1 ";
            view.Conditions += " AND " + view.getCondition(InventoryInfo.ncConditions.status.ToString(), InventoryStatus.寄庫品.ToString());
            if (!string.IsNullOrEmpty(txtName.Text))
            {
                view.Conditions += " AND " + view.getCondition(InventoryInfo.ncConditions.LKname.ToString(), txtName.Text);
            }
            if (!string.IsNullOrEmpty(sernolist))
            {
                view.Conditions += " AND " + view.getCondition(InventoryInfo.ncConditions.NINsernolist.ToString(), sernolist);
            }
            view.OrderBy = view.getOptionOrderBy(InventoryInfo.ncOrderBy.ODBname.ToString());
            view.load();
            while (!view.IsEof)
            {
                rows.Add(new Object[] { view.INV_SERNO, view.INV_NAME, view.INV_POSTAMT, view.INV_POSTDTTM.ToShortDateString() });
                totalamount += view.INV_POSTAMT;
                view.next();
            }
            lblTotalCount.Text = string.Format("總件數:{0}", view.calculateCount());
            lblTotalAmt.Text   = string.Format("總金額:{0}", totalamount);
        }
Exemplo n.º 3
0
        private void ItemSearch()
        {
            dgvItem.Rows.Clear();
            DataGridViewRowCollection rows = dgvItem.Rows;
            InventoryInfo             view = new InventoryInfo(APConfig.Conn);

            view.Conditions  = " 1=1 ";
            view.Conditions += " AND " + view.getCondition(InventoryInfo.ncConditions.status.ToString(), InventoryStatus.庫存中.ToString());
            if (!string.IsNullOrEmpty(txtName.Text))
            {
                view.Conditions += " AND " + view.getCondition(InventoryInfo.ncConditions.LKverdor.ToString(), txtName.Text);
            }
            if (!string.IsNullOrEmpty(txtType.Text))
            {
                view.Conditions += " AND " + view.getCondition(InventoryInfo.ncConditions.LKtype.ToString(), txtType.Text);
            }
            if (!string.IsNullOrEmpty(sernolist))
            {
                view.Conditions += " AND " + view.getCondition(InventoryInfo.ncConditions.NINsernolist.ToString(), sernolist);
            }
            view.OrderBy = string.Format("{0} , {1}", view.getOptionOrderBy(InventoryInfo.ncOrderBy.ODBverdor.ToString()), view.getOptionOrderBy(InventoryInfo.ncOrderBy.ODBmodifydttm.ToString()));
            view.load();
            while (!view.IsEof)
            {
                rows.Add(new Object[] { view.INV_SERNO, view.INV_VENDOR, view.INV_NAME, view.INV_TYPE, view.INV_COLOR, view.INV_INAMT, view.INV_INDTTM.ToShortDateString() });
                view.next();
            }
        }
Exemplo n.º 4
0
 private void loadData(string pserno)
 {
     if (string.IsNullOrEmpty(pserno))
     {
         APConfig.SweetAlert(ShowBoxType.alert, "載入失敗!聯繫Hugo!");
     }
     else
     {
         InventoryInfo view = new InventoryInfo(APConfig.Conn);
         view.Conditions  = " 1=1 ";
         view.Conditions += " AND " + view.getCondition(InventoryInfo.ncConditions.serno.ToString(), pserno);
         if (view.load())
         {
             serno = view.INV_SERNO;
             if (string.IsNullOrEmpty(view.INV_CODE)) //寄庫品
             {
                 txtCode.Text    = view.INV_CODE;
                 txtName.Text    = view.INV_NAME;
                 txtAmount.Text  = view.INV_POSTAMT.ToString();
                 dpkDTTM.Value   = view.INV_POSTDTTM;
                 txtComment.Text = view.INV_POSTCOMMENT;
             }
             else
             {
                 txtCode.Text    = view.INV_CODE;
                 txtName.Text    = view.INV_NAME;
                 txtAmount.Text  = view.INV_INAMT.ToString();
                 dpkDTTM.Value   = view.INV_INDTTM;
                 txtComment.Text = view.INV_INCOMMENT;
             }
         }
     }
 }
Exemplo n.º 5
0
        private void loadData()
        {
            dgvInventory.Rows.Clear();
            string info = "";
            DataGridViewRowCollection rows = dgvInventory.Rows;

            InventoryInfo view = new InventoryInfo(APConfig.Conn);

            view.Conditions  = " 1=1 ";
            view.Conditions += " AND " + view.getCondition(InventoryInfo.ncConditions.sernolist.ToString(), sernolist);
            view.OrderBy     = view.getOptionOrderBy(InventoryInfo.ncOrderBy.ODBcode.ToString());
            view.load();
            while (!view.IsEof)
            {
                if (string.IsNullOrEmpty(view.INV_CODE))
                {
                    info = string.Format("寄庫品( 寄庫金額:{0:n0}元 / 寄庫時間:{1} )", view.INV_POSTAMT, view.INV_POSTDTTM.ToShortDateString());
                    rows.Add(new Object[] { view.INV_SERNO, view.INV_STATUS, true, info });
                }
                else
                {
                    rows.Add(new Object[] { view.INV_SERNO, view.INV_STATUS, true, view.INV_CODE });
                }
                view.next();
            }
        }
Exemplo n.º 6
0
 private void loadData()
 {
     if (tabControl1.SelectedIndex == 0)
     {
         dgvItem.Rows.Clear();
         DataGridViewRowCollection rows = dgvItem.Rows;
         InventoryInfo             view = new InventoryInfo(APConfig.Conn);
         view.Conditions  = " 1=1 ";
         view.Conditions += " AND " + view.getCondition(InventoryInfo.ncConditions.status.ToString(), InventoryStatus.庫存中.ToString());
         if (!string.IsNullOrEmpty(txtCode.Text))
         {
             view.Conditions += " AND " + view.getCondition(InventoryInfo.ncConditions.LKcode.ToString(), txtCode.Text);
         }
         if (!string.IsNullOrEmpty(txtName.Text))
         {
             view.Conditions += " AND " + view.getCondition(InventoryInfo.ncConditions.LKname.ToString(), txtName.Text);
         }
         if (!string.IsNullOrEmpty(sernolist))
         {
             view.Conditions += " AND " + view.getCondition(InventoryInfo.ncConditions.NINsernolist.ToString(), sernolist);
         }
         view.load();
         while (!view.IsEof)
         {
             rows.Add(new Object[] { view.INV_SERNO, view.INV_CODE });
             view.next();
         }
     }
     else if (tabControl1.SelectedIndex == 1)
     {
         dgvPost.Rows.Clear();
         DataGridViewRowCollection rows = dgvPost.Rows;
         InventoryInfo             view = new InventoryInfo(APConfig.Conn);
         view.Conditions  = " 1=1 ";
         view.Conditions += " AND " + view.getCondition(InventoryInfo.ncConditions.status.ToString(), InventoryStatus.寄庫品.ToString());
         if (!string.IsNullOrEmpty(txtCode.Text))
         {
             view.Conditions += " AND " + view.getCondition(InventoryInfo.ncConditions.LKcode.ToString(), txtCode.Text);
         }
         if (!string.IsNullOrEmpty(txtName.Text))
         {
             view.Conditions += " AND " + view.getCondition(InventoryInfo.ncConditions.LKname.ToString(), txtName.Text);
         }
         if (!string.IsNullOrEmpty(sernolist))
         {
             view.Conditions += " AND " + view.getCondition(InventoryInfo.ncConditions.NINsernolist.ToString(), sernolist);
         }
         view.OrderBy = view.getOptionOrderBy(InventoryInfo.ncOrderBy.ODBname.ToString());
         view.load();
         while (!view.IsEof)
         {
             rows.Add(new Object[] { view.INV_SERNO, view.INV_NAME, view.INV_POSTAMT, view.INV_POSTDTTM.ToShortDateString() });
             view.next();
         }
     }
 }
Exemplo n.º 7
0
        private void loadData()
        {
            InventoryInfo view = new InventoryInfo(APConfig.Conn);

            view.Conditions  = " 1=1 ";
            view.Conditions += " AND " + view.getCondition(InventoryInfo.ncConditions.serno.ToString(), serno);
            view.load();
            txtCode.Text          = view.INV_CODE;
            txtName.Text          = view.INV_NAME;
            txtImportAmount.Text  = view.INV_INAMT.ToString();
            dpkImportDTTM.Value   = view.INV_INDTTM;
            txtImportComment.Text = view.INV_INCOMMENT;
        }
Exemplo n.º 8
0
        private void loadData()
        {
            dgvInventory.Rows.Clear();
            string info = "";
            DataGridViewRowCollection rows = dgvInventory.Rows;

            InventoryInfo view = new InventoryInfo(APConfig.Conn);

            view.Conditions  = " 1=1 ";
            view.Conditions += " AND " + view.getCondition(InventoryInfo.ncConditions.sernolist.ToString(), sernolist);
            view.load();
            while (!view.IsEof)
            {
                rows.Add(new Object[] { view.INV_SERNO, true, view.INV_STATUS, view.INV_VENDOR, view.INV_NAME, view.INV_TYPE, view.INV_COLOR, view.INV_SIZE });
                view.next();
            }
        }
Exemplo n.º 9
0
        private void loadData()
        {
            dgvItem.Rows.Clear();
            string info = "";
            DataGridViewRowCollection rows = dgvItem.Rows;

            InventoryInfo view = new InventoryInfo(APConfig.Conn);

            view.Conditions  = " 1=1 ";
            view.Conditions += " AND " + view.getCondition(InventoryInfo.ncConditions.sernolist.ToString(), sernolist);
            view.OrderBy     = view.getOptionOrderBy(InventoryInfo.ncOrderBy.ODBstatus.ToString());
            view.load();
            while (!view.IsEof)
            {
                rows.Add(new Object[] { view.INV_SERNO, view.INV_STATUS, view.INV_VENDOR, view.INV_NAME, view.INV_INAMT, view.INV_INDTTM.ToShortDateString(), view.INV_OUTAMT, view.INV_OUTDTTM.ToShortDateString() });
                view.next();
            }
        }
Exemplo n.º 10
0
 private void loadPostSerno(string serno)
 {
     if (string.IsNullOrEmpty(serno))
     {
         APConfig.SweetAlert(ShowBoxType.alert, "寄存品載入失敗!聯繫Hugo!");
     }
     else
     {
         InventoryInfo view = new InventoryInfo(APConfig.Conn);
         view.Conditions  = " 1=1 ";
         view.Conditions += " AND " + view.getCondition(InventoryInfo.ncConditions.serno.ToString(), serno);
         if (view.load())
         {
             txtName.Text   = view.INV_NAME;
             txtAmount.Text = view.INV_POSTAMT.ToString();
             postSerno      = view.INV_SERNO;
         }
     }
 }
Exemplo n.º 11
0
        private void ItemSearch()
        {
            dgvItem.Rows.Clear();
            DataGridViewRowCollection rows = dgvItem.Rows;
            InventoryInfo             view = new InventoryInfo(APConfig.Conn);

            view.Conditions  = " 1=1 ";
            view.Conditions += " AND " + view.getCondition(InventoryInfo.ncConditions.status.ToString(), InventoryStatus.庫存中.ToString());
            if (!string.IsNullOrEmpty(txtName.Text))
            {
                view.Conditions += " AND " + view.getCondition(InventoryInfo.ncConditions.LKcode.ToString(), txtName.Text);
            }
            if (!string.IsNullOrEmpty(sernolist))
            {
                view.Conditions += " AND " + view.getCondition(InventoryInfo.ncConditions.NINsernolist.ToString(), sernolist);
            }
            view.OrderBy = view.getOptionOrderBy(InventoryInfo.ncOrderBy.ODBcode.ToString());
            view.load();
            while (!view.IsEof)
            {
                rows.Add(new Object[] { view.INV_SERNO, view.INV_CODE });
                view.next();
            }
        }