예제 #1
0
        /// <summary>
        /// For inserting Customers of a user in database.
        /// </summary>
        /// <param name="objLocationEmailContact"></param>
        /// <returns></returns>
        public bool AddUserCustomer(UserCustomerList objUserCustomer)
        {
            try
            {
                CommonDAL.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, "Called {2} function ::{0} {1}.", DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name));

                bool IsSuccessfull = false;
                using (PortalDbEntities portalEntities = new PortalDbEntities())
                {
                    UserCustomerRole usercustomerrole = new UserCustomerRole();
                    usercustomerrole.customerId = objUserCustomer.CustomerID;
                    usercustomerrole.userId     = objUserCustomer.UserID;

                    portalEntities.UserCustomerRoles.Add(usercustomerrole); /// Insert the Record in Respected Table.
                    portalEntities.SaveChanges();                           /// Check the Chenges in Table After Record Insertion.

                    IsSuccessfull = true;
                }
                return(IsSuccessfull);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                CommonDAL.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, "End {2} function ::{0} {1}.", DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name));
            }
        }
예제 #2
0
 /// <summary>
 /// For inserting Customers of a user in database.
 /// </summary>
 /// <param name="objLocationEmailContact"></param>
 /// <returns></returns>
 public bool AddUserCustomer(UserCustomerList objUserCustomer)
 {
     CommonDAL.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, "Called {2} function ::{0} {1}.", DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name));
     try
     {
         return(objWebPortalDAL.AddUserCustomer(objUserCustomer));
     }
     catch (Exception)
     {
         throw;
     }
     finally
     {
         CommonDAL.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, "End {2} function ::{0} {1}.", DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name));
     }
 }