Example #1
0
        /// <summary>
        /// Description  : To get Fee Items by WOID.
        /// Created By   : Shiva
        /// Created Date : 12 Sep 2014
        /// Modified By  :
        /// Modified Date:
        /// </summary>
        /// <returns>Fee data</returns>
        /// 
        public static FeeInfo GetFeeItemsByWOID(int WOID, int startPage, int resultPerPage)
        {
            var MFeeData = new FeeInfo();

            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("@WOID", WOID);
                sqlParams[1] = new SqlParameter("@startPage", startPage);
                sqlParams[2] = new SqlParameter("@resultPerPage", resultPerPage);
                var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "SPGetFeeItemDetailsByWOID", sqlParams);
                var safe = new SafeDataReader(reader);
                while (reader.Read())
                {
                    var Item = new WOFee();
                    Item.FetchFeeItemsByWOID(Item, safe);
                    MFeeData.FeeList.Add(Item);
                    MFeeData.FeeCount = Convert.ToInt32(reader["FeeCount"]);
                }
                reader.NextResult();
                while (reader.Read())
                {
                    var Instate = new FeeInstate();
                    Instate.FetchFeeInstate(Instate, safe);
                    MFeeData.FEEInstate.Add(Instate);
                }

                reader.NextResult();
                while (reader.Read())
                {
                    var ActionRules = new FeeActionRules();
                    ActionRules.FetchFeeActionRules(ActionRules, safe);
                    MFeeData.FEEActionRules.Add(ActionRules);
                }

                return MFeeData;
            }
            catch (Exception ex)
            {
                log.Error("Error: " + ex);
                return MFeeData;
            }
            finally
            {
                log.Debug("End: " + methodBase.Name);
            }
        }
Example #2
0
 public FeeActionRules FetchFeeActionRules(FeeActionRules Di, SafeDataReader dr)
 {
     Di.FeeID = dr.GetInt32("FeeID");
     Di.ForState = dr.GetString("ForState");
     Di.DO = dr.GetInt32("do");
     Di.UNDO = dr.GetInt32("undo");
     return Di;
 }
Example #3
0
        /// <summary>
        /// Description  : To get All Fee Items.
        /// Created By   : Pavan
        /// Created Date : 23 Apr 2015
        /// Modified By  :
        /// Modified Date:
        /// </summary>
        /// <returns>Fee data</returns>
        /// 
        public static FeeInfo GetAllFeeItems(int startPage, int resultPerPage, string clientID, string SourceID, string WO, string Type, string IsBilled, string IsArchived, string IsAdhoc, string OrderBy, string FromDate, string ToDate, int ACCPACStatus)
        {
            var MFeeData = new FeeInfo();

            System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame();
            System.Reflection.MethodBase methodBase = stackFrame.GetMethod();
            log.Debug("Start: " + methodBase.Name);
            try
            {
                SqlParameter[] sqlParams = new SqlParameter[13];
                sqlParams[0] = new SqlParameter("@startPage", startPage);
                sqlParams[1] = new SqlParameter("@resultPerPage", resultPerPage);
                sqlParams[2] = new SqlParameter("@clientID", clientID);
                sqlParams[3] = new SqlParameter("@SourceID", SourceID);
                sqlParams[4] = new SqlParameter("@WO", WO);
                sqlParams[5] = new SqlParameter("@Type", Type);
                sqlParams[6] = new SqlParameter("@IsBilled", IsBilled);
                sqlParams[7] = new SqlParameter("@IsArchived", IsArchived);
                sqlParams[8] = new SqlParameter("@IsAdhoc", IsAdhoc);
                sqlParams[9] = new SqlParameter("@OrderBy", OrderBy);
                sqlParams[10] = new SqlParameter("@FromDate", HelperClasses.ConvertDateFormat(FromDate));
                sqlParams[11] = new SqlParameter("@ToDate", HelperClasses.ConvertDateFormat(ToDate));
                sqlParams[12] = new SqlParameter("@ACCPACStatus", ACCPACStatus);
                var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "SPGetAllFeeItems", sqlParams);
                var safe = new SafeDataReader(reader);
                while (reader.Read())
                {
                    var Item = new WOFee();
                    Item.FetchFeeItemsByWOID(Item, safe);
                    MFeeData.FeeList.Add(Item);
                    MFeeData.FeeCount = Convert.ToInt32(reader["FeeCount"]);
                }
                reader.NextResult();
                while (reader.Read())
                {
                    var Instate = new FeeInstate();
                    Instate.FetchFeeInstate(Instate, safe);
                    MFeeData.FEEInstate.Add(Instate);
                }

                reader.NextResult();
                while (reader.Read())
                {
                    var ActionRules = new FeeActionRules();
                    ActionRules.FetchFeeActionRules(ActionRules, safe);
                    MFeeData.FEEActionRules.Add(ActionRules);
                }

                return MFeeData;
            }
            catch (Exception ex)
            {
                log.Error("Error: " + ex);
                return MFeeData;
            }
            finally
            {
                log.Debug("End: " + methodBase.Name);
            }
        }