Exemplo n.º 1
0
        /// <summary>
        /// 删除
        /// </summary>
        public override void EntityDelete()
        {
            RecPayRule rule   = new RecPayRule();
            RecPay     entity = EntityGet();

            rule.RDelete(entity);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 撤销提交
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void btnSubmitCancel_Click(object sender, EventArgs e)
        {
            try
            {
                if (!FCommon.RightCheck(this.FormID, this.RightFormID, this.FormListAID, this.FormListBID, RightSub.新增))
                {
                    this.ShowMessage("你没有此操作权限");
                    return;
                }
                if (HTDataID == 0)
                {
                    this.ShowMessage("请选择要操作的记录");
                    return;
                }
                RecPay entity = new RecPay();
                entity.ID = HTDataID;
                entity.SelectByID();
                if (entity.ReadFlag == 1)
                {
                    this.ShowMessage("该单据已阅,不能撤销");
                    return;
                }
                RecPayRule rule = new RecPayRule();
                rule.RSubmit(HTDataID, 0);

                FCommon.AddDBLog(this.Text, FormStatus.撤消提交.ToString(), "ID:" + HTDataID, "");
                this.SetPosStatus(HTDataID);
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 提交
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                if (!FCommon.RightCheck(this.FormID, this.RightFormID, this.FormListAID, this.FormListBID, RightSub.新增))
                {
                    this.ShowMessage("你没有此操作权限");
                    return;
                }

                if (HTDataID == 0)
                {
                    this.ShowMessage("请选择要操作的记录");
                    return;
                }

                RecPayRule rule = new RecPayRule();
                rule.RSubmit(HTDataID, 1);

                //RAddNews();


                FCommon.AddDBLog(this.Text, FormStatus.提交.ToString(), "ID:" + HTDataID, "");
                this.SetPosStatus(HTDataID);
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 绑定Grid
        /// </summary>
        public override void BindGrid()
        {
            RecPayRule rule = new RecPayRule();
            DataTable  dt   = rule.RShow(HTDataConditionStr, ProcessGrid.GetQueryField(gridView1).Replace("VFormNo", "'' VFormNo"));

            foreach (DataRow dr in dt.Rows)
            {
                dr["VFormNo"] = GetVFormNo(dr["HTNo"].ToString());
            }
            gridView1.GridControl.DataSource = dt;
            gridView1.GridControl.Show();
        }
Exemplo n.º 5
0
        /// <summary>
        /// 修改
        /// </summary>
        public override void EntityUpdate()
        {
            RecPayRule rule   = new RecPayRule();
            RecPay     entity = EntityGet();

            //RecPayHXDts[] entitydts = EntityDtsGet();
            //decimal TotalCheckAmount = 0;
            //for (int i = 0; i < entitydts.Length; i++)
            //{
            //    TotalCheckAmount+=SysConvert.ToDecimal(entitydts[i].DCheckAmount);
            //}
            //entity.TotalCheckAmount=TotalCheckAmount;
            entity.SubmitFlag = this.HTSubmitFlagUpdateGet();
            rule.RUpdate(entity);//entitydts
        }
Exemplo n.º 6
0
        /// <summary>
        /// 新增
        /// </summary>
        public override int EntityAdd()
        {
            RecPayRule rule   = new RecPayRule();
            RecPay     entity = EntityGet();

            // RecPayHXDts[] entitydts = EntityDtsGet();
            //decimal TotalCheckAmount = 0;
            //for (int i = 0; i < entitydts.Length; i++)
            //{
            //    TotalCheckAmount+=SysConvert.ToDecimal(entitydts[i].DCheckAmount);
            //}
            //entity.TotalCheckAmount=TotalCheckAmount;
            entity.SubmitFlag = this.HTSubmitFlagInsertGet();
            rule.RAdd(entity);//entitydts
            return(entity.ID);
        }
Exemplo n.º 7
0
        /// <summary>
        /// 合同关联
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnHTExcute_Click(object sender, EventArgs e)
        {
            try
            {
                if (!FCommon.RightCheck(this.FormID, this.RightFormID, this.FormListAID, this.FormListBID, RightSub.新增))
                {
                    this.ShowMessage("你没有此操作权限");
                    return;
                }
                if (HTDataID == 0)
                {
                    this.ShowMessage("请定位主记录");
                    return;
                }
                if (HTDataSubmitFlag != (int)YesOrNo.Yes)
                {
                    this.ShowMessage("单据未提交,不能操作");
                    return;
                }

                if (txtHTDtsHTNo.Text == "")
                {
                    this.ShowMessage("请检索关联合同号");
                    return;
                }
                if (SysConvert.ToDecimal(txtHTDtsAmount.Text.Trim()) == 0)
                {
                    this.ShowMessage("请输入关联金额");
                    txtHTDtsAmount.Focus();
                    return;
                }

                RecPayRule rule   = new RecPayRule();
                RecPay     entity = EntityGet();

                rule.RHT(entity, txtHTDtsHTNo.Text.Trim(), txtHTItemCode.Text.Trim(), txtHTGoodsCode.Text.Trim(), SysConvert.ToDecimal(txtHTDtsAmount.Text.Trim()), this.FormListAID);

                FCommon.AddDBLog(this.Text, "合同关联", "ID:" + HTDataID, "");
                this.SetPosStatus(HTDataID);

                SetCapFlag(1);
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// 核销
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnHXExcute_Click(object sender, EventArgs e)
        {
            try
            {
                if (!FCommon.RightCheck(this.FormID, this.RightFormID, this.FormListAID, this.FormListBID, RightSub.新增))
                {
                    this.ShowMessage("你没有此操作权限");
                    return;
                }
                if (HTDataID == 0)
                {
                    this.ShowMessage("请定位主记录");
                    return;
                }
                if (HTDataSubmitFlag != (int)YesOrNo.Yes)
                {
                    this.ShowMessage("单据未提交,不能操作");
                    return;
                }

                if (saveInvoiceID == 0)
                {
                    this.ShowMessage("请选择发票记录");
                    return;
                }
                if (SysConvert.ToDecimal(txtHXDtsAmount.Text.Trim()) == 0)
                {
                    this.ShowMessage("请输入核销金额");
                    txtHXDtsAmount.Focus();
                    return;
                }

                RecPayRule rule   = new RecPayRule();
                RecPay     entity = EntityGet();

                rule.RHX(entity, saveInvoiceID, SysConvert.ToDecimal(txtHXDtsAmount.Text.Trim()));

                FCommon.AddDBLog(this.Text, "核销", "ID:" + HTDataID, "");
                this.SetPosStatus(HTDataID);
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
Exemplo n.º 9
0
        /// <summary>
        /// 合同取消关联
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnHTExcuteCancel_Click(object sender, EventArgs e)
        {
            try
            {
                if (!FCommon.RightCheck(this.FormID, this.RightFormID, this.FormListAID, this.FormListBID, RightSub.新增))
                {
                    this.ShowMessage("你没有此操作权限");
                    return;
                }
                if (HTDataID == 0)
                {
                    this.ShowMessage("请定位主记录");
                    return;
                }


                if (saveHTDtsID == 0)
                {
                    this.ShowMessage("请选择合同关联记录");
                    return;
                }
                if (DialogResult.Yes != ShowConfirmMessage("确认撤销关联本条记录?"))
                {
                    return;
                }

                RecPayRule rule   = new RecPayRule();
                RecPay     entity = EntityGet();

                rule.RHTCancel(entity, saveHTDtsID);

                FCommon.AddDBLog(this.Text, "取消合同关联", "ID:" + HTDataID, "");
                this.SetPosStatus(HTDataID);

                SetCapFlag(0);
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
Exemplo n.º 10
0
        /// <summary>
        /// 撤销核销
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnHXCancelExcute_Click(object sender, EventArgs e)
        {
            try
            {
                if (!FCommon.RightCheck(this.FormID, this.RightFormID, this.FormListAID, this.FormListBID, RightSub.新增))
                {
                    this.ShowMessage("你没有此操作权限");
                    return;
                }
                if (HTDataID == 0)
                {
                    this.ShowMessage("请定位主记录");
                    return;
                }
                int dtsID = SysConvert.ToInt32(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "ID"));
                if (dtsID == 0)
                {
                    this.ShowMessage("请选择核销记录");
                    return;
                }

                if (DialogResult.Yes != ShowConfirmMessage("确认撤销核销本条记录?"))
                {
                    return;
                }

                RecPayRule rule   = new RecPayRule();
                RecPay     entity = EntityGet();

                rule.RHXCancel(entity, dtsID);


                FCommon.AddDBLog(this.Text, "撤销核销", "ID:" + HTDataID, "");
                this.SetPosStatus(HTDataID);
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
Exemplo n.º 11
0
        public override void btnLoad_Click(object sender, EventArgs e)
        {
            if (!FCommon.RightCheck(this.FormID, this.RightFormID, this.FormListAID, this.FormListBID, RightSub.权限0))
            {
                this.ShowMessage("没有此权限,请联系管理员");
                return;
            }
            ButtonItem btn    = (ButtonItem)sender;
            RecPayRule rule   = new RecPayRule();
            RecPay     entity = new RecPay();

            entity.ID = HTDataID;
            entity.SelectByID();
            if (btn.Text == "撤销已阅")
            {
                if (entity.ReadFlag == 0)
                {
                    this.ShowMessage("该出库单还未阅,无需撤销");
                    return;
                }
                entity.ReadFlag = 0;
                rule.RUpdate(entity);
            }
            if (btn.Text == "已阅")
            {
                if (entity.ReadFlag == 1)
                {
                    this.ShowMessage("该出库单已阅,无需再阅");
                    return;
                }
                entity.ReadFlag = 1;
                rule.RUpdate(entity);
            }
            btnQuery_Click(null, null);
            ProcessGrid.GridViewFocus(gridView1, new string[] { "ID" }, new string[] { entity.ID.ToString() });
        }