public Int32 UpdateReportFee(ReportFee reportFee) { String sql = ORMapping.GetUpdateSql(reportFee, BuilderEx.TSqlBuilderInstance); int result = _DataHelper.ExecuteSql(sql); return(result); }
protected void btnAdd_Click(object sender, EventArgs e) { List<ReportFee> select = new List<ReportFee>(); if (!(this.gvFeeList.Rows.Count == 1 && this.gvFeeList.Rows[0].Cells[0].Text == SalaryConst.EmptyText)) { for (Int32 i = 0; i < this.gvFeeList.Rows.Count; i++) { CheckBox ckb = (CheckBox)this.gvFeeList.Rows[i].FindControl("ckbSelect"); if (ckb.Checked) { ReportFee info = new ReportFee(); info.ReportID = reportID; info.FeeID = this.gvFeeList.DataKeys[i].Values[FeeInfoConst.FeeID].ToString(); info.FeeName = this.gvFeeList.DataKeys[i].Values[FeeInfoConst.FeeName].ToString(); //info.OrderNo = Int32.Parse(this.gvFeeList.DataKeys[i].Values[FeeInfoConst.FeeID].ToString()); select.Add(info); } } } if (!(this.gvWelfareList.Rows.Count == 1 && this.gvWelfareList.Rows[0].Cells[0].Text == SalaryConst.EmptyText)) { for (Int32 i = 0; i < this.gvWelfareList.Rows.Count; i++) { CheckBox ckb = (CheckBox)this.gvWelfareList.Rows[i].FindControl("ckbSelect"); if (ckb.Checked) { ReportFee info = new ReportFee(); info.ReportID = reportID; info.FeeID = this.gvWelfareList.DataKeys[i].Values[FeeInfoConst.FeeID].ToString(); info.FeeName = this.gvWelfareList.DataKeys[i].Values[FeeInfoConst.FeeName].ToString(); //info.OrderNo = Int32.Parse(this.gvFeeList.DataKeys[i].Values[FeeInfoConst.FeeID].ToString()); select.Add(info); } } } if (!(this.gvCalculateFeeList.Rows.Count == 1 && this.gvCalculateFeeList.Rows[0].Cells[0].Text == SalaryConst.EmptyText)) { for (Int32 i = 0; i < this.gvCalculateFeeList.Rows.Count; i++) { CheckBox ckb = (CheckBox)this.gvCalculateFeeList.Rows[i].FindControl("ckbSelect"); if (ckb.Checked) { ReportFee info = new ReportFee(); info.ReportID = reportID; info.FeeID = this.gvCalculateFeeList.DataKeys[i].Values[FeeInfoConst.FeeID].ToString(); info.FeeName = this.gvCalculateFeeList.DataKeys[i].Values[FeeInfoConst.FeeName].ToString(); //info.OrderNo = Int32.Parse(this.gvFeeList.DataKeys[i].Values[FeeInfoConst.FeeID].ToString()); select.Add(info); } } } if (select.Any()) { ReportInfoAdapter.Instance.InsertReportFee(select); this.GridViewDataBind(); } }
//public ReportFee LoadReportFee(String reportID, String feeCode) //{ // WhereSqlClauseBuilder builder = new WhereSqlClauseBuilder(); // builder.AppendItem(ReportFeeDBConst.ReportID, reportID); // builder.AppendItem(ReportFeeDBConst.FeeCode, feeCode); // return GetReportFeeList(builder).FirstOrDefault(); //} public List <ReportFee> GetReportFeeList(WhereSqlClauseBuilder builder) { String sql = String.Format(@"SELECT RF.*, F.FEE_TYPE, F.DEFAULT_VALUE FROM {0} RF LEFT OUTER JOIN {1} F ON RF.FEE_ID=F.FEE_ID WHERE {2} ORDER BY ORDER_NO", ReportFeeDBConst.TableName, FeeInfoDBConst.TableName, builder.ToSqlString()); DataTable dt = _DataHelper.GetDataTable(sql); List <ReportFee> result = new List <ReportFee>(); for (Int32 i = 0; i < dt.Rows.Count; i++) { ReportFee info = new ReportFee(); ORMapping.DataRowToObject(dt.Rows[i], info); result.Add(info); } return(result); }
public Int32 UpdateReportFee(ReportFee reportFee) { String sql = ORMapping.GetUpdateSql(reportFee, BuilderEx.TSqlBuilderInstance); int result = _DataHelper.ExecuteSql(sql); return result; }
//public ReportFee LoadReportFee(String reportID, String feeCode) //{ // WhereSqlClauseBuilder builder = new WhereSqlClauseBuilder(); // builder.AppendItem(ReportFeeDBConst.ReportID, reportID); // builder.AppendItem(ReportFeeDBConst.FeeCode, feeCode); // return GetReportFeeList(builder).FirstOrDefault(); //} public List<ReportFee> GetReportFeeList(WhereSqlClauseBuilder builder) { String sql = String.Format(@"SELECT RF.*, F.FEE_TYPE, F.DEFAULT_VALUE FROM {0} RF LEFT OUTER JOIN {1} F ON RF.FEE_ID=F.FEE_ID WHERE {2} ORDER BY ORDER_NO", ReportFeeDBConst.TableName, FeeInfoDBConst.TableName, builder.ToSqlString()); DataTable dt = _DataHelper.GetDataTable(sql); List<ReportFee> result = new List<ReportFee>(); for (Int32 i = 0; i < dt.Rows.Count; i++) { ReportFee info = new ReportFee(); ORMapping.DataRowToObject(dt.Rows[i], info); result.Add(info); } return result; }
protected void btnMinusAll_Click(object sender, EventArgs e) { List<ReportFee> select = new List<ReportFee>(); if (!(this.gvSelectedFeeList.Rows.Count == 1 && this.gvSelectedFeeList.Rows[0].Cells[0].Text == SalaryConst.EmptyText)) { for (Int32 i = 0; i < this.gvSelectedFeeList.Rows.Count; i++) { ReportFee info = new ReportFee(); info.ReportID = reportID; info.FeeID = this.gvSelectedFeeList.DataKeys[i].Values[FeeInfoConst.FeeID].ToString(); info.FeeName = this.gvSelectedFeeList.DataKeys[i].Values[FeeInfoConst.FeeName].ToString(); select.Add(info); } } if (select.Any()) { ReportInfoAdapter.Instance.DeleteReportFee(select); this.GridViewDataBind(); } }