Example #1
0
        public List <Daily_Labour_Miss> Get_Daily_Labour_MissRpt(string fromdate, string todate, string EmpID)
        {
            List <Daily_Labour_Miss> objList = new List <Daily_Labour_Miss>();

            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_Daily_Labour_MissRpt", dsItems, new string[] { "tbl" }, mSQLPrm1);
            foreach (DataRow row1 in dsItems.Tables[0].Rows)
            {
                Daily_Labour_Miss objRecord = new Daily_Labour_Miss();
                objRecord.ID          = Convert.ToInt32(row1["ID"]);
                objRecord.ExpenseType = row1["ExpenseType"].ToString();
                objRecord.SiteName    = row1["SiteName"].ToString();
                if (row1["NoofLabours"] != DBNull.Value)
                {
                    objRecord.NoofLabours = Convert.ToInt32(row1["NoofLabours"]);
                }
                objRecord.Reason        = row1["Reason"].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_Daily_Labour_Miss(Daily_Labour_Miss 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("@ExpenseTypeID", SqlDbType.Int, objEntity.ExpenseTypeID),
                CreateParameter("@SiteID", SqlDbType.Int, objEntity.SiteID),
                CreateParameter("@NoofLabours", SqlDbType.Int, objEntity.NoofLabours),
                CreateParameter("@Reason", SqlDbType.VarChar, objEntity.Reason),
                CreateParameter("@Amount", SqlDbType.Decimal, objEntity.Amount),
                CreateParameter("@Date", SqlDbType.VarChar, objEntity.Date),
                CreateParameter("@Comments", SqlDbType.VarChar, objEntity.Comments),
                CreateParameter("@CreatedBy", SqlDbType.Int, Convert.ToInt32(objEntity.CreatedBy)),
                CreateParameter("@FileName", SqlDbType.VarChar, objEntity.FileName),
                CreateParameter("@Flag", SqlDbType.Int, Convert.ToInt32(objEntity.Flag)),
            };

            return(CreateCommand("ins_Daily_Labour_Miss", parameters));
        }
Example #3
0
 public List <Daily_Labour_Miss> Insert_Update_Daily_Labour_Miss(Daily_Labour_Miss objEntity)
 {
     return(SqlHelpers.GetObjects <Daily_Labour_Miss>(Util.Env, CommandFactory.Insert_Update_Daily_Labour_Miss(objEntity), AdminObjectFactory.Insert_Update_Daily_Labour_Miss_Factory));
 }