/// <summary> /// 新添加主收款 /// </summary> /// <returns></returns> /// <param name="payType">常规收款,</param> public string NewPayment(string payType) { string newID = Guid.NewGuid().ToString(); var mainRow = TW_Payment.NewTW_PaymentRow(); mainRow.操作人 = Security.UserName; mainRow.收款人 = Security.UserName; mainRow.支付日期 = DateTime.Today; mainRow.操作时间 = DateTime.Now; mainRow.收款类别 = payType; //提成初始化设置 mainRow.注册提成月 = 0; mainRow.业务提成月 = 0; mainRow.做账提成月 = 0; mainRow.做账团队提成 = 0; mainRow.业务团队提成 = 0; mainRow.做账主管提成 = 0; mainRow.注册团队提成 = 0; mainRow.注册年提成 = 0; mainRow.业务年提成 = 0; mainRow.工本开票提成 = 0; mainRow.做账业务团队提成 = 0; mainRow.TW_PaymentID = newID; TW_Payment.Rows.Add(mainRow); return(newID); }
/// <summary> /// 保存收款数据 /// </summary> public void SaveDataSet() { DataTable tb1 = TW_Payment.GetChanges(); if (tb1 != null) { tb1.TableName = "TW_Payment"; } if (tb1 != null) { DataSet dst = new DataSet(); dst.Tables.Add(tb1); DBHelper.BasicSer.SaveDataSet(dst); } else { throw new Exception("收款数据出错,请重新收款!"); } }
/// <summary> /// 保存收款数据 /// </summary> public void SaveDataSet() { DataTable tbm = this.TW_PaymentMain.GetChanges(); if (tbm != null) { tbm.TableName = "TW_PaymentMain"; } DataTable tb1 = TW_Payment.GetChanges(); if (tb1 != null) { tb1.TableName = "TW_Payment"; } DataTable tb2 = TW_PaymentDetail.GetChanges(); if (tb2 != null) { tb2.TableName = "TW_PaymentDetail"; } DataSet dst = new DataSet(); if (tbm != null) { dst.Tables.Add(tbm); } if (tb1 != null) { dst.Tables.Add(tb1); } if (tb2 != null) { dst.Tables.Add(tb2); } //dst.Tables[0].GetChanges(DataRowState.) DBHelper.BasicSer.SaveDataSet(dst); }