Example #1
0
        private WOFee FetchFeeType(WOFee FeeType, SafeDataReader dr)
        {
            FeeType.ID = dr.GetInt32("ID");
            FeeType.ItemNumber = dr.GetString("ItemNumber");
            FeeType.Code = dr.GetString("Code");
            FeeType.FeeItemToolTip = dr.GetString("Name");

            return FeeType;
        }
Example #2
0
 public JsonResult InsertOrUpdateFeeItem(WOFee FeeDetails)
 {
     System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame();
     System.Reflection.MethodBase methodBase = stackFrame.GetMethod();
     log.Debug("Start: " + methodBase.Name);
     try
     {
         int checkSession = UserLogin.AuthenticateRequest();
         if (checkSession == 0)
         {
             return Json(checkSession);
         }
         else
         {
             //var objFee = new WOFee()
             //{
             //    ID = FeeDetails.ID,
             //    WOID = FeeDetails.WOID,
             //    FeeType = FeeDetails.FeeType,
             //    Units = FeeDetails.Units,
             //    Amount = FeeDetails.Amount,
             //    Description = FeeDetails.Description,
             //    IsAdhoc = FeeDetails.IsAdhoc,
             //    IsArchived = FeeDetails.IsArchived,
             //    UnitPrice = FeeDetails.UnitPrice,
             //    FeeInhouseComment = FeeDetails.FeeInhouseComment,
             //    SavedBy = checkSession
             //};
             //checkSession = objFee.InsertOrUpdateFeeItem();
             checkSession = FeeDetails.InsertOrUpdateFeeItem();
             return Json(checkSession);
         }
     }
     catch (Exception ex)
     {
         log.Error("Error: " + ex);
         return Json("");
     }
     finally
     {
         log.Debug("End: " + methodBase.Name);
     }
 }
Example #3
0
 private WOFee FetchFeeItemByFeeID(WOFee Item, SafeDataReader dr)
 {
     Item.ID = dr.GetInt32("ID");
     Item.WOID = dr.GetInt32("WOID");
     Item.WOCode = dr.GetString("WOCode");
     Item.ClientName = dr.GetString("ClientName");
     Item.Code = dr.GetString("Code");
     Item.ItemNumber = dr.GetString("ItemNumber");
     Item.FeeType = dr.GetInt32("FeeType");
     Item.Units = dr.GetInt32("Units");
     Item.UnitPrice = dr.GetDecimal("UnitPrice");
     Item.Amount = dr.GetDecimal("Amount");
     Item.IsAdhoc = dr.GetBoolean("IsAdhoc");
     Item.IsArchived = dr.GetBoolean("IsArchived");
     Item.IsBilled = dr.GetBoolean("IsBilled");
     Item.Description = dr.GetString("Description");
     Item.NoteCount = dr.GetInt32("NoteCount");
     Item.NoteType = dr.GetString("NoteType");
     Item.RefID = Item.ID;
     Item.ACCPACStatus = dr.GetInt32("ACCPACStatus");
     Item.ACCPACDescription = dr.GetString("ACCPACDescription");
     Item.ACCPACExplanation = dr.GetString("Explaination");
     Item.InvoiceNumber = dr.GetString("InvoiceNumber");
     return Item;
 }
Example #4
0
 private WOFee FetchFeeItemsByWOID(WOFee Item, SafeDataReader dr)
 {
     Item.ID = dr.GetInt32("ID");
     Item.WOCode = dr.GetString("WOCode");
     Item.ClientName = dr.GetString("ClientName");
     Item.ItemNumber = dr.GetString("ItemNumber");
     Item.Code = dr.GetString("Code");
     Item.Units = dr.GetInt32("Units");
     Item.Amount = dr.GetDecimal("Amount");
     Item.IsAdhoc = dr.GetBoolean("IsAdhoc");
     Item.IsArchived = dr.GetBoolean("IsArchived");
     Item.IsBilled = dr.GetBoolean("IsBilled");
     Item.Description = dr.GetString("Description");
     string toolTip = dr.GetString("Description");
     if (toolTip.Contains("~^"))
     {
         toolTip = toolTip.Replace("~^", Environment.NewLine);
     }
     Item.FeeDescriptionToolTip = toolTip;
     int descLength = Item.Description.Length;
     if (descLength > 10)
     {
         string strNewDesc = Item.Description.Substring(0, 10);
         strNewDesc = strNewDesc + "...";
         Item.Description = strNewDesc;
     }
     Item.UnitPrice = dr.GetDecimal("UnitPrice");
     Item.NoteCount = dr.GetInt32("NoteCount");
     Item.NoteType = dr.GetString("NoteType");
     Item.RefID = Item.ID;
     Item.CreatedDate = dr.GetDateTime("CreatedDate").ToString("dd MMM yyyy hh:mm:ss tt");
     Item.FeeItemToolTip = dr.GetString("FeeToolTip");
     Item.ACCPACStatus = dr.GetInt32("ACCPACStatus");
     Item.ACCPACDescription = dr.GetString("ACCPACDescription");
     Item.ACCPACExplanation = dr.GetString("Explaination");
     return Item;
 }
Example #5
0
 private WOFee FetchFeeDetailsByItemNumber(WOFee Fee, SafeDataReader dr)
 {
     Fee.Code = dr.GetString("Code");
     if (dr["UnitPrice"] != null)
     {
         Fee.UnitPrice = dr.GetDecimal("UnitPrice");
     }
     else
     {
         Fee.UnitPrice = null;
     }
     Fee.Description = dr.GetString("Description");
     Fee.Units = dr.GetInt32("Units");
     return Fee;
 }
Example #6
0
        /// <summary>
        /// Description  : Get Fee Item by ID.
        /// Created By   : Shiva
        /// Created Date : 15 Sep 2014
        /// Modified By  :
        /// Modified Date:
        /// </summary>
        /// <returns>Fee Data</returns>
        /// 
        internal static object GetFeeItemByFeeID(int FeeID)
        {
            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[1];
                sqlParams[0] = new SqlParameter("@FeeID", FeeID);
                var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "SPGetWOFeeDetailsByFeeID", sqlParams);
                var safe = new SafeDataReader(reader);
                while (reader.Read())
                {
                    var Item = new WOFee();
                    Item.FetchFeeItemByFeeID(Item, safe);
                    MFeeData.FeeList.Add(Item);
                }
                return MFeeData;
            }
            catch (Exception ex)
            {
                log.Error("Error: " + ex);
                return MFeeData;
            }
            finally
            {
                log.Debug("End: " + methodBase.Name);
            }
        }
Example #7
0
        /// <summary>
        /// Description  : Get FeeType from database(MFeeType table). 
        /// Created By   : Shiva
        /// Created Date : 12 Sep 2014
        /// Modified By  :
        /// Modified Date:
        /// </summary>
        /// <returns></returns>
        /// 
        public static FeeInfo GetMFeeType()
        {
            var MFeeData = new FeeInfo();

            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, "SpGetMFeeType");
                var safe = new SafeDataReader(reader);
                while (reader.Read())
                {
                    var FeeItem = new WOFee();
                    FeeItem.FetchFeeType(FeeItem, safe);
                    MFeeData.FeeList.Add(FeeItem);
                }
                return MFeeData;
            }
            catch (Exception ex)
            {
                log.Error("Error: " + ex);
                return MFeeData;
            }
            finally
            {
                log.Debug("End: " + methodBase.Name);
            }
        }
Example #8
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 #9
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);
            }
        }