/// <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); } }
/// <summary> /// 删除 /// </summary> public override void EntityDelete() { CheckOperationRule rule = new CheckOperationRule(); CheckOperation entity = EntityGet(); rule.RDelete(entity); }
/// <summary> /// 新增 /// </summary> public override int EntityAdd() { CheckOperationRule rule = new CheckOperationRule(); CheckOperation entity = EntityGet(); CheckOperationDts[] entitydts = EntityDtsGet(); //CheckOperationInvDts[] entityInvDts = EntityInvDtsGet(); //CheckOperationPayDts[] entityPayDts = EntityPayDtsGet(); decimal TotalCheckAmount = 0; decimal TotalQty = 0; for (int i = 0; i < entitydts.Length; i++) { TotalCheckAmount += SysConvert.ToDecimal(entitydts[i].DCheckAmount); TotalQty += SysConvert.ToDecimal(entitydts[i].DCheckQty); } entity.TotalCheckAmount = TotalCheckAmount; entity.TotalQty = TotalQty; entity.SubmitFlag = this.HTSubmitFlagInsertGet(); //ProcThisQty(entity, entitydts, entityInvDts, entityPayDts);//处理本期余数 //列表中的对账数据不可重复加载 sc 20140123 rule.RAdd(entity, entitydts); return(entity.ID); }
/// <summary> /// 绑定Grid /// </summary> public override void BindGrid() { CheckOperationRule rule = new CheckOperationRule(); gridView1.GridControl.DataSource = rule.RShow(HTDataConditionStr, ProcessGrid.GetQueryField(gridView1)); gridView1.GridControl.Show(); }
/// <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); } }
/// <summary> /// 修改 /// </summary> public override void EntityUpdate() { CheckOperationRule rule = new CheckOperationRule(); CheckOperation entity = EntityGet(); CheckOperationDts[] entitydts = EntityDtsGet(); decimal TotalCheckAmount = 0; decimal TotalCheckQty = 0; for (int i = 0; i < entitydts.Length; i++) { TotalCheckAmount += SysConvert.ToDecimal(entitydts[i].DCheckAmount); TotalCheckQty += SysConvert.ToDecimal(entitydts[i].DCheckQty); } entity.TotalCheckAmount = TotalCheckAmount; entity.TotalQty = TotalCheckQty; entity.SubmitFlag = this.HTSubmitFlagUpdateGet(); rule.RUpdate(entity, entitydts); }
/// <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); } }