示例#1
0
        /// <summary>
        /// Description  : Get DisburesementItems as per search Results. 
        /// Created By   : pavan
        /// Created Date : 19 May 2014
        /// Modified By  : Shiva
        /// Modified Date: 11 Aug 2014
        /// </summary>
        /// <returns></returns>
        public static WorkOrdersAndDItemsInfo GetAllSearchDisbursementItems(string clientID, string SourceID, string WO, string venderRefId, string Type, string IsVerified, string IsBilled, string IsArchived, string IsAdhoc, string OrderBy, int startpage, int rowsperpage, string FromDate, string ToDate,int ACCPACStatus)
        {
            var data = new WorkOrdersAndDItemsInfo();

            System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame();
            System.Reflection.MethodBase methodBase = stackFrame.GetMethod();
            log.Debug("Start: " + methodBase.Name);
            try
            {
                SqlParameter[] sqlParams = new SqlParameter[15];
                //sqlParams[0] = new SqlParameter("@ItemNumber", clientName);
                sqlParams[0] = new SqlParameter("@WO", WO);
                sqlParams[1] = new SqlParameter("@VenderRefId", venderRefId);
                sqlParams[2] = new SqlParameter("@Type", Type);
                sqlParams[3] = new SqlParameter("@IsVerified", IsVerified);
                sqlParams[4] = new SqlParameter("@IsBilled", IsBilled);
                sqlParams[5] = new SqlParameter("@IsArchived", IsArchived);
                sqlParams[6] = new SqlParameter("@IsAdhoc", IsAdhoc);
                sqlParams[7] = new SqlParameter("@OrderBy", OrderBy);
                sqlParams[8] = new SqlParameter("@startPage", startpage);
                sqlParams[9] = new SqlParameter("@resultPerPage", rowsperpage);
                sqlParams[10] = new SqlParameter("@ClientID", clientID);
                sqlParams[11] = new SqlParameter("@SourceID", SourceID);
                sqlParams[12] = new SqlParameter("@FromDate", HelperClasses.ConvertDateFormat(FromDate));
                sqlParams[13] = new SqlParameter("@ToDate", HelperClasses.ConvertDateFormat(ToDate));
                sqlParams[14] = new SqlParameter("@ACCPACStatus", ACCPACStatus);
                var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "SpGetAllDisbursementItems", sqlParams);
                var safe = new SafeDataReader(reader);
                while (reader.Read())
                {
                    var SearchDisbursementItem = new DisbursementItem();
                    SearchDisbursementItem.FetchDisbursementItemsForSearch(SearchDisbursementItem, safe);
                    data.OrdersList.Add(SearchDisbursementItem);
                    data.OrdersCount = Convert.ToInt32(reader["DICount"]);
                }
                reader.NextResult();
                while (reader.Read())
                {
                    var Instate = new DIInstate();
                    Instate.FetchDIInstate(Instate, safe);
                    data.DiInstate.Add(Instate);
                }

                reader.NextResult();
                while (reader.Read())
                {
                    var ActionRules = new DIActionRules();
                    ActionRules.FetchDIActionRules(ActionRules, safe);
                    data.DiActionRules.Add(ActionRules);
                }
                return data;
            }
            catch (Exception ex)
            {
                log.Error("Error: " + ex);
                return data;
            }
            finally
            {
                log.Debug("End: " + methodBase.Name);
            }
        }
示例#2
0
        /// <summary>
        /// Created By    : Shiva
        /// Created Date  : 19 May 2014
        /// Modified By   :  
        /// Modified Date :  
        /// <returns> Get the current WorkOrderID Disbursement Items data </returns>
        /// </summary>
        public static WorkOrdersAndDItemsInfo GetDisbursementItemsData(int WOID, int startpage, int rowsperpage)
        {
            var disbursementItemsData = new WorkOrdersAndDItemsInfo();

            System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame();
            System.Reflection.MethodBase methodBase = stackFrame.GetMethod();
            log.Debug("Start: " + methodBase.Name);
            try
            {
                SqlParameter[] sqlParams = new SqlParameter[3];
                sqlParams[0] = new SqlParameter("@WorkOrderID", WOID);
                sqlParams[1] = new SqlParameter("@startpage", startpage);
                sqlParams[2] = new SqlParameter("@rowsPerPage", rowsperpage);
                var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "[GetDisbursementItemsByWOID]", sqlParams);
                var safe = new SafeDataReader(reader);
                while (reader.Read())
                {
                    var Item = new DisbursementItem();
                    Item.FetchDisbursementItemsForSearch(Item, safe);
                    disbursementItemsData.OrdersList.Add(Item);
                    disbursementItemsData.OrdersCount = Convert.ToInt32(reader["DICount"]);
                }
                reader.NextResult();
                while (reader.Read())
                {
                    var Instate = new DIInstate();
                    Instate.FetchDIInstate(Instate, safe);
                    disbursementItemsData.DiInstate.Add(Instate);
                }

                reader.NextResult();
                while (reader.Read())
                {
                    var Rules = new DIActionRules();
                    Rules.FetchDIActionRules(Rules, safe);
                    disbursementItemsData.DiActionRules.Add(Rules);
                }
                return disbursementItemsData;
            }
            catch (Exception ex)
            {
                log.Error("Error: " + ex);
                return disbursementItemsData;
            }
            finally
            {
                log.Debug("End: " + methodBase.Name);
            }
        }
示例#3
0
 public DIInstate FetchDIInstate(DIInstate Di, SafeDataReader dr)
 {
     Di.DIID = dr.GetInt32("DIID");
     Di.InState = dr.GetString("InState");
     return Di;
 }