예제 #1
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;
                }

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

                FCommon.AddDBLog(this.Text, FormStatus.提交.ToString(), "ID:" + HTDataID, "");
                this.SetPosStatus(HTDataID);
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
예제 #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;
                }
                //for(int i = 0;i<gridView1.RowCount;i++)
                //{
                //    string sql = "Select InvoiceQty from WH_IOFormDts where MainID=" + SysString.ToDBString(gridView1.GetRowCellValue (i,"DLOADID").ToString());
                //    sql += " AND Seq=" + SysString.ToDBString(gridView1.GetRowCellValue(i, "DLOADSEQ").ToString());
                //    DataTable dt = SysUtils.Fill(sql);
                //    if (dt.Rows.Count != 0)
                //    {
                //        if (SysConvert .ToDecimal (dt.Rows[0]["InvoiceQty"]) != 0m)
                //        {
                //            this.ShowMessage("已开票,不可撤销提交");
                //            return;
                //        }
                //    }
                //}

                DataTable dt = (DataTable)gridView1.GridControl.DataSource;
                int       i  = 1;
                foreach (DataRow dr in dt.Rows)
                {
                    if (SysConvert.ToInt32(dr["InvoiceFlag"]) == 1)
                    {
                        this.ShowMessage("第:" + i + "行数据已开票,不可撤销提交");
                        return;
                    }
                    i++;
                }


                CheckOperationRule rule = new CheckOperationRule();
                rule.RSubmit(HTDataID, 0);

                FCommon.AddDBLog(this.Text, FormStatus.撤消提交.ToString(), "ID:" + HTDataID, "");
                this.SetPosStatus(HTDataID);
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }
예제 #3
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;
                }

                DataTable dt = (DataTable)gridView1.GridControl.DataSource;
                int       i  = 1;
                foreach (DataRow dr in dt.Rows)
                {
                    if (SysConvert.ToInt32(dr["InvoiceFlag"]) == 1)
                    {
                        this.ShowMessage("第:" + i + "行数据已开票,不可撤销提交");
                        return;
                    }
                    i++;
                }


                CheckOperationRule rule = new CheckOperationRule();
                rule.RSubmit(HTDataID, 0);

                FCommon.AddDBLog(this.Text, FormStatus.撤消提交.ToString(), "ID:" + HTDataID, "");
                this.SetPosStatus(HTDataID);
            }
            catch (Exception E)
            {
                this.ShowMessage(E.Message);
            }
        }