public List <Site_Progress> Get_Site_ProgressRpt(string fromdate, string todate, string EmpID) { List <Site_Progress> objList = new List <Site_Progress>(); 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_Site_ProgressRpt", dsItems, new string[] { "tbl" }, mSQLPrm1); foreach (DataRow row1 in dsItems.Tables[0].Rows) { Site_Progress objRecord = new Site_Progress(); objRecord.ID = Convert.ToInt32(row1["ID"]); objRecord.SiteID = Convert.ToInt32(row1["SiteID"]); objRecord.SiteName = row1["SiteName"].ToString(); objRecord.Perm_Labours = Convert.ToInt32(row1["Perm_Labours"]); objRecord.Cont_Labours = Convert.ToInt32(row1["Cont_Labours"]); objRecord.Daily_Labours = Convert.ToInt32(row1["Daily_Labours"]); objRecord.Dated = 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_Site_Progress(Site_Progress 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("@Perm_Labours", SqlDbType.Int, Convert.ToInt32(objEntity.Perm_Labours)), CreateParameter("@Cont_Labours", SqlDbType.Int, Convert.ToInt32(objEntity.Cont_Labours)), CreateParameter("@Daily_Labours", SqlDbType.Int, Convert.ToInt32(objEntity.Daily_Labours)), CreateParameter("@Comments", SqlDbType.VarChar, objEntity.Comments), CreateParameter("@FileName", SqlDbType.VarChar, objEntity.FileName), CreateParameter("@Flag", SqlDbType.Int, Convert.ToInt32(objEntity.Flag)), CreateParameter("@CreatedBy", SqlDbType.Int, Convert.ToInt32(objEntity.CreatedBy)), CreateParameter("@CreatedDate", SqlDbType.VarChar, objEntity.CreatedDate), CreateParameter("@Dated", SqlDbType.VarChar, objEntity.Dated), }; return(CreateCommand("ins_Site_Progress", parameters)); }
public List <Site_Progress> Insert_Update_Site_Progress(Site_Progress objEntity) { return(SqlHelpers.GetObjects <Site_Progress>(Util.Env, CommandFactory.Insert_Update_Site_Progress(objEntity), AdminObjectFactory.Insert_Update_Site_Progress_Factory)); }