public inputReceiptItem CreateNewItem(int MainID) { inputReceiptItem item = new inputReceiptItem { ChildMainID = this.GetNewItemId(), MainId = MainID }; string str2 = "insert into Prj_IncomeDevotionPlanChild(ChildMainID,MainId) values("; if (publicDbOpClass.NonQuerySqlString(str2 + item.ChildMainID.ToString() + "," + item.MainId.ToString() + ")")) { return(item); } return(null); }
private inputReceiptItem FormatToItemModel(DataRow dr) { inputReceiptItem item = new inputReceiptItem(); string str = ""; if (publicDbOpClass.ExecuteScalar("select V_BMMC from pt_d_bm where i_bmdm=" + dr["DepartmentName"].ToString()) != null) { str = publicDbOpClass.ExecuteScalar("select V_BMMC from pt_d_bm where i_bmdm=" + dr["DepartmentName"].ToString()).ToString(); } item.ChildMainID = int.Parse(dr["ChildMainID"].ToString()); item.DepartCode = dr["DepartmentName"].ToString(); item.DepartmentName = str; item.DevotionMoney = decimal.Parse(dr["DevotionMoney"].ToString()); item.MainId = int.Parse(dr["MainId"].ToString()); item.IncomeMoney = decimal.Parse(dr["IncomeMoney"].ToString()); return(item); }
public static bool UpdateItemInfo(inputReceiptItem objInfo) { return(publicDbOpClass.NonQuerySqlString((("update Prj_IncomeDevotionPlanChild set DepartmentName='" + objInfo.DepartCode) + "',IncomeMoney=" + objInfo.IncomeMoney.ToString() + ",DevotionMoney=") + objInfo.DevotionMoney.ToString() + " where ChildMainID=" + objInfo.ChildMainID.ToString())); }