Beispiel #1
0
 public AddressMaster GetAddresMasters(AddressMaster objAddressMaster)
 {
     #region Call API
     objAddressMaster = WebApiLogic.GetPostComplexTypeToAPI <AddressMaster>(objAddressMaster, "LoadAddressMaster", "Master");
     #endregion
     return(objAddressMaster);
 }
Beispiel #2
0
        public int SubmitAddress(int userID, AddressMasterBO addressBO)
        {
            AddressMaster address = new AddressMaster();

            ObjectMapper.Map(addressBO, address);
            return(WeddingRepository.SubmitAddress(userID, address));
        }
Beispiel #3
0
        public void enterAddressFirstNumbers()
        {
            AddressMaster address = new AddressMaster();

            address.FirstName = "abab234423432";
            var expected = "";
            var actual   = address.FirstName;

            Assert.Equal(expected, actual);
        }
Beispiel #4
0
        public void enterAddressCanadaPostalCodeEmpty()
        {
            AddressMaster address = new AddressMaster();

            address.CanadaPostalCode = "";
            var expected = "";
            var actual   = address.CanadaPostalCode;

            Assert.Equal(expected, actual);
        }
Beispiel #5
0
        public void enterAddressCountryEmpty()
        {
            AddressMaster address = new AddressMaster();

            address.Country = "";
            var expected = "";
            var actual   = address.Country;

            Assert.Equal(expected, actual);
        }
Beispiel #6
0
        public void enterAddressCityNull()
        {
            AddressMaster address = new AddressMaster();

            address.City = null;
            var expected = "";
            var actual   = address.City;

            Assert.Equal(expected, actual);
        }
Beispiel #7
0
        public void enterAddressFirstNameNormal()
        {
            AddressMaster address = new AddressMaster();

            address.FirstName = "tom";
            var expected = "tom";
            var actual   = address.FirstName;

            Assert.Equal(expected, actual);
        }
Beispiel #8
0
        public void enterAddressBuildingNegative()
        {
            AddressMaster address = new AddressMaster();

            address.BuildingNumber = -12;
            var expected = 0;
            var actual   = address.BuildingNumber;

            Assert.Equal(expected, actual);
        }
Beispiel #9
0
        public void enterAddressLastNameNumbers()
        {
            AddressMaster address = new AddressMaster();

            address.LastName = "ABC#*(*(34)*()#*";
            var expected = "";
            var actual   = address.LastName;

            Assert.Equal(expected, actual);
        }
Beispiel #10
0
        public void enterAddressStreetEmpty()
        {
            AddressMaster address = new AddressMaster();

            address.Street = "";
            var expected = "";
            var actual   = address.Street;

            Assert.Equal(expected, actual);
        }
Beispiel #11
0
        public UserModel GetUserDetailsById(long userId)
        {
            try
            {
                ObjUserRepository = new UserRepository();
                UserModel editUserDetails = new UserModel();
                //editUserDetails.Address OBJAdress = new AddressModel();
                AddressMaster    ObjAddressMaster = new AddressMaster();
                UserRegistration userDetails      = ObjUserRepository.GetSingleOrDefault(u => u.UserId == userId);

                if (userDetails != null)
                {
                    ObjAddressMaster                  = userDetails.AddressMasters.FirstOrDefault();
                    editUserDetails.EmployeeID        = userDetails.EmployeeID;
                    editUserDetails.UserId            = userDetails.UserId;
                    editUserDetails.UserName          = userDetails.AlternateEmail;
                    editUserDetails.FirstName         = userDetails.FirstName;
                    editUserDetails.LastName          = userDetails.LastName;
                    editUserDetails.myProfileImage    = userDetails.ProfileImage == null ? "" : HostingPrefix + ProfilePicPath.Replace("~", "") + userDetails.ProfileImage;
                    editUserDetails.Email             = userDetails.UserEmail;
                    editUserDetails.UserEmail         = userDetails.UserEmail;
                    editUserDetails.SubscriptionEmail = userDetails.SubscriptionEmail;
                    editUserDetails.UserType          = userDetails.UserType;
                    editUserDetails.IsLoginActive     = userDetails.IsLoginActive;
                    editUserDetails.IsEmailVerify     = userDetails.IsEmailVerify;
                    editUserDetails.Password          = userDetails.Password;
                    editUserDetails.AlternateEmail    = userDetails.AlternateEmail;
                    editUserDetails.Gender            = userDetails.Gender;
                    editUserDetails.DOB               = Convert.ToDateTime(userDetails.DOB).ToString("MM/dd/yy");
                    //editUserDetails.Address.Address1 = ObjAddressMaster.Address1;
                    //editUserDetails.Address.Address2 = ObjAddressMaster.Address2;
                    //Commented by Bhushan Dod due to Error on below line
                    editUserDetails.Address = new AddressModel()
                    {
                        Address1 = ObjAddressMaster.Address1, Address2 = ObjAddressMaster.Address2
                    };

                    //editUserDetails.Address = userDetails.AddressMasters

                    //AutoMapper.Mapper.CreateMap<UserRegistration, UserModel>();
                    //  editUserDetails = AutoMapper.Mapper.Map(userDetails, editUserDetails);
                    //editUserDetails.myProfileImage = editUserDetails.ProfileImage == null ? "" : ProfilePicPath.Replace("~", "") + editUserDetails.ProfileImage;
                    //editUserDetails.Address = new AddressModel() { Address1 = ObjAddressMaster.Address1, Address2 = ObjAddressMaster.Address2 };
                }
                return(editUserDetails);
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #12
0
        public HttpResponseMessage GetAddress(UserMobileNumber objUserMobileNumber)
        {
            try
            {
                AddressMaster  objListAddressMaster = new AddressMaster();
                List <Address> objListAddress       = new List <Address>();
                string         mobileNumber         = objUserMobileNumber.MobileNumber;

                //get mobileNumber from user table
                var getUser = (from user in dbContext.UserInfo where user.MobileNumber == mobileNumber select user).FirstOrDefault();

                //For getting list of address from the table.
                var getaddress = (from address in dbContext.UsersAddress where address.MobileNumberForOnline == getUser.MobileNumber select address).ToList();
                if (getaddress != null)
                {
                    foreach (var i in getaddress)
                    {
                        Address objAddress = new Address()
                        {
                            tr_id           = i.tr_id,
                            retailer_id     = i.retailer_id,
                            retailer_mobile = i.MobileNumberForOnline,
                            reciver_name    = i.reciver_name,
                            ship_address    = i.ship_address,
                            city            = i.city,
                            pincode         = i.pincode,
                            ship_mobile     = i.ship_mobile,
                            email_id        = i.email_id,
                            PanNumber       = i.Pan_number,
                            tr_date         = Convert.ToString(i.tr_date),
                        };
                        objListAddress.Add(objAddress);
                    }
                    objListAddressMaster.Addresses = objListAddress;
                    return(Request.CreateResponse(HttpStatusCode.OK, objListAddressMaster));
                }
                objResponse.Message = "Address not found";
                return(Request.CreateResponse(HttpStatusCode.OK, objResponse));
            }
            catch (Exception ex)
            {
                Log.Info(Convert.ToString(ex.InnerException));
                Log.Info(ex.Message);
                objCommonClasses.InsertExceptionDetails(ex, "MasterController", "GetAddress");
                return(Request.CreateErrorResponse(HttpStatusCode.ExpectationFailed, ex.Message));
            }
        }
Beispiel #13
0
        public ActionResult GetAddressMasters(string term)
        {
            CommonBusiness objBusiness = new CommonBusiness();
            AddressMaster  objAddress  = new AddressMaster();

            objAddress.Term = term;
            objAddress      = objBusiness.GetAddresMasters(objAddress);
            List <SelectListItem> DropDownList = new List <SelectListItem>();

            foreach (var item in objAddress.LstAddressMaster)
            {
                DropDownList.Add(new SelectListItem {
                    Text = item.Text, Value = item.Value
                });
            }
            return(Json(DropDownList, JsonRequestBehavior.AllowGet));
        }
Beispiel #14
0
        public string CreateOrder(OrderViewModel model)
        {
            try
            {
                var address = new AddressMaster();
                address.CompleteAddress = model.Address;
                address.ZipCode         = model.ZipCode;
                var order = new OrderMaster();
                order.AddressId     = address.AddressId;
                order.Address       = address;
                order.CreatedOn     = DateTime.UtcNow;
                order.CustomerName  = model.CustomerName;
                order.IsPaid        = true;
                order.OrderNumber   = 0;
                order.PaymentType   = model.PaymentType;
                order.Quantity      = model.Quantity;
                order.Remarks       = model.Remarks;
                order.TotalAmount   = model.TotalAmount;
                order.NumberOfScoop = model.Quantity;
                var orderList = new List <OrderDetail>();
                if (model.IceCreamId != 0)
                {
                    var orderDetails = new OrderDetail();
                    orderDetails.OrderNumber = order.OrderNumber;
                    orderDetails.IceCreamId  = model.IceCreamId;
                    orderList.Add(orderDetails);
                }
                if (model.ToppingsId != 0)
                {
                    var orderDetails = new OrderDetail();
                    orderDetails.OrderNumber = order.OrderNumber;
                    orderDetails.IceCreamId  = model.ToppingsId;
                    orderList.Add(orderDetails);
                }
                order.OrderDetail = orderList;
                billingContext.Order.Add(order);
                billingContext.SaveChangesAsync();

                return("Order Placed Successfully");
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #15
0
 /// <summary>SaveAdress
 ///
 /// </summary>
 /// <param name="objAddressModel"></param>
 public void SaveAddress(AddressModel objAddressModel)
 {
     try
     {
         if (objAddressModel.StateId == 0 || objAddressModel.CountryId == 0)
         {
             throw new Exception("Country / State cannot be blank");
         }
         if (objAddressModel.AddressMasterId == 0)
         {
             objAddressModel.CreatedBy   = objAddressModel.CreatedBy;
             objAddressModel.CreatedDate = DateTime.UtcNow;
             objAddressModel.IsDeleted   = false;
             _AddressMaster = new AddressMaster();
             AutoMapper.Mapper.CreateMap <AddressModel, AddressMaster>();
             _AddressMaster = AutoMapper.Mapper.Map(objAddressModel, _AddressMaster);
             objAddressMasterRepository.Add(_AddressMaster);
         }
         else
         {
             var data = objAddressMasterRepository.GetSingleOrDefault(l => l.AddressMasterId == objAddressModel.AddressMasterId);
             if (data != null)
             {
                 data.Address1     = objAddressModel.Address1;
                 data.Address2     = objAddressModel.Address2;
                 data.CountryId    = objAddressModel.CountryId;
                 data.StateId      = objAddressModel.StateId;
                 data.City         = objAddressModel.City;
                 data.ZipCode      = objAddressModel.ZipCode;
                 data.Phone        = objAddressModel.Phone;
                 data.Mobile       = objAddressModel.Mobile;
                 data.ModifiedBy   = 1;
                 data.ModifiedDate = DateTime.UtcNow;
                 data.IsDeleted    = false;
                 objAddressMasterRepository.SaveChanges();
             }
         }
     }
     catch (Exception)
     { throw; }
 }
Beispiel #16
0
 public int SubmitAddress(int userID, AddressMaster address)
 {
     using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required,
                                                          new TransactionOptions
     {
         IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted
     }))
     {
         if (address.AddressID == 0)
         {
             address.CreatedDate = DateTime.Now;
             address.CreatedBy   = userID;
             address.IsDeleted   = false;
             AccuitAdminDbContext.AddressMasters.Add(address);
             AccuitAdminDbContext.SaveChanges();
             scope.Complete();
         }
         else
         {
             AddressMaster myaddress = AccuitAdminDbContext.AddressMasters.Where(x => x.AddressID == address.AddressID).FirstOrDefault();// GetWeddingDetailByID(weddingId).WeddingEvents.FirstOrDefault().Venues.Where(x => x.VenueID == venue.VenueID).FirstOrDefault();
             myaddress.ModifiedDate         = DateTime.Now;
             myaddress.Address1             = address.Address1;
             myaddress.Address2             = address.Address2;
             myaddress.City                 = address.City;
             myaddress.State                = address.State;
             myaddress.PinCode              = address.PinCode;
             myaddress.AddressOwnerType     = address.AddressOwnerType;
             myaddress.AddressOwnerTypePKID = address.AddressOwnerTypePKID;
             myaddress.VenueID              = address.VenueID;
             myaddress.AddressType          = address.AddressType;
             myaddress.IsDeleted            = address.IsDeleted;
             AccuitAdminDbContext.Entry(myaddress).State = EntityState.Modified;
             AccuitAdminDbContext.SaveChanges();
             scope.Complete();
         }
     }
     return(address.AddressID);
 }
Beispiel #17
0
        public AddressMaster LoadAddressMaster(AddressMaster objAddressMaster)
        {
            ControllerLogic.Common.CommonBusiness objCommonBusiness = new ControllerLogic.Common.CommonBusiness();

            return(objCommonBusiness.GetAddresMasters(objAddressMaster.Term));
        }
 public UserModel()
 {
     AddressMaster = new AddressMaster();
     CastMaster    = new CastMaster();
 }
Beispiel #19
0
        public AddressMaster LoadAddressMaster(AddressMaster objAddressMaster)
        {
            CommonBusiness objBusiness = new CommonBusiness();

            return(objBusiness.GetAddresMasters(objAddressMaster));
        }