Esempio n. 1
0
 public Maticsoft.Model.Shop.Shipping.ShippingAddress DataRowToModel(DataRow row)
 {
     Maticsoft.Model.Shop.Shipping.ShippingAddress address = new Maticsoft.Model.Shop.Shipping.ShippingAddress();
     if (row != null)
     {
         if ((row["ShippingId"] != null) && (row["ShippingId"].ToString() != ""))
         {
             address.ShippingId = int.Parse(row["ShippingId"].ToString());
         }
         if ((row["RegionId"] != null) && (row["RegionId"].ToString() != ""))
         {
             address.RegionId = int.Parse(row["RegionId"].ToString());
         }
         if ((row["UserId"] != null) && (row["UserId"].ToString() != ""))
         {
             address.UserId = int.Parse(row["UserId"].ToString());
         }
         if (row["ShipName"] != null)
         {
             address.ShipName = row["ShipName"].ToString();
         }
         if (row["Address"] != null)
         {
             address.Address = row["Address"].ToString();
         }
         if (row["Zipcode"] != null)
         {
             address.Zipcode = row["Zipcode"].ToString();
         }
         if (row["EmailAddress"] != null)
         {
             address.EmailAddress = row["EmailAddress"].ToString();
         }
         if (row["TelPhone"] != null)
         {
             address.TelPhone = row["TelPhone"].ToString();
         }
         if (row["CelPhone"] != null)
         {
             address.CelPhone = row["CelPhone"].ToString();
         }
     }
     return address;
 }
Esempio n. 2
0
 public ActionResult AddressInfo(int id = -1, string viewName = "AddressInfo")
 {
     Maticsoft.Model.Shop.Shipping.ShippingAddress model;
     if (id > 0)
     {
         model = this._addressManage.GetModel(id);
     }
     else
     {
         Maticsoft.Model.Shop.Shipping.ShippingAddress address2 = new Maticsoft.Model.Shop.Shipping.ShippingAddress {
             ShipName = base.CurrentUser.TrueName,
             UserId = base.CurrentUser.UserID,
             EmailAddress = base.CurrentUser.Email,
             CelPhone = base.CurrentUser.Phone
         };
         model = address2;
     }
     return base.View(viewName, model);
 }
Esempio n. 3
0
 public ActionResult AddressInfo(int addressId = -1, bool isModify = false, string viewName = "_AddressInfo")
 {
     Predicate<Maticsoft.Model.Shop.Shipping.ShippingAddress> match = null;
     Maticsoft.BLL.Shop.Shipping.ShippingAddress address = new Maticsoft.BLL.Shop.Shipping.ShippingAddress();
     ShippingAddressModel model = new ShippingAddressModel {
         ListAddress = address.GetModelList(" UserId=" + base.currentUser.UserID)
     };
     ((dynamic) base.ViewBag).IsModify = isModify;
     if ((isModify && (addressId > 0)) && ((model.ListAddress != null) && (model.ListAddress.Count > 0)))
     {
         if (match == null)
         {
             match = info => info.ShippingId == addressId;
         }
         model.CurrentAddress = model.ListAddress.Find(match);
     }
     if ((!isModify && (addressId < 0)) && (model.CurrentAddress == null))
     {
         Maticsoft.Model.Shop.Shipping.ShippingAddress address2 = new Maticsoft.Model.Shop.Shipping.ShippingAddress {
             ShippingId = addressId,
             ShipName = base.CurrentUser.TrueName,
             UserId = base.CurrentUser.UserID,
             EmailAddress = base.CurrentUser.Email,
             CelPhone = base.CurrentUser.Phone
         };
         model.CurrentAddress = address2;
     }
     if (model.CurrentAddress == null)
     {
         Maticsoft.Model.Shop.Shipping.ShippingAddress address3 = new Maticsoft.Model.Shop.Shipping.ShippingAddress {
             ShippingId = addressId
         };
         model.CurrentAddress = address3;
     }
     return base.View(viewName, model);
 }
 public ActionResult ShippAddress(int id = -1, string viewName = "ShippAddress")
 {
     IPageSetting pageSetting = PageSetting.GetPageSetting("Home", ApplicationKeyType.Shop);
     ((dynamic) base.ViewBag).Title = "我的收货地址" + pageSetting.Title;
     ((dynamic) base.ViewBag).Keywords = pageSetting.Keywords;
     ((dynamic) base.ViewBag).Description = pageSetting.Description;
     Maticsoft.BLL.Shop.Shipping.ShippingAddress address = new Maticsoft.BLL.Shop.Shipping.ShippingAddress();
     Maticsoft.Model.Shop.Shipping.ShippingAddress model = new Maticsoft.Model.Shop.Shipping.ShippingAddress();
     if (id > 0)
     {
         model = address.GetModel(id);
     }
     return base.View(viewName, model);
 }
Esempio n. 5
0
 public ActionResult SubmitAddressInfo(FormCollection form)
 {
     bool flag = Globals.SafeBool(form["IsModify"], false);
     Maticsoft.Model.Shop.Shipping.ShippingAddress address2 = new Maticsoft.Model.Shop.Shipping.ShippingAddress {
         ShippingId = Globals.SafeInt(form["CurrentAddress.ShippingId"], -1),
         UserId = Globals.SafeInt(form["CurrentAddress.UserId"], -1),
         ShipName = form["CurrentAddress.ShipName"],
         RegionId = Globals.SafeInt(form["CurrentAddress.RegionId"], -1),
         Address = form["CurrentAddress.Address"],
         CelPhone = form["CurrentAddress.CelPhone"],
         Zipcode = form["CurrentAddress.Zipcode"]
     };
     Maticsoft.Model.Shop.Shipping.ShippingAddress model = address2;
     if (model.ShippingId > 0)
     {
         if (flag && this._addressManage.Update(model))
         {
             return base.RedirectToAction("ShowAddress", new { addressId = model.ShippingId });
         }
         return base.RedirectToAction("ShowAddress", new { addressId = model.ShippingId });
     }
     if (base.currentUser != null)
     {
         model.UserId = base.currentUser.UserID;
         model.ShippingId = this._addressManage.Add(model);
         if (model.ShippingId > 0)
         {
             return base.RedirectToAction("ShowAddress", new { addressId = model.ShippingId });
         }
     }
     return base.RedirectToAction("AddressInfo");
 }