/// <summary> /// 绑定Grid /// </summary> public override void BindGrid() { ItemBuyFormRule rule = new ItemBuyFormRule(); gridView1.GridControl.DataSource = rule.RShowDts(HTDataConditionStr, ProcessGrid.GetQueryField(gridView1).Replace("SelectFlag", "0 SelectFlag")); gridView1.GridControl.Show(); }
/// <summary> /// 删除 /// </summary> public override void EntityDelete() { ItemBuyFormRule rule = new ItemBuyFormRule(); ItemBuyForm entity = EntityGet(); rule.RDelete(entity); }
/// <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; } ItemBuyFormRule rule = new ItemBuyFormRule(); rule.RSubmit(HTDataID, (int)ConfirmFlag.未提交); FCommon.AddDBLog(this.Text, FormStatus.撤消提交.ToString(), "ID:" + HTDataID, ""); this.SetPosStatus(HTDataID); } catch (Exception E) { this.ShowMessage(E.Message); } }
/// <summary> /// 绑定Grid /// </summary> public override void BindGrid() { ItemBuyFormRule rule = new ItemBuyFormRule(); DataTable dt = rule.RShowDts(HTDataConditionStr, ProcessGrid.GetQueryField(gridView1).Replace("FormStatusName", "'' FormStatusName")); ItemBuyStatusProc.ProcColorStatusName(dt); ProcDataSourceQty(dt); gridView1.GridControl.DataSource = dt; gridView1.GridControl.Show(); string sql = "SELECT distinct ID FROM UV1_Buy_ItemBuyFormDts WHERE 1=1"; sql += HTDataConditionStr; dt = SysUtils.Fill(sql); lbCount.Text = "采购单数:" + dt.Rows.Count.ToString(); }
/// <summary> /// 修改 /// </summary> public override void EntityUpdate() { ItemBuyFormRule rule = new ItemBuyFormRule(); ItemBuyForm entity = EntityGet(); ItemBuyFormDts[] entitydts = EntityDtsGet(); decimal totalqty = 0; decimal totalAmount = 0; for (int i = 0; i < entitydts.Length; i++) { totalqty += SysConvert.ToDecimal(entitydts[i].Qty); totalAmount += SysConvert.ToDecimal(entitydts[i].Amount); } entity.TotalQty = totalqty; entity.TotalAmount = totalAmount; entity.SubmitFlag = this.HTSubmitFlagUpdateGet(); rule.RUpdate(entity, entitydts); }