//生成订单佣金 public void BtnBrokerage_ItemClick(object sender, UFSoft.UBF.UI.WebControls.MenuItemClickEventArgs e) { this.part.Model.ClearErrorMessage(); try { List <long> solineList = new List <long>(); foreach (IUIRecord record in part.Model.Views["SO_SOLines"].Records) { if (record.DataRecordState == DataRowState.Added) { this.part.Model.ErrorMessage.Message = "第" + record["DocLineNo"].ToString() + "行:还未保存!"; return; } if (!record["DescFlexField_PrivateDescSeg19"].ToString().Contains("True")) { this.part.Model.ErrorMessage.Message = "请先生成折扣后再产生佣金!"; return; } solineList.Add(Convert.ToInt64(record["ID"])); } if (solineList.Count > 0) { SOUIHelperExtend.DeleteBrokerage(solineList); SOUIHelperExtend.CreateBrokerage(solineList); (this.part.Action as BaseAction).NavigateAction.Refresh(null); } } catch (Exception ex) { this.part.Model.ErrorMessage.Message = ex.Message; return; } }
//一键创建订单折扣及佣金 private void BtnCreateBroAndDis_ItemClick(object sender, UFSoft.UBF.UI.WebControls.MenuItemClickEventArgs e) { //this.part.Model.ClearErrorMessage(); part.DataCollect(); part.IsDataBinding = true; part.IsConsuming = false; long headID = this.part.Model.Views["SO"].FocusedRecord.PrimaryKey; // 判断当前页面的销售订信息不为空 if (!IsSO_Null()) { try { //IsSO_Null();//判断当前页面的销售订信息不为空 int soStatus = Convert.ToInt32(this.part.Model.Views["SO"].FocusedRecord["Status"] + ""); //保存后,审核前 if (soStatus < 2) { //SOUIHelperExtend.CalcDiscount(long.Parse(part.Model.Views["SO"].FocusedRecord["ID"].ToString())); SOUIHelperExtend.CalcDiscount(headID); List <long> solineList = new List <long>(); foreach (IUIRecord record in part.Model.Views["SO_SOLines"].Records) { if (record.DataRecordState == DataRowState.Added) { this.part.Model.ErrorMessage.Message = "第" + record["DocLineNo"].ToString() + "行:还未保存!"; return; } solineList.Add(Convert.ToInt64(record["ID"])); } if (solineList.Count > 0) { SOUIHelperExtend.DeleteBrokerage(solineList); SOUIHelperExtend.CreateBrokerage(solineList); } (this.part.Action as BaseAction).NavigateAction.Refresh(null); } else { //this.part.Model.ErrorMessage.Message = "销售订单已审核,不允许再生成折扣和佣金!"; this.part.Model.ErrorMessage.Message = "销售订单,开立状态才允许再生成折扣!"; return; } } catch (Exception ex) { this.part.Model.ErrorMessage.Message = ex.Message; return; } } }