public List <DailyPurchase> Get_DailyPurchaseRpt(string fromdate, string todate, string EmpID) { List <DailyPurchase> objList = new List <DailyPurchase>(); DataSet dsItems = new DataSet(); SqlParameter[] mSQLPrm1 = new SqlParameter[3]; mSQLPrm1[0] = new SqlParameter("@fromdate", SqlDbType.VarChar, 100); mSQLPrm1[0].Value = fromdate; mSQLPrm1[1] = new SqlParameter("@todate", SqlDbType.VarChar, 100); mSQLPrm1[1].Value = todate; mSQLPrm1[2] = new SqlParameter("@EmpID", SqlDbType.Int, 10); mSQLPrm1[2].Value = Convert.ToInt32(EmpID); SqlHelper.FillDataset(oConnectionString, CommandType.StoredProcedure, "Get_DailyPurchaseRpt", dsItems, new string[] { "tbl" }, mSQLPrm1); foreach (DataRow row1 in dsItems.Tables[0].Rows) { DailyPurchase objRecord = new DailyPurchase(); objRecord.ID = Convert.ToInt32(row1["ID"]); objRecord.SiteName = row1["SiteName"].ToString(); objRecord.ItemType = row1["Item_Type"].ToString(); objRecord.InvoiceNo = Convert.ToString(row1["InvoiceNo"]); objRecord.ItemName = row1["Item_Name"].ToString(); objRecord.Amount = Convert.ToDecimal(row1["Amount"]); objRecord.Date = row1["Dated"].ToString(); objRecord.Comments = row1["Comments"].ToString(); objRecord.FileName = row1["FileName"].ToString(); objRecord.CreatedByName = row1["CreatedByName"].ToString(); objList.Add(objRecord); } return(objList); }
internal static SqlCommand Insert_Update_DailyPurchase(DailyPurchase objEntity) { string ip = System.Web.HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (string.IsNullOrEmpty(ip)) { ip = System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; } var parameters = new[] { CreateParameter("@action", SqlDbType.VarChar, objEntity.action), CreateParameter("@ID", SqlDbType.Int, Convert.ToInt32(objEntity.ID)), CreateParameter("@SiteID", SqlDbType.Int, Convert.ToInt32(objEntity.SiteID)), CreateParameter("@ItemID", SqlDbType.Int, Convert.ToInt32(objEntity.ItemID)), CreateParameter("@InvoiceNo", SqlDbType.VarChar, objEntity.InvoiceNo), CreateParameter("@Amount", SqlDbType.Decimal, objEntity.Amount), CreateParameter("@Date", SqlDbType.VarChar, objEntity.Date), CreateParameter("@Comments", SqlDbType.VarChar, objEntity.Comments), CreateParameter("@Flag", SqlDbType.Int, Convert.ToInt32(objEntity.Flag)), CreateParameter("@CreatedBy", SqlDbType.Int, Convert.ToInt32(objEntity.CreatedBy)), CreateParameter("@CreatedDate", SqlDbType.VarChar, objEntity.CreatedDate), CreateParameter("@FileName", SqlDbType.VarChar, objEntity.FileName), }; return(CreateCommand("ins_DailyPurchase", parameters)); }
public List <DailyPurchase> Insert_Update_DailyPurchase(DailyPurchase objEntity) { return(SqlHelpers.GetObjects <DailyPurchase>(Util.Env, CommandFactory.Insert_Update_DailyPurchase(objEntity), AdminObjectFactory.Insert_Update_DailyPurchase_Factory)); }