public ActionResult _ShipAddressNew(Address address, string PartyCode, string sequence, bool isPrimary)
        {
            if (ModelState.IsValid)
            {
                PartyAddress partyAddress = new PartyAddress();
                partyAddress.Party = PartyCode;
                partyAddress.Address = address;
                partyAddress.Sequence = int.Parse(sequence);
                partyAddress.IsPrimary = isPrimary;
                partyAddress.Type = Sconit.CodeMaster.AddressType.ShipAddress;
                if (this.genericMgr.FindAll<long>(CodeDuiplicateVerifyStatement1, new object[] { partyAddress.Party, partyAddress.Address.Code, partyAddress.Type })[0] > 0)
                {
                    base.SaveErrorMessage(Resources.MD.Region.Region_Errors_Existing_Code, partyAddress.Address.AddressContent);
                }
                else
                {
                    partyMgr.AddPartyAddress(partyAddress);

                    TempData[""] = null;
                    SaveSuccessMessage(Resources.MD.Address.Address_Added);
                    return RedirectToAction("_ShipAddressEdit/" + partyAddress.Id);
                }
            }
            return PartialView(address);
        }
 public ActionResult _GetShipAddress(string addressCode)
 {
     Address address = new Address();
     if (!string.IsNullOrEmpty(addressCode))
     {
         address = genericMgr.FindById<Address>(addressCode);
     }
     return PartialView("_ShipAddressNew", address);
 }
 public JsonResult _GetAddress(string addressCode)
 {
     Address address = new Address();
     if (!string.IsNullOrEmpty(addressCode))
     {
         address = genericMgr.FindById<Address>(addressCode);
     }
     // return PartialView("_BillAddressNew", address);
     return this.Json(address);
 }
Esempio n. 4
0
        public ActionResult New(Address address)
        {
            if (ModelState.IsValid)
            {
                if (base.genericMgr.FindAll<long>(duiplicateVerifyStatement, new object[] { address.Code })[0] > 0)
                {
                    SaveErrorMessage(Resources.ErrorMessage.Errors_Existing_Code, address.Code);
                }
                else
                {
                    base.genericMgr.Create(address);
                    SaveSuccessMessage(Resources.MD.Address.Address_Added);
                    return RedirectToAction("Edit/" + address.Code);
                }
            }

            return View(address);
        }
Esempio n. 5
0
        public ActionResult Edit(Address address)
        {
            if (ModelState.IsValid)
            {
                base.genericMgr.Update(address);
                SaveSuccessMessage(Resources.MD.Address.Address_Updated);
            }

            return View(address);
        }
Esempio n. 6
0
        public ActionResult _ShipAddressNew(Address address, string PartyCode, string sequence, bool isPrimary)
        {
            if (ModelState.IsValid)
            {
                PartyAddress partyAddress = new PartyAddress();
                partyAddress.Party = PartyCode;
                partyAddress.Address = address;
                partyAddress.Sequence = int.Parse(sequence);
                partyAddress.IsPrimary = isPrimary;
                partyMgr.AddPartyAddress(partyAddress);

                SaveSuccessMessage(Resources.MD.Address.Address_Added);
                return RedirectToAction("_ShipAddressEdit/" + partyAddress.Id);
            }
            return PartialView(address);
        }
 public JsonResult _GetAddress(string addressCode)
 {
     Address address = new Address();
     if (!string.IsNullOrEmpty(addressCode))
     {
         address = genericMgr.FindById<Address>(addressCode);
     }
     return this.Json(address);
 }