Exemplo n.º 1
0
 public static int SaveINDoc(INDoc info)
 {
     return ConnectDB.ExecuteScalar("sp_INDocSave",
         new String[] {
                         "BranchID",
                         "DocNbr",
                         "DocDate",
                         "DocDescr",
                         "Module",
                         "TranType",
                         "WhID",
                         "ToWhID",
                         "TotQty",
                         "TotAmt",
                         "RsID",
                         "Rlsed",
                         "Note",
             "Crtd_DateTime", "Crtd_Prog", "Crtd_User", "LUpd_DateTime", "LUpd_Prog", "LUpd_User", "Version" },
         new Object[] {
                     info.BranchID,
                     info.DocNbr,
                     info.DocDate,
                     info.DocDescr,
                     info.Module,
                     info.TranType,
                     info.WhID,
                     info.ToWhID,
                     info.TotQty,
                     info.TotAmt,
                     info.RsID,
                     info.Rlsed,
                     info.Note,
             info.Crtd_DateTime, info.Crtd_Prog, info.Crtd_User, info.LUpd_DateTime, info.LUpd_Prog, info.LUpd_User, info.Version });
 }
Exemplo n.º 2
0
        private void _SaveINDoc()
        {
            if (dgvDocDet.RowCount == 0)
                MessageBoxEx.Show("Đơn hàng không có chi tiết, không thể Save", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            else
            {
                INDoc _infoDoc = new INDoc();
                _infoDoc.BranchID = cmbBranchID.SelectedValue.ToString();

                if (txtDocNbr.Text == "")
                    _infoDoc.DocNbr = _strFistChar + (Int16.Parse(_strLastNbr) + 1).ToString("000000");
                else
                    _infoDoc.DocNbr = txtDocNbr.Text;

                _infoDoc.Module = "IN";
                _infoDoc.TranType = _strFistChar;
                _infoDoc.TotQty = float.Parse(txtTotalQty.Number);
                _infoDoc.WhID = cmbWhID.SelectedValue.ToString();
                _infoDoc.ToWhID = "";
                _infoDoc.TotAmt = float.Parse(txtTotalAmt.Number);
                _infoDoc.DocDate = dtmDocDate.Value.Date;
                _infoDoc.DocDescr = txtDocDescr.Text;
                _infoDoc.RsID = cmbReason.SelectedValue.ToString();
                _infoDoc.Rlsed = 0;
                _infoDoc.Note = "";
                _infoDoc.Crtd_DateTime = DateTime.Now;
                _infoDoc.Crtd_Prog = _strPro;
                _infoDoc.Crtd_User = _strUser;
                _infoDoc.LUpd_DateTime = DateTime.Now;
                _infoDoc.LUpd_Prog = _strPro;
                _infoDoc.LUpd_User = _strUser;
                int kq;
                if (_infoDoc.DocNbr != "" && _infoDoc.DocNbr != "")
                    kq = IN201Ctrl.SaveINDoc(_infoDoc);
                if (txtDocNbr.Text == "")
                {
                    string strLastNbr = (Int16.Parse(_strLastNbr) + 1).ToString("000000");
                    txtDocNbr.Text = _strFistChar + strLastNbr;
                    _SaveSASetup("IN", _strFistChar, strLastNbr);
                }
                _SaveINDocDet();
                _BindDocList();
                _BinEditPanel(cmbBranchID.SelectedValue.ToString(), txtDocNbr.Text, "IN");
            }
        }
Exemplo n.º 3
0
        private void btnRelease_Click(object sender, EventArgs e)
        {
            if (dgvDocDet.RowCount == 0)
                MessageBoxEx.Show("Đơn hàng không có chi tiết, không thể Cập nhật", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            else
            {
                INDoc _infoDoc = new INDoc();
                _infoDoc.BranchID = cmbBranchID.SelectedValue.ToString();

                if (txtDocNbr.Text != "")
                    _infoDoc.DocNbr = txtDocNbr.Text;
                _infoDoc.Module = "IN";
                _infoDoc.TranType = _strFistChar;
                _infoDoc.TotQty = float.Parse(txtTotalQty.Number);
                _infoDoc.WhID = cmbWhID.SelectedValue.ToString();
                _infoDoc.ToWhID = "";
                _infoDoc.TotAmt = float.Parse(txtTotalAmt.Number);
                _infoDoc.DocDate = dtmDocDate.Value.Date;
                _infoDoc.DocDescr = txtDocDescr.Text;
                _infoDoc.RsID = cmbReason.SelectedValue.ToString();
                _infoDoc.Rlsed = 1;
                _infoDoc.Note = "";
                _infoDoc.Crtd_DateTime = DateTime.Now;
                _infoDoc.Crtd_Prog = _strPro;
                _infoDoc.Crtd_User = _strUser;
                _infoDoc.LUpd_DateTime = DateTime.Now;
                _infoDoc.LUpd_Prog = _strPro;
                _infoDoc.LUpd_User = _strUser;
                int kq;
                if (_infoDoc.DocNbr != "" && _infoDoc.DocNbr != "")
                    kq = IN201Ctrl.SaveINDoc(_infoDoc);
                _BindDocList();
                _BinEditPanel(cmbBranchID.SelectedValue.ToString(), txtDocNbr.Text, "IN");
            }
        }
Exemplo n.º 4
0
        private void btnDestroy_Click(object sender, EventArgs e)
        {
            INDoc _infoDoc = new INDoc();
            _infoDoc.BranchID = cmbBranchID.SelectedValue.ToString();

            if (txtDocNbr.Text != "")
                _infoDoc.DocNbr = txtDocNbr.Text;
            _infoDoc.Module = "IN";
            _infoDoc.TranType = _strFistChar;
            _infoDoc.TotQty = float.Parse(txtTotalQty.Number);
            _infoDoc.WhID = cmbWhID.SelectedValue.ToString();
            _infoDoc.ToWhID = "";
            _infoDoc.TotAmt = float.Parse(txtTotalAmt.Number);
            _infoDoc.DocDate = dtmDocDate.Value.Date;
            _infoDoc.DocDescr = txtDocDescr.Text;
            _infoDoc.RsID = cmbReason.SelectedValue.ToString();
            _infoDoc.Rlsed = -1;
            _infoDoc.Note = "";
            _infoDoc.Crtd_DateTime = DateTime.Now;
            _infoDoc.Crtd_Prog = _strPro;
            _infoDoc.Crtd_User = _strUser;
            _infoDoc.LUpd_DateTime = DateTime.Now;
            _infoDoc.LUpd_Prog = _strPro;
            _infoDoc.LUpd_User = _strUser;
            int kq;
            if (_infoDoc.DocNbr != "" && _infoDoc.DocNbr != "")
                kq = IN201Ctrl.SaveINDoc(_infoDoc);
            _BindDocList();
            _BinEditPanel(cmbBranchID.SelectedValue.ToString(), txtDocNbr.Text, "IN");
        }
Exemplo n.º 5
0
 private INDoc _GetINDoc()
 {
     INDoc indoc = new INDoc();
     indoc.BranchID = cmbBranchID.SelectedValue.ToString();
     indoc.DocNbr = txtDocNbr.Text;
     indoc.Module = "IN";
     indoc.TranType = _strFistChar;
     indoc.TotQty = float.Parse(txtTotalQty.Number.ToString());
     indoc.WhID = cmbWhID.SelectedValue.ToString();
     indoc.ToWhID = cmbToWhID.SelectedValue.ToString();
     indoc.TotAmt = float.Parse(txtTotalAmt.Number.ToString());
     indoc.DocDate = dtmDocDate.Value.Date;
     indoc.DocDescr = txtDocDescr.Text;
     indoc.RsID = cmbReason.SelectedValue.ToString();
     indoc.Rlsed = 0;
     indoc.Note = "";
     indoc.Crtd_DateTime = DateTime.Now;
     indoc.Crtd_Prog = _strPro;
     indoc.Crtd_User = _strUser;
     indoc.LUpd_DateTime = DateTime.Now;
     indoc.LUpd_Prog = _strPro;
     indoc.LUpd_User = _strUser;
     indoc.Version = label1.Text;
     return indoc;
 }
Exemplo n.º 6
0
        //public static string Execute(string Prompt)
        //{
        //    using (var f = new MyInputDialog())
        //    {
        //        f.lblPrompt.Text = Prompt;
        //        f.ShowModal();
        //        return f.txtInput.Text;
        //    }
        //}
        private void btnDestroy_Click(object sender, EventArgs e)
        {
            INDoc _infoDoc = new INDoc();
            _infoDoc.BranchID = cmbBranchID.SelectedValue.ToString();

            if (txtDocNbr.Text != "")
                _infoDoc.DocNbr = txtDocNbr.Text;
            _infoDoc.Module = "IN";
            _infoDoc.TranType = _strFistChar;
            _infoDoc.TotQty = float.Parse(txtTotalQty.Number.ToString());
            _infoDoc.WhID = cmbWhID.SelectedValue.ToString();
            _infoDoc.ToWhID = cmbToWhID.SelectedValue.ToString();
            _infoDoc.TotAmt = float.Parse(txtTotalAmt.Number.ToString());
            _infoDoc.DocDate = dtmDocDate.Value.Date;
            _infoDoc.DocDescr = txtDocDescr.Text;
            _infoDoc.RsID = cmbReason.SelectedValue.ToString();
            _infoDoc.Rlsed = -1;
            InputBoxForm ib = new InputBoxForm("text", "default", "caption");
            ib.ShowDialog();
            _infoDoc.Note = ib.txtOut.Text ;
            _infoDoc.Crtd_DateTime = DateTime.Now;
            _infoDoc.Crtd_Prog = _strPro;
            _infoDoc.Crtd_User = _strUser;
            _infoDoc.LUpd_DateTime = DateTime.Now;
            _infoDoc.LUpd_Prog = _strPro;
            _infoDoc.LUpd_User = _strUser;
            _infoDoc.Version = label1.Text;
            int kq;
            if (_infoDoc.DocNbr != "" && _infoDoc.DocNbr != "")
                kq = IN202Ctrl.SaveINDoc(_infoDoc);
            _BindDocList();
            _BinEditPanel(cmbBranchID.SelectedValue.ToString(), txtDocNbr.Text, "IN");
        }