Beispiel #1
0
        protected override void billNew()
        {
            string strDept    = docDEPTID.SelectedValue;
            string strDeptOut = docDEPTOUT.SelectedValue;

            PubFunc.FormDataClear(FormDoc);
            if (PubFunc.StrIsEmpty(strDept))
            {
                if (docDEPTID.Items.Count > 2)
                {
                    strDept = docDEPTID.Items[1].Value;
                }
            }
            if (PubFunc.StrIsEmpty(strDeptOut))
            {
                if (docDEPTOUT.Items.Count > 2)
                {
                    strDeptOut = docDEPTOUT.Items[1].Value;
                }
            }
            docFLAG.SelectedValue    = "N";
            docSLR.SelectedValue     = UserAction.UserID;
            docLRY.SelectedValue     = UserAction.UserID;
            docLRRQ.SelectedDate     = DateTime.Now;
            docXSRQ.SelectedDate     = DateTime.Now;
            docDEPTID.SelectedValue  = strDept;
            docDEPTOUT.SelectedValue = strDeptOut;

            billLockDoc(false);
            GridGoods.SummaryData = null;
            PageContext.RegisterStartupScript(GridGoods.GetRejectChangesReference());
        }
Beispiel #2
0
        protected override void billNew()
        {
            //原单据保存判断
            string strDept = docDEPTID.SelectedValue;

            PubFunc.FormDataClear(FormDoc);

            docFLAG.SelectedValue   = "N";
            docLRY.SelectedValue    = UserAction.UserID;
            docLRRQ.SelectedDate    = DateTime.Now;
            docXSRQ.SelectedDate    = DateTime.Now;
            docDEPTID.SelectedValue = strDept;
            if (docDEPTID.SelectedValue.Length < 1)
            {
                docDEPTID.SelectedIndex = 1;
            }
            tbxNUM.Text = "0";
            billLockDoc(false);
            tbxBARCODE.Enabled    = true;
            btnAudit.Enabled      = false;
            btnExtraction.Enabled = true;
            btnSave.Enabled       = true;
            btnPrint.Enabled      = false;
            btnDelRow.Enabled     = true;
            btnGoods.Enabled      = true;
            PageContext.RegisterStartupScript(GridGoods.GetRejectChangesReference());
            tbxBARCODE.Focus();
        }
Beispiel #3
0
        protected override void billNew()
        {
            PubFunc.FormDataClear(FormDoc);
            PageContext.RegisterStartupScript(GridGoods.GetRejectChangesReference());
            docFLAG.SelectedValue    = "N";
            docSLR.SelectedValue     = UserAction.UserID;
            docLRY.SelectedValue     = UserAction.UserID;
            docLRRQ.SelectedDate     = DateTime.Now;
            docXSRQ.SelectedDate     = DateTime.Now;
            docDEPTOUT.SelectedValue = "";
            docDEPTID.SelectedValue  = "";

            btnDel.Enabled     = false;
            docDEPTOUT.Enabled = true;
            docSLR.Enabled     = true;
            docDEPTID.Enabled  = true;
            docXSRQ.Enabled    = true;
            docMEMO.Enabled    = true;
            docSLR.Enabled     = true;
            //tbxINSERT.Enabled = true;
            //改变按钮状态
            btnPrint.Enabled  = false;
            btnSave.Enabled   = true;
            btnAudit.Enabled  = false;
            btnDelRow.Enabled = true;
            btnGoods.Enabled  = true;
            //tbxINSERT.Focus();
            JObject summary = new JObject();

            summary.Add("GDNAME", "本页合计");
            summary.Add("BZSL", "0");
            summary.Add("HSJE", "0");
            GridGoods.SummaryData = summary;
        }
Beispiel #4
0
        protected override void billNew()
        {
            PubFunc.FormDataClear(FormDoc);
            // 20150919 modify by zhanghaicheng

            // dpkRQSJ1.SelectedDate = DateTime.Now.AddDays(-30);
            // dpkRQSJ2.SelectedDate = DateTime.Now;
            docLRY.SelectedValue = UserAction.UserID;
            //docSHR.SelectedValue = UserAction.UserID;
            docLRRQ.SelectedDate  = DateTime.Now;
            nbxYSSL.Text          = "1";
            docFLAG.SelectedValue = "M";;
            ddlDEPTID.Enabled     = true;
            nbxYSSL.Enabled       = true;
            docMEMO.Enabled       = true;
            btnGenerate.Enabled   = true;
            btnSave.Enabled       = false;
            btnSumbit.Enabled     = false;
            btnAudit.Enabled      = false;
            btnCancel.Enabled     = false;
            btnPrint.Enabled      = false;
            btnExport.Enabled     = false;
            btnDelRow.Enabled     = false;

            JObject summary = new JObject();

            summary.Add("GDNAME", "本页合计");
            summary.Add("DHS", "0");
            summary.Add("HSJE", "0");
            GridGoods.SummaryData = summary;
            //20150919 modify by zhanghaicheng
            docYSRQ.Text = DateTime.Now.AddMonths(1).ToString("yyyy-MM");
            //Convert.ToDateTime(dpkRQSJ2.Text).Year.ToString() + "-" + Convert.ToDateTime(dpkRQSJ2.Text).AddMonths(1).Month.ToString();
            PageContext.RegisterStartupScript(GridGoods.GetRejectChangesReference());
        }
        protected override void billNew()
        {
            //原单据保存判断
            string strDept  = docDEPTGROUP.SelectedValue;
            string strDept2 = docDEPTID.Text;

            PubFunc.FormDataClear(FormDoc);

            docFLAG.SelectedValue      = "M";
            docLRY.SelectedValue       = UserAction.UserID;
            docLRRQ.SelectedDate       = DateTime.Now;
            docXSRQ.SelectedDate       = DateTime.Now;
            docDEPTGROUP.SelectedValue = strDept;
            docDEPTID.Text             = strDept2;
            tbxNUM.Text = "0";
            billLockDoc(false);
            tbxBARCODE.Enabled   = true;
            btnAudit.Enabled     = false;
            btnSave.Enabled      = true;
            btnPrint.Enabled     = false;
            btnDelRow.Enabled    = true;
            btnGoods.Enabled     = true;
            docDEPTGROUP.Enabled = true;

            //清空Grid行
            PageContext.RegisterStartupScript(GridGoods.GetRejectChangesReference());
        }
Beispiel #6
0
        protected override void billNew()
        {
            PubFunc.FormDataClear(FormDoc);
            PageContext.RegisterStartupScript(GridGoods.GetRejectChangesReference());
            docFLAG.SelectedValue = "N";
            docSLR.SelectedValue  = UserAction.UserID;
            docLRY.SelectedValue  = UserAction.UserID;
            docLRRQ.SelectedDate  = DateTime.Now;
            docXSRQ.SelectedDate  = DateTime.Now;

            btnDel.Enabled     = false;
            docDEPTOUT.Enabled = true;
            docSLR.Enabled     = true;
            docDEPTID.Enabled  = true;
            docXSRQ.Enabled    = true;
            docMEMO.Enabled    = true;
            docSLR.Enabled     = true;
            tbxINSERT.Enabled  = true;
            //改变按钮状态
            btnPrint.Enabled  = false;
            btnSave.Enabled   = true;
            btnAudit.Enabled  = false;
            btnDelRow.Enabled = true;
            tbxINSERT.Focus();
        }
Beispiel #7
0
        protected override void billNew()
        {
            //原单据保存判断
            string strDept = docDEPTID.SelectedValue;

            PubFunc.FormDataClear(FormDoc);

            docFLAG.SelectedValue   = "M";
            docLRY.SelectedValue    = UserAction.UserID;
            docSLR.SelectedValue    = UserAction.UserID;
            docLRRQ.SelectedDate    = DateTime.Now;
            docXSRQ.SelectedDate    = DateTime.Now;
            dpkTime1.SelectedDate   = DateTime.Now.AddDays(-1);
            dpkTime2.SelectedDate   = DateTime.Now;
            docDEPTID.SelectedValue = strDept;
            billLockDoc(false);
            docMEMO.Enabled    = true;
            docDEPTOUT.Enabled = true;
            docSLR.Enabled     = true;
            //清空Grid行
            PageContext.RegisterStartupScript(GridGoods.GetRejectChangesReference());
            btnDel.Enabled    = false;
            btnSave.Enabled   = true;
            btnCommit.Enabled = false;
            btnAudit.Enabled  = false;
            btnCancel.Enabled = false;
            btnPrt.Enabled    = false;
            btnPrint.Enabled  = false;
            btnDelRow.Enabled = true;
            btnGoods.Enabled  = true;
        }
Beispiel #8
0
        protected override void billNew()
        {
            //原单据保存判断
            string strDept = ddlDEPTID.SelectedValue;

            PubFunc.FormDataClear(FormDoc);

            ddlFLAG.SelectedValue   = "M";
            docLRY.SelectedValue    = UserAction.UserID;
            dpkLRRQ.SelectedDate    = DateTime.Now;
            ddlDEPTID.SelectedValue = strDept;
            ddlDEPTID.SelectedIndex = 1;
            billLockDoc(false);
            //btnAudit.Enabled = false;
            //btnSave.Enabled = true;
            //btnPrint.Enabled = false;
            //btnDelRow.Enabled = true;

            btnAddRow.Enabled = true;
            btnDelRow.Enabled = true;
            btnSave.Enabled   = true;

            ddlDEPTID.Enabled = true;
            tbxLRYTEL.Enabled = true;
            tbxMEMO.Enabled   = true;
            tbxBILLNO.Enabled = false;
            //docSUPID.Enabled = true;
            //清空Grid行

            PageContext.RegisterStartupScript(GridGoods.GetRejectChangesReference());
        }
Beispiel #9
0
        protected override void billNew()
        {
            PubFunc.FormDataClear(FormDoc);
            PageContext.RegisterStartupScript(GridGoods.GetRejectChangesReference());
            docFLAG.SelectedValue = "N";
            docSLR.SelectedValue  = UserAction.UserID;
            docLRY.SelectedValue  = UserAction.UserID;
            docLRRQ.SelectedDate  = DateTime.Now;
            docXSRQ.SelectedDate  = DateTime.Now;

            btnDel.Enabled     = false;
            docDEPTOUT.Enabled = true;
            docSLR.Enabled     = true;
            docDEPTID.Enabled  = true;
            docXSRQ.Enabled    = true;
            docMEMO.Enabled    = true;
            docSLR.Enabled     = true;
            trbBARCODE.Enabled = true;
            //改变按钮状态
            btnPrint.Enabled  = false;
            btnSave.Enabled   = true;
            btnAudit.Enabled  = false;
            btnDelRow.Enabled = true;
            trbBARCODE.Focus();
            if (Request.QueryString["tp"] != null && Request.QueryString["tp"].ToString().Trim().Length > 0)
            {
                docDEPTOUT.SelectedValue = DbHelperOra.GetSingle("SELECT T.STR2 FROM DOC_GOODSTYPE T WHERE T.CODE=" + Request.QueryString["tp"].ToString()).ToString();
            }
            else
            {
                docDEPTOUT.SelectedValue = DbHelperOra.GetSingle("SELECT T.STR2 FROM DOC_GOODSTYPE T WHERE T.CODE='2'").ToString();
            }
        }
Beispiel #10
0
 protected override void billNew()
 {
     tbxBILLNO.Text          = String.Empty;
     tbxMEMO.Text            = String.Empty;
     ddlFLAG.SelectedValue   = "N";
     dpkPDRQ.Enabled         = true;
     tbxBILLNO.Enabled       = true;
     tbxMEMO.Enabled         = true;
     GridGoods.SummaryData   = null;
     dpkSHRQ.SelectedDate    = null;
     dpkSPRQ.SelectedDate    = null;
     ddlSHR.SelectedValue    = "";
     ddlSPR.SelectedValue    = "";
     ddlPDTYPE.Enabled       = true;
     ddlPDTYPE.SelectedValue = "1";
     ddlISPH.Enabled         = true;
     ddlISPH.SelectedValue   = "Y";
     ddlCZY.Enabled          = true;
     lstLRRQ1.SelectedDate   = DateTime.Now.AddDays(-1);
     lstLRRQ2.SelectedDate   = DateTime.Now;
     dpkPDRQ.SelectedDate    = DateTime.Now;
     dpkLRRQ.SelectedDate    = DateTime.Now;
     ddlLRY.SelectedValue    = UserAction.UserID;
     ddlCZY.SelectedValue    = UserAction.UserID;
     PageContext.RegisterStartupScript(GridGoods.GetRejectChangesReference());
     btnDel.Enabled    = false;
     btnSave.Enabled   = true;
     btnAudit.Enabled  = false;
     btnDelRow.Enabled = true;
     btnPrint.Enabled  = true;
 }
Beispiel #11
0
        protected override void billOpen(string strBillno)
        {
            //表头进行赋值
            DataTable dtDoc = DbHelperOra.Query(string.Format(strDocSql, strBillno)).Tables[0];

            PubFunc.FormDataSet(FormDoc, dtDoc.Rows[0]);
            //表体赋值
            DataTable dtBill = DbHelperOra.Query(string.Format(strLisSQL, strBillno)).Tables[0];

            PageContext.RegisterStartupScript(GridGoods.GetRejectChangesReference());
            decimal bzslTotal = 0, feeTotal = 0, ddslTotal = 0;

            if (dtBill != null && dtBill.Rows.Count > 0)
            {
                foreach (DataRow row in dtBill.Rows)
                {
                    //PubFunc.GridRowAdd(GridGoods, row, false);
                    ddslTotal += Convert.ToDecimal(row["SYSL"]);
                    bzslTotal += Convert.ToDecimal(row["SYHSJE"]);
                    feeTotal  += Convert.ToDecimal(row["SYBHSJE"]);
                }
                Doc.GridRowAdd(GridGoods, dtBill);
            }
            TabStrip1.ActiveTabIndex = 1;
            PubFunc.Form2Lock(FormDoc, true);
            //增加合计
            JObject summary = new JObject();

            summary.Add("NAME", "本页合计");
            summary.Add("SYSL", ddslTotal.ToString());
            summary.Add("SYHSJE", bzslTotal.ToString("F2"));
            summary.Add("SYBHSJE", feeTotal.ToString("F2"));
            GridGoods.SummaryData = summary;
            //按钮状态判断
            if (ddlFLAG.SelectedValue == "N")
            {
                btnDel.Enabled    = true;
                btnSave.Enabled   = true;
                btnAudit.Enabled  = true;
                btnDelRow.Enabled = true;
                btnPrint.Enabled  = true;
            }
            else if (ddlFLAG.SelectedValue == "Y")
            {
                btnDel.Enabled    = false;
                btnSave.Enabled   = false;
                btnAudit.Enabled  = true;
                btnDelRow.Enabled = false;
                btnPrint.Enabled  = false;
            }
            else
            {
                btnDel.Enabled    = false;
                btnSave.Enabled   = false;
                btnAudit.Enabled  = false;
                btnDelRow.Enabled = false;
                btnPrint.Enabled  = false;
            }
        }
Beispiel #12
0
        protected override void billOpen(string strBillno)
        {
            DataTable dtDoc = DbHelperOra.Query(string.Format(strDocSql, strBillno)).Tables[0];

            PubFunc.FormDataSet(FormDoc, dtDoc.Rows[0]);

            PageContext.RegisterStartupScript(GridGoods.GetRejectChangesReference());
            //decimal bzslTotal = 0, feeTotal = 0;
            DataTable dtBill = DbHelperOra.Query(string.Format(strComSql, strBillno)).Tables[0];

            if (dtBill != null && dtBill.Rows.Count > 0)
            {
                Doc.GridRowAdd(GridGoods, dtBill);
            }
            PubFunc.FormLock(FormDoc, true, "");

            if ((",M,R").IndexOf(docFLAG.SelectedValue) > 0)
            {
                btnPrint.Enabled  = false;
                btnDel.Enabled    = true;
                btnSave.Enabled   = true;
                btnDelRow.Enabled = true;
                btnGoods.Enabled  = true;
            }
            else if (docFLAG.SelectedValue == "N")
            {
                btnPrint.Enabled  = true;
                btnDel.Enabled    = false;
                btnSave.Enabled   = false;
                btnAudit.Enabled  = true;
                btnDelRow.Enabled = false;
                btnCancel.Enabled = true;
                btnGoods.Enabled  = false;
            }
            else if (docFLAG.SelectedValue == "Y")
            {
                btnPrint.Enabled  = true;
                btnDel.Enabled    = false;
                btnSave.Enabled   = false;
                btnAudit.Enabled  = false;
                btnDelRow.Enabled = false;
                btnCancel.Enabled = false;
                btnGoods.Enabled  = false;
            }
            else
            {
                btnPrint.Enabled  = false;
                btnDel.Enabled    = false;
                btnSave.Enabled   = false;
                btnAudit.Enabled  = false;
                btnDelRow.Enabled = false;
                btnCancel.Enabled = false;
                btnGoods.Enabled  = false;
            }

            TabStrip1.ActiveTabIndex = 1;
        }
Beispiel #13
0
        protected override void billOpen(string strBillno)
        {
            DataTable dtDoc = DbHelperOra.Query(string.Format(strDocSql, strBillno)).Tables[0];

            PubFunc.FormDataSet(FormDoc, dtDoc.Rows[0]);

            PageContext.RegisterStartupScript(GridGoods.GetRejectChangesReference());
            DataTable dtBill = DbHelperOra.Query(string.Format(strComSql, strBillno)).Tables[0];
            decimal   bzslTotal = 0, feeTotal = 0;

            if (dtBill != null && dtBill.Rows.Count > 0)
            {
                Doc.GridRowAdd(GridGoods, dtBill);
                foreach (DataRow row in dtBill.Rows)
                {
                    bzslTotal += Convert.ToDecimal(row["BZSL"]);
                    feeTotal  += Convert.ToDecimal(row["HSJJ"]) * Convert.ToDecimal(row["BZSL"]) * Convert.ToDecimal(row["BZHL"]);
                }
            }
            //计算合计数量
            JObject summary = new JObject();

            summary.Add("GDNAME", "本页合计");
            summary.Add("BZSL", bzslTotal.ToString());
            summary.Add("HSJE", feeTotal.ToString("F2"));
            GridGoods.SummaryData    = summary;
            TabStrip1.ActiveTabIndex = 1;
            //根据状态屏蔽按钮
            if (docFLAG.SelectedValue == "N")
            {
                docMEMO.Enabled   = true;
                btnPrint.Enabled  = false;
                btnDel.Enabled    = true;
                btnSave.Enabled   = true;
                btnAudit.Enabled  = true;
                btnDelRow.Enabled = true;
                btnGoods.Enabled  = true;
            }
            else if (docFLAG.SelectedValue == "Y")
            {
                btnPrint.Enabled  = true;
                btnDel.Enabled    = false;
                btnSave.Enabled   = false;
                btnAudit.Enabled  = false;
                btnDelRow.Enabled = false;
                btnGoods.Enabled  = false;
            }
            else
            {
                btnPrint.Enabled  = false;
                btnDel.Enabled    = false;
                btnSave.Enabled   = false;
                btnAudit.Enabled  = false;
                btnDelRow.Enabled = false;
            }
        }
        protected override void billOpen(string strBillno)
        {
            DataTable dtDoc = DbHelperOra.Query(string.Format(strDocSql, strBillno)).Tables[0];

            if (dtDoc != null && dtDoc.Rows.Count > 0)
            {
                PubFunc.FormDataSet(FormDoc, dtDoc.Rows[0]);
            }
            else
            {
                Alert.Show(string.Format("未在系统中查询到单据【{0}】!", strBillno), "消息提示", MessageBoxIcon.Warning);
                return;
            }

            PageContext.RegisterStartupScript(GridGoods.GetRejectChangesReference());
            decimal   bzslTotal = 0, feeTotal = 0;
            DataTable dtBill = DbHelperOra.Query(string.Format(strComSql, strBillno)).Tables[0];

            if (dtBill != null && dtBill.Rows.Count > 0)
            {
                foreach (DataRow row in dtBill.Rows)
                {
                    //LoadGridRow(row, false, "OLD");
                    bzslTotal += Convert.ToDecimal(row["BZSL"]);
                    feeTotal  += Convert.ToDecimal(row["HSJJ"]) * Convert.ToDecimal(row["BZSL"]);
                }
            }
            Doc.GridRowAdd(GridGoods, dtBill);
            //计算合计数量
            JObject summary = new JObject();

            summary.Add("GDNAME", "本页合计");
            summary.Add("BZSL", bzslTotal.ToString());
            summary.Add("HSJE", feeTotal.ToString("F2"));
            GridGoods.SummaryData = summary;
            PubFunc.FormLock(FormDoc, true, "");
            TabStrip1.ActiveTabIndex = 1;
            //判断按钮状态
            if (docFLAG.SelectedValue == "M")
            {
                btnSave.Enabled    = true;
                btnAudit.Enabled   = true;
                btnPrint.Enabled   = false;
                btnDelRow.Enabled  = true;
                btnGoods.Enabled   = true;
                tbxBARCODE.Enabled = true;
            }
            else
            {
                btnSave.Enabled   = false;
                btnAudit.Enabled  = false;
                btnPrint.Enabled  = true;
                btnDelRow.Enabled = false;
                btnGoods.Enabled  = false;
            }
        }
Beispiel #15
0
 private void DataInit()
 {
     //docDEPTOUT.Enabled = true;
     //docCATID.Enabled = true;
     ddlTYPE.Enabled      = true;
     docDEPTID.Enabled    = true;
     docGROUPNAME.Enabled = true;
     PubFunc.FormDataClear(FormCond);
     PageContext.RegisterStartupScript(GridGoods.GetRejectChangesReference());
 }
Beispiel #16
0
        protected override void billOpen(string strBillno)
        {
            string    StrSql = strDocSql + " AND A.SEQNO = '{0}'";
            DataTable dtDoc  = DbHelperOra.Query(string.Format(StrSql, strBillno)).Tables[0];

            PubFunc.FormDataSet(FormDoc, dtDoc.Rows[0]);
            PageContext.RegisterStartupScript(GridGoods.GetRejectChangesReference());
            string    deptout = DbHelperOra.GetSingle("select deptout from DAT_DB_DOC t where seqno = '" + strBillno + "'").ToString();
            DataTable dtBill = DbHelperOra.Query(string.Format(strComSql, strBillno, deptout)).Tables[0];
            decimal   bzslTotal = 0, feeTotal = 0;

            if (dtBill != null && dtBill.Rows.Count > 0)
            {
                foreach (DataRow row in dtBill.Rows)
                {
                    bzslTotal += Convert.ToDecimal(row["BZSL"]);
                    feeTotal  += Convert.ToDecimal(row["BZSL"]) * Convert.ToDecimal(row["HSJJ"]) * Convert.ToDecimal(row["BZHL"]);
                    //LoadGridRow(row, false, "OLD");
                }

                /*
                 *  修 改 人 :袁鹏    修改时间:2015-03-20
                 *  信息说明:这种加载方法比LoadGridRow(row, false, "OLD")更高效
                 *  研发组织:威高讯通信息科技有限公司
                 */
                Doc.GridRowAdd(GridGoods, dtBill);
            }
            //增加合计
            JObject summary = new JObject();

            summary.Add("GDNAME", "本页合计");
            summary.Add("BZSL", bzslTotal.ToString());
            summary.Add("HSJE", feeTotal.ToString("F2"));
            GridGoods.SummaryData = summary;
            PubFunc.FormLock(FormDoc, true, "");
            GridGoods.AllowCellEditing = false;

            if (docFLAG.SelectedValue == "N" || docFLAG.SelectedValue == "R")
            {
                btnSave.Enabled   = true;
                btnDel.Enabled    = true;
                btnAudit.Enabled  = true;
                btnDelRow.Enabled = true;
                btnGoods.Enabled  = true;
            }
            else
            {
                btnDel.Enabled    = false;
                btnAudit.Enabled  = false;
                btnDelRow.Enabled = false;
                btnGoods.Enabled  = false;
                btnSave.Enabled   = false;
            }
            TabStrip1.ActiveTabIndex = 1;
        }
Beispiel #17
0
        protected override void billOpen(string strBillno)
        {
            DataTable dtDoc = DbHelperOra.Query(string.Format(strDocSql, strBillno)).Tables[0];

            if (dtDoc != null && dtDoc.Rows.Count > 0)
            {
                PubFunc.FormDataSet(FormDoc, dtDoc.Rows[0]);
            }
            else
            {
                Alert.Show("单据信息获取失败!!!", "警告提示", MessageBoxIcon.Warning);
                return;
            }

            PageContext.RegisterStartupScript(GridGoods.GetRejectChangesReference());
            DataTable dtBill = DbHelperOra.Query(string.Format(strComSql, strBillno)).Tables[0];
            decimal   bzslTotal = 0, feeTotal = 0, dhslTotal = 0;

            if (dtBill != null && dtBill.Rows.Count > 0)
            {
                foreach (DataRow row in dtBill.Rows)
                {
                    bzslTotal += Convert.ToDecimal(row["BZSL"] ?? "0");
                    feeTotal  += Convert.ToDecimal(row["BZSL"] ?? "0") * Convert.ToDecimal(row["HSJJ"] ?? "0");
                    dhslTotal += Convert.ToDecimal(row["BZSL"] ?? "0") * Convert.ToDecimal(row["BZHL"] ?? "0");
                    //LoadGridRow(row, false, "OLD");
                }

                /*
                 *  修 改 人 :袁鹏    修改时间:2015-03-20
                 *  信息说明:这种加载方法比LoadGridRow(row, false, "OLD")更高效
                 *  研发组织:威高讯通信息科技有限公司
                 */
                PubFunc.GridRowAdd(GridGoods, dtBill);
            }
            //增加合计
            JObject summary = new JObject();

            summary.Add("GDNAME", "本页合计");
            summary.Add("BZSL", bzslTotal.ToString());
            summary.Add("HSJE", feeTotal.ToString("F2"));
            summary.Add("DHSL", dhslTotal.ToString());
            GridGoods.SummaryData = summary;
            PubFunc.FormLock(FormDoc, true, "");
            TabStrip1.ActiveTabIndex = 1;
            if (docFLAG.SelectedValue == "F")
            {
                btnCancel.Enabled = false;
            }
            else
            {
                btnCancel.Enabled = true;
            }
        }
Beispiel #18
0
        protected override void billOpen(string strBillno)
        {
            string strDocSql = "SELECT A.*,F_GETUSERNAME(A.SQR) SQRCN,F_GETUSERNAME(A.LRY) LRYCN,F_GETUSERNAME(A.SHR) SHRCN  FROM DAT_TJ_DOC A WHERE A.SEQNO ='{0}'";
            string strComSql = @"SELECT A.*, F_GETUNITNAME(A.UNIT) UNITNAME,F_GETPRODUCERNAME(B.PRODUCER) PRODUCERNAME,F_GETUNITNAME(B.UNIT) UNITNAME
                                              FROM DAT_TJ_COM A,DOC_GOODS B WHERE SEQNO ='{0}' AND A.GDSEQ = B.GDSEQ ORDER BY ROWNO";

            DataTable dtDoc = DbHelperOra.Query(string.Format(strDocSql, strBillno)).Tables[0];

            if (dtDoc != null && dtDoc.Rows.Count > 0)
            {
                PubFunc.FormDataSet(FormPrice, dtDoc.Rows[0]);
            }
            else
            {
                Alert.Show("单据信息获取失败!!!", "警告提示", MessageBoxIcon.Warning);
                return;
            }
            PubFunc.FormLock(FormPrice, true, "");
            if (docFLAG.SelectedValue == "M" || docFLAG.SelectedValue == "R")
            {
                btnSave.Enabled   = true;
                btnSubmit.Enabled = true;
                btnDelRow.Enabled = true;
                btnGoods.Enabled  = true;
                btnAudit.Enabled  = false;
                doxMEMO.Enabled   = true;
            }
            else if (docFLAG.SelectedValue == "N" || docFLAG.SelectedValue == "G")
            {
                btnSave.Enabled   = false;
                btnSubmit.Enabled = false;
                btnDelRow.Enabled = false;
                btnGoods.Enabled  = false;
                btnAudit.Enabled  = true;
            }
            else
            {
                btnSave.Enabled   = false;
                btnSubmit.Enabled = false;
                btnDelRow.Enabled = false;
                btnGoods.Enabled  = false;
                btnAudit.Enabled  = false;
            }
            PageContext.RegisterStartupScript(GridGoods.GetRejectChangesReference());
            DataTable dtBill = DbHelperOra.Query(string.Format(strComSql, strBillno)).Tables[0];

            if (dtBill != null && dtBill.Rows.Count > 0)
            {
                Doc.GridRowAdd(GridGoods, dtBill);
            }
            TabStrip1.ActiveTabIndex = 1;
        }
Beispiel #19
0
        protected override void billOpen(string strBillno)
        {
            DataTable dtDoc = DbHelperOra.Query(string.Format(strDocSql, strBillno)).Tables[0];

            if (dtDoc == null || dtDoc.Rows.Count < 1)
            {
                return;
            }
            PubFunc.FormDataSet(FormDoc, dtDoc.Rows[0]);

            PageContext.RegisterStartupScript(GridGoods.GetRejectChangesReference());
            decimal   bzslTotal = 0, feeTotal = 0, dhslTotal = 0;
            DataTable dtBill = DbHelperOra.Query(string.Format(strComSql, strBillno)).Tables[0];

            if (dtBill != null && dtBill.Rows.Count > 0)
            {
                foreach (DataRow row in dtBill.Rows)
                {
                    //LoadGridRow(row, false, "OLD");
                    bzslTotal += Convert.ToDecimal(row["BZSL"] ?? "0");
                    feeTotal  += Convert.ToDecimal(row["HSJJ"] ?? "0") * Convert.ToDecimal(row["BZSL"] ?? "0");
                    dhslTotal += Convert.ToDecimal(row["DHSL"] ?? "0");
                }
                Doc.GridRowAdd(GridGoods, dtBill);
            }
            //计算合计数量
            JObject summary = new JObject();

            summary.Add("GDNAME", "本页合计");
            summary.Add("BZSL", bzslTotal.ToString());
            summary.Add("HSJE", feeTotal.ToString("F2"));
            summary.Add("DHSL", dhslTotal.ToString());
            GridGoods.SummaryData = summary;
            PubFunc.FormLock(FormDoc, true, "");
            TabStrip1.ActiveTabIndex = 1;
            //按钮状态
            if (docFLAG.SelectedValue == "S")
            {
                btnSave.Enabled  = true;
                btnBill.Enabled  = true;
                btnPrint.Enabled = false;
                btnGoods.Enabled = true;
            }
            else
            {
                btnSave.Enabled  = false;
                btnBill.Enabled  = true;
                btnPrint.Enabled = true;
                btnGoods.Enabled = false;
            }
        }
Beispiel #20
0
        protected override void billNew()
        {
            string strDeptout = docDEPTOUT.SelectedValue;
            string strDeptid  = docDEPTID.SelectedValue;

            PubFunc.FormDataClear(FormDoc);

            docFLAG.SelectedValue = "M";
            docSLR.SelectedValue  = UserAction.UserID;
            docLRY.SelectedValue  = UserAction.UserID;
            docLRRQ.SelectedDate  = DateTime.Now;
            docXSRQ.SelectedDate  = DateTime.Now;
            docSHRQ.SelectedDate  = DateTime.Now;

            docDEPTOUT.SelectedValue = strDeptout;
            docDEPTID.SelectedValue  = strDeptid;
            docDEPTOUT.Enabled       = true;
            docSLR.Enabled           = true;
            docDEPTID.Enabled        = true;
            docXSRQ.Enabled          = true;
            docMEMO.Enabled          = true;
            //改变按钮状态
            BtnPrintJh.Enabled = false;
            btnPrint.Enabled   = false;
            btnPrintBQ.Enabled = false;
            btnDel.Enabled     = false;
            btnSave.Enabled    = true;
            btnAudit.Enabled   = false;
            btnDelRow.Enabled  = true;
            btnGoods.Enabled   = true;
            btnAudit2.Enabled  = false;
            btnRtn.Enabled     = false;
            PageContext.RegisterStartupScript(GridGoods.GetRejectChangesReference());

            if (Request.QueryString["tp"] != null && Request.QueryString["tp"].ToString().Trim().Length > 0)
            {
                docDEPTOUT.SelectedValue = DbHelperOra.GetSingle("SELECT T.STR2 FROM DOC_GOODSTYPE T WHERE T.CODE=" + Request.QueryString["tp"].ToString()).ToString();
            }
            else
            {
                docDEPTOUT.SelectedValue = DbHelperOra.GetSingle("SELECT T.STR2 FROM DOC_GOODSTYPE T WHERE T.CODE='2'").ToString();
            }
            //处理 本页合计
            JObject summary = new JObject();

            summary.Add("GDNAME", "本页合计");
            summary.Add("CH", "0");
            summary.Add("CHJE", "0");

            GridGoods.SummaryData = summary;
        }
 protected override void billNew()
 {
     ddlFLAG.SelectedValue = "N";
     ddlLRY.SelectedValue  = UserAction.UserID;
     dpkLRRQ.SelectedDate  = DateTime.Now;
     ddlDEPTID.Enabled     = true;
     ddlKCTYPE.Enabled     = true;
     tbxBILLNO.Enabled     = true;
     tbxBILLNO.Text        = string.Empty;
     tbxMEMO.Enabled       = true;
     tbxMEMO.Text          = string.Empty;
     GridGoods.SummaryData = null;
     PageContext.RegisterStartupScript(GridGoods.GetRejectChangesReference());
 }
Beispiel #22
0
        protected override void billOpen(string strBillno)
        {
            string    StrSql = strDocSql + " AND A.SEQNO = '{0}'";
            DataTable dtDoc  = DbHelperOra.Query(string.Format(StrSql, strBillno)).Tables[0];

            PubFunc.FormDataSet(FormDoc, dtDoc.Rows[0]);
            PageContext.RegisterStartupScript(GridGoods.GetRejectChangesReference());
            DataTable dtBill = DbHelperOra.Query(string.Format(strComSql, strBillno)).Tables[0];

            if (dtBill != null && dtBill.Rows.Count > 0)
            {
                Doc.GridRowAdd(GridGoods, dtBill);
            }
            PubFunc.FormLock(FormDoc, true, "");
            TabStrip1.ActiveTabIndex = 1;
            if (docFLAG.SelectedValue == "M")
            {
                //初始化按钮
                btnDel.Enabled    = true;
                btnSave.Enabled   = true;
                btnAudit.Enabled  = false;
                btnDelRow.Enabled = true;
                btnGoods.Enabled  = true;
                docMEMO.Enabled   = true;
                tbxREASON.Enabled = true;
                btnPrint.Enabled  = false;
                ButSubmit.Enabled = true;
            }
            else if (docFLAG.SelectedValue == "N")
            {
                btnDel.Enabled    = false;
                btnSave.Enabled   = false;
                btnAudit.Enabled  = true;
                btnDelRow.Enabled = false;
                btnGoods.Enabled  = false;
                btnPrint.Enabled  = false;
                ButSubmit.Enabled = false;
            }
            else if (docFLAG.SelectedValue == "Y")
            {
                //初始化按钮
                btnDel.Enabled    = false;
                btnSave.Enabled   = false;
                btnAudit.Enabled  = false;
                btnDelRow.Enabled = false;
                btnGoods.Enabled  = false;
                btnPrint.Enabled  = true;
                ButSubmit.Enabled = false;
            }
        }
Beispiel #23
0
        protected override void billNew()
        {
            //原单据保存判断
            string strDeptID  = docDEPTID.SelectedValue;
            string strDeptOUT = docDEPTOUT.SelectedValue;

            PubFunc.FormDataClear(FormDoc);

            docFLAG.SelectedValue    = "N";
            docLRY.SelectedValue     = UserAction.UserID;
            docSLR.SelectedValue     = UserAction.UserID;
            docLRRQ.SelectedDate     = DateTime.Now;
            docXSRQ.SelectedDate     = DateTime.Now;
            docDEPTID.SelectedValue  = strDeptID;
            docDEPTOUT.SelectedValue = strDeptOUT;
            billLockDoc(false);
            docMEMO.Enabled    = true;
            docDEPTOUT.Enabled = true;
            docSLR.Enabled     = true;
            //清空Grid行
            PageContext.RegisterStartupScript(GridGoods.GetRejectChangesReference());
            btnDel.Enabled     = false;
            btnSave.Enabled    = true;
            btnAudit.Enabled   = false;
            btnCancel.Enabled  = false;
            btnPrt.Enabled     = false;
            btnPrint.Enabled   = false;
            btnDelRow.Enabled  = true;
            btnGoods.Enabled   = true;
            trbBARCODE.Enabled = true;

            if (Request.QueryString["tp"] != null && Request.QueryString["tp"].ToString().Trim().Length > 0)
            {
                docDEPTOUT.SelectedValue = DbHelperOra.GetSingle("SELECT T.STR2 FROM DOC_GOODSTYPE T WHERE T.CODE=" + Request.QueryString["tp"].ToString()).ToString();
            }
            else
            {
                docDEPTOUT.SelectedValue = DbHelperOra.GetSingle("SELECT T.STR2 FROM DOC_GOODSTYPE T WHERE T.CODE='2'").ToString();
            }

            //计算合计数量
            JObject summary = new JObject();

            summary.Add("GDNAME", "本页合计");
            summary.Add("BZSL", "0");
            summary.Add("HSJE", "0");
            summary.Add("DHSL", "0");
            GridGoods.SummaryData = summary;
        }
Beispiel #24
0
        protected void btnNew_Click(object sender, EventArgs e)
        {
            PubFunc.FormDataClear(FormDoc);
            //// 20150919 modify by zhanghaicheng
            ////20150921 6448版本缺少  add by zhanghaicheng
            //docLRY.SelectedValue = UserAction.UserID;
            ////docSHR.SelectedValue = UserAction.UserID;

            //docLRRQ.SelectedDate = DateTime.Now;
            //docSHRQ.SelectedDate = null;
            //nbxYSSL.Text = "1";
            //docFLAG.SelectedValue = "M";

            //// docYSRQ.Text = DateTime.Now.ToString("yyyy") + "-" + ddlMonth.SelectedValue + "-" + "01";

            ////  docYSRQ.Text = Convert.ToDateTime(docYSRQ.Text).AddMonths(1).ToString("YYYY-MM");

            //docYSRQ.Text = DateTime.Now.AddMonths(1).ToString("yyyy-MM");

            initData();

            //20150919 modify by zhanghaicheng
            // dpkRQSJ1.Enabled = true;
            // dpkRQSJ2.Enabled = true;
            docMEMO.Enabled     = true;
            btnGenerate.Enabled = true;
            btnSave.Enabled     = false;
            btnSumbit.Enabled   = false;
            btnAudit.Enabled    = false;
            btnCancel.Enabled   = false;
            btnPrint.Enabled    = false;
            btnExport.Enabled   = false;
            btnDelRow.Enabled   = false;


            JObject summary = new JObject();

            summary.Add("GDNAME", "本页合计");
            summary.Add("DHS", "0");
            summary.Add("HSJE", "0");
            GridGoods.SummaryData = summary;
            //20150919 modify by zhanghaicheng
            //docYSRQ.Text = DateTime.Now.ToString("yyyy") + "-" + ddlMonth.SelectedValue.ToString();
            //Convert.ToDateTime(dpkRQSJ2.Text).Year.ToString() + "-" + Convert.ToDateTime(dpkRQSJ2.Text).AddMonths(1).Month.ToString();
            PageContext.RegisterStartupScript(GridGoods.GetRejectChangesReference());
        }
Beispiel #25
0
        private void DetailSearch(string strBillno, string strBillType)
        {
            PageContext.RegisterStartupScript(GridGoods.GetRejectChangesReference());
            DataTable dtBill = new DataTable();

            if (strBillType == "RKD")
            {
                dtBill = DbHelperOra.Query(string.Format(strComSql, strBillno)).Tables[0];
            }
            else
            {
                string th_sql = @"SELECT A.SEQNO,A.ROWNO,A.DEPTID,A.GDSEQ,A.BARCODE,A.GDNAME,A.UNIT,A.GDSPEC,A.GDMODE,A.CDID,'' SPLB,A.CATID,A.HWID,A.BZHL,A.BZSL,
                                                    A.THSL DDSL,A.SSSL,A.JXTAX,A.HSJJ,A.BHSJJ,A.HSJE,A.BHSJE,A.LSJ,A.LSJE,B.ISGZ,A.ISLOT,A.PHID,A.PH, A.PZWH,TO_CHAR(A.RQ_SC,'YYYY-MM-DD') RQ_SC,
                                                    TO_CHAR(A.YXQZ,'YYYY-MM-DD') YXQZ,A.KCSL,A.KCHSJE,A.SPZTSL,A.ERPAYXS,A.HLKC,A.ZPBH,A.STR1,A.STR2,A.STR3,A.NUM1,A.NUM2,
                                                    A.NUM3,A.MEMO, F_GETUNITNAME(A.UNIT) UNITNAME,F_GETUNITNAME(B.UNIT) UNITSMALLNAME,'' MJRQ,'' MJPH,'' MJXQ,
                                                    A.PRODUCER,f_getproducername(A.PRODUCER) PRODUCERNAME,A.SUPID,f_getsupname(a.supid) supname
                                           FROM DAT_TH_COM A, DOC_GOODS B WHERE SEQNO = '{0}' AND A.GDSEQ = B.GDSEQ ORDER BY A.ROWNO ";
                dtBill = DbHelperOra.Query(string.Format(th_sql, strBillno)).Tables[0];
            }
            if (dtBill != null && dtBill.Rows.Count > 0)
            {
                decimal ddslTotal = 0, bzslTotal = 0, feeTotal = 0;
                foreach (DataRow row in dtBill.Rows)
                {
                    ddslTotal += Convert.ToDecimal(string.IsNullOrWhiteSpace(row["DDSL"].ToString()) ? "0" : row["DDSL"].ToString());
                    if (!PubFunc.StrIsEmpty(Convert.ToString(row["BZSL"] ?? "0")))
                    {
                        bzslTotal += Convert.ToDecimal(row["BZSL"] ?? "0");
                        // 还要乘以最小单位
                        //feeTotal += Convert.ToDecimal(Convert.ToString(row["HSJJ"])) * Convert.ToDecimal(Convert.ToString(row["BZSL"] ?? "0")) * Convert.ToDecimal(Convert.ToString(row["SSSL"] ?? "0"));
                        feeTotal += Convert.ToDecimal(row["HSJJ"]) * Convert.ToDecimal(row["BZSL"] ?? "0");
                    }
                    row["HSJE"] = Convert.ToDecimal(row["HSJE"]).ToString("F2");
                }

                Doc.GridRowAdd(GridGoods, dtBill);

                //计算合计数量
                JObject summary = new JObject();
                summary.Add("GDNAME", "本页合计");
                summary.Add("DDSL", ddslTotal.ToString());
                summary.Add("BZSL", bzslTotal.ToString());
                summary.Add("HSJE", feeTotal.ToString("F2"));
                GridGoods.SummaryData = summary;
            }
        }
Beispiel #26
0
        protected override void billNew()
        {
            PubFunc.FormDataClear(FormDoc);

            docFLAG.SelectedValue = "N";
            docSLR.SelectedValue  = UserAction.UserID;
            docLRY.SelectedValue  = UserAction.UserID;
            docLRRQ.SelectedDate  = DateTime.Now;
            docXSRQ.SelectedDate  = DateTime.Now;

            docDEPTOUT.Enabled = true;
            docSLR.Enabled     = true;
            docDEPTID.Enabled  = true;
            docXSRQ.Enabled    = true;
            docMEMO.Enabled    = true;

            PageContext.RegisterStartupScript(GridGoods.GetRejectChangesReference());
        }
Beispiel #27
0
        protected override void billOpen(string strBillno)
        {
            string    StrSql = strDocSql + " AND A.SEQNO = '{0}'";
            DataTable dtDoc  = DbHelperOra.Query(string.Format(StrSql, strBillno)).Tables[0];

            PubFunc.FormDataSet(FormDoc, dtDoc.Rows[0]);

            PageContext.RegisterStartupScript(GridGoods.GetRejectChangesReference());
            DataTable dtBill = DbHelperOra.Query(string.Format(strComSql, strBillno)).Tables[0];
            decimal   bzslTotal = 0, xsslTotal = 0, feeTotal = 0;

            if (dtBill != null && dtBill.Rows.Count > 0)
            {
                foreach (DataRow row in dtBill.Rows)
                {
                    bzslTotal += Convert.ToDecimal(row["BZSL"]);
                    xsslTotal += Convert.ToDecimal((row["XSSL"] ?? "0"));
                    feeTotal  += Convert.ToDecimal((row["XSSL"] ?? "0")) * Convert.ToDecimal(row["HSJJ"]);
                    LoadGridRow(row, false, "OLD");
                }
            }
            //增加合计
            JObject summary = new JObject();

            summary.Add("GDNAME", "本页合计");
            summary.Add("BZSL", bzslTotal.ToString());
            summary.Add("XSSL", xsslTotal.ToString());
            summary.Add("HSJE", feeTotal.ToString("F2"));
            GridGoods.SummaryData = summary;
            PubFunc.FormLock(FormDoc, true, "");
            GridGoods.AllowCellEditing = false;

            if (docFLAG.SelectedValue.Equals("W"))
            {
                btnAudit.Enabled = true;
            }
            else
            {
                btnAudit.Enabled = false;
            }

            TabStrip1.ActiveTabIndex = 1;
        }
Beispiel #28
0
        protected override void billNew()
        {
            //原单据保存判断
            string strDeptID = docDEPTID.SelectedValue;

            PubFunc.FormDataClear(FormDoc);

            docFLAG.SelectedValue   = "M";
            docLRY.SelectedValue    = UserAction.UserID;
            docCGY.SelectedValue    = UserAction.UserID;
            docLRRQ.SelectedDate    = DateTime.Now;
            docTHRQ.SelectedDate    = DateTime.Now;
            docDEPTID.SelectedValue = strDeptID;

            billLockDoc(false);
            docMEMO.Enabled = true;

            docCGY.Enabled = true;
            //清空Grid行
            PageContext.RegisterStartupScript(GridGoods.GetRejectChangesReference());
            btnDel.Enabled     = false;
            btnSave.Enabled    = true;
            docPSSID.Enabled   = true;
            docTHTYPE.Enabled  = true;
            btnCommit.Enabled  = false;
            btnAudit.Enabled   = false;
            btnCancel.Enabled  = false;
            btnPrt.Enabled     = false;
            btnPrint.Enabled   = false;
            btnDelRow.Enabled  = true;
            btnGoods.Enabled   = true;
            trbBARCODE.Enabled = true;

            //计算合计数量
            JObject summary = new JObject();

            summary.Add("GDNAME", "本页合计");
            summary.Add("BZSL", "0");
            summary.Add("HSJE", "0");
            summary.Add("DHSL", "0");
            GridGoods.SummaryData = summary;
        }
Beispiel #29
0
        protected override void billNew()
        {
            string strDept    = docDEPTID.SelectedValue;
            string strDeptOut = docDEPTOUT.SelectedValue;

            if (PubFunc.StrIsEmpty(strDept))
            {
                if (docDEPTID.Items.Count > 2)
                {
                    strDept = docDEPTID.Items[1].Value;
                }
            }
            if (PubFunc.StrIsEmpty(strDeptOut))
            {
                if (docDEPTOUT.Items.Count > 2)
                {
                    strDeptOut = docDEPTOUT.Items[1].Value;
                }
            }

            PubFunc.FormDataClear(FormDoc);

            docFLAG.SelectedValue   = "N";
            docSLR.SelectedValue    = UserAction.UserID;
            docLRY.SelectedValue    = UserAction.UserID;
            docLRRQ.SelectedDate    = DateTime.Now;
            docXSRQ.SelectedDate    = DateTime.Now;
            docDEPTID.SelectedValue = strDept;

            billLockDoc(false);

            btnSave.Enabled   = true;
            btnDelRow.Enabled = true;
            btnGoods.Enabled  = true;
            btnDel.Enabled    = false;
            btnAudit.Enabled  = false;

            GridGoods.SummaryData = null;
            docSEQNO.Enabled      = true;
            docBILLNO.Text        = string.Empty;
            PageContext.RegisterStartupScript(GridGoods.GetRejectChangesReference());
        }
Beispiel #30
0
        protected void btnDel_Click(object sender, EventArgs e)
        {
            if (GridStrategy.SelectedRowIndexArray.Length < 1)
            {
                Alert.Show("请选择要删除的模板信息!", "消息提示", MessageBoxIcon.Warning);
                return;
            }
            string ids = "";

            foreach (int index in GridStrategy.SelectedRowIndexArray)
            {
                ids = ids + GridStrategy.Rows[index].DataKeys[2].ToString() + ",";
            }
            DbHelperOra.ExecuteSql("DELETE FROM DOC_GROUPDOC WHERE GROUPID IN ('" + ids.Trim(',').Replace(",", "','") + "')");
            DbHelperOra.ExecuteSql("DELETE FROM DOC_GROUPCOM WHERE GROUPID IN ('" + ids.Trim(',').Replace(",", "','") + "')");
            PubFunc.FormDataClear(FormCond);
            PageContext.RegisterStartupScript(GridGoods.GetRejectChangesReference());
            DataQuery();
            Alert.ShowInTop("模板删除成功!", "消息提示", MessageBoxIcon.Warning);
        }