예제 #1
0
        public void UpdatePartyAddress(PartyAddress partyAddress)
        {
            if (partyAddress.IsPrimary)
            {
                this.genericMgr.Update("update from PartyAddress set IsPrimary = ? where Party = ?", new object[] { false, partyAddress.Party });
                this.genericMgr.FlushSession();
            }

            genericMgr.Update(partyAddress);
        }
예제 #2
0
        public ActionResult _ShipAddressEdit(PartyAddress partyAddress, string PartyCode)
        {
            if (ModelState.IsValid)
            {
                partyAddress.Party = PartyCode;
                partyMgr.UpdatePartyAddress(partyAddress);

                SaveSuccessMessage(Resources.MD.Address.Address_Updated);
            }
            return PartialView(partyAddress);
        }
예제 #3
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;
                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);
        }
예제 #4
0
        public ActionResult _BillAddressEdit(PartyAddress partyAddress, string PartyCode)
        {
            if (ModelState.IsValid)
            {
                partyAddress.Party = PartyCode;
                partyMgr.UpdatePartyAddress(partyAddress);

                SaveSuccessMessage(Resources.MD.Address.Address_Updated);
            }

            TempData["TabIndex"] = 1;
            return PartialView(partyAddress);
        }
예제 #5
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);
        }