示例#1
0
 private static CABBatch FetchBatchDetails(CABBatch CABBatch, SafeDataReader dr)
 {
     CABBatch.ID = dr.GetInt32("ID");
     CABBatch.Name = dr.GetString("Name");
     CABBatch.BatchCode = dr.GetString("BatchType");
     CABBatch.BatchID = dr.GetString("BatchID");
     CABBatch.FromDate = dr.GetDateTime("FromDate").ToString("dd/MM/yyyy");
     CABBatch.ToDate = dr.GetDateTime("ToDate").ToString("dd/MM/yyyy");
     CABBatch.FromDateList = CABBatch.FromDate == "" ? "" : dr.GetDateTime("FromDate").ToString("dd MMM yyyy");
     CABBatch.ToDateList = CABBatch.ToDate == "" ? "" : dr.GetDateTime("ToDate").ToString("dd MMM yyyy");
     CABBatch.CreatedDate = dr.GetDateTime("CreatedDate").ToString("dd MMM yyyy hh:mm:ss tt"); ;
     return CABBatch;
 }
示例#2
0
 private static CABBatch FetchBATCHType(CABBatch CABBatch, SafeDataReader dr)
 {
     CABBatch.BatchCode = dr.GetString("BatchCode");
     CABBatch.Name = dr.GetString("Name");
     return CABBatch;
 }
示例#3
0
        public CABBatch FetchGapInfo(CABBatch GapInfo, SafeDataReader dr)
        {
            GapInfo.SNO = dr.GetInt32("new_id");
            GapInfo.FromDate = dr.GetDateTime("start_date").ToString("dd MMM yyyy");
            GapInfo.ToDate = dr.GetDateTime("end_date").ToString("dd MMM yyyy");
            GapInfo.Duration = dr.GetInt32("NoofDays");

            return GapInfo;
        }
示例#4
0
        /// <summary>
        /// Created By    : Shiva
        /// Created Date  : 19 Nov 2014
        /// Modified By   :  
        /// Modified Date :  
        /// Description   : To Get the Batch Type
        /// </summary>        
        public static CABBatchInfo GetMBatchType()
        {
            var data = new CABBatchInfo();

            System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame();
            System.Reflection.MethodBase methodBase = stackFrame.GetMethod();
            log.Debug("Start: " + methodBase.Name);
            try
            {
                var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "SPGetMBatchType");
                var safe = new SafeDataReader(reader);
                while (reader.Read())
                {
                    var CABBatch = new CABBatch();
                    CABBatch.FetchBATCHType(CABBatch, safe);
                    data.CABBatchList.Add(CABBatch);
                }
                return data;
            }
            catch (Exception ex)
            {
                log.Error("Error: " + ex);
                return data;
            }
            finally
            {
                log.Debug("End: " + methodBase.Name);
            }
        }
示例#5
0
        /// <summary>
        /// Description   : To Get Company Data
        /// Created By    : Pavan
        /// Created Date  : 30 September 2014
        /// Modified By   :  
        /// Modified Date :  
        /// <returns></returns>
        /// </summary>
        public static CABBatchInfo GetCabBatchDetails(string BatchType, string OrderBy, int startPage, int resultPerPage)
        {
            var data = new CABBatchInfo();

            System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame();
            System.Reflection.MethodBase methodBase = stackFrame.GetMethod();
            log.Debug("Start: " + methodBase.Name);
            try
            {
                SqlParameter[] sqlParams = new SqlParameter[4];
                sqlParams[0] = new SqlParameter("@startPage", startPage);
                sqlParams[1] = new SqlParameter("@resultPerPage", resultPerPage);
                sqlParams[2] = new SqlParameter("@BatchType", BatchType);
                sqlParams[3] = new SqlParameter("@OrderBy", OrderBy);

                var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "SPGetCabBatchDetails", sqlParams);
                var safe = new SafeDataReader(reader);
                while (reader.Read())
                {
                    var CABBatch = new CABBatch();
                    CABBatch.FetchBatchDetails(CABBatch, safe);
                    data.CABBatchList.Add(CABBatch);
                    data.CABBatchCount = Convert.ToInt32(reader["BatchCount"]);
                }
                return data;
            }
            catch (Exception ex)
            {
                log.Error("Error: " + ex);
                return data;
            }
            finally
            {
                log.Debug("End: " + methodBase.Name);
            }
        }
示例#6
0
        /// <summary>
        /// Description  : Gap analysis by BatchType.
        /// Created By   : Shiva
        /// Created Date : 22 Dec 2014
        /// Modified By  :
        /// Modified Date:
        /// </summary>
        public static CABBatchInfo GetBabBatchGapByBatchType(string BatchType)
        {
            var GetGapInfo = new CABBatchInfo();

            System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame();
            System.Reflection.MethodBase methodBase = stackFrame.GetMethod();
            log.Debug("Start: " + methodBase.Name);
            try
            {
                SqlParameter[] sqlParams = new SqlParameter[1];
                sqlParams[0] = new SqlParameter("@BatchType", BatchType);
                var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "SpGetCabBatchGapAnalysisByBatchType_Club", sqlParams);
                var safe = new SafeDataReader(reader);
                while (reader.Read())
                {
                    var GapInfo = new CABBatch();
                    GapInfo.FetchGapInfo(GapInfo, safe);
                    GetGapInfo.CABBatchList.Add(GapInfo);
                }
                return GetGapInfo;
            }
            catch (Exception ex)
            {
                log.Error("Error: " + ex);
                return GetGapInfo;
            }
            finally
            {
                log.Debug("End: " + methodBase.Name);
            }
        }
        public JsonResult SaveCabBatchDetails(int ID, string BatchType, string BatchID, string FromDate, string ToDate)
        {
            System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame();
            System.Reflection.MethodBase methodBase = stackFrame.GetMethod();
            log.Debug("Start: " + methodBase.Name);
            int checkSession = UserLogin.AuthenticateRequest();

            try
            {
                if (checkSession == 0)
                {
                    return Json(checkSession);
                }
                {
                    var objSaveCAb = new CABBatch()
                    {
                        ID = ID,
                        BatchCode = BatchType,
                        BatchID = BatchID,
                        FromDate = FromDate,
                        ToDate = ToDate,
                        SavedBy = checkSession

                    };
                    var BatchTypeData = objSaveCAb.SaveCabBatchDetails();
                    return Json(BatchTypeData);
                }
            }
            catch (Exception ex)
            {
                log.Error("Error: " + ex);
                return Json(checkSession);
            }
            finally
            {
                log.Debug("End: " + methodBase.Name);
            }
        }