Example #1
0
        public ActionResult Save(C.Vendor model)
        {
            model.User.UserType = C.Enums.WFSUserTypeEnum.VendorAdmin;
            var resp = _vendorMgr.SaveVendor(new C.ReqResp.SaveVendorRequest() { Subject = model });

            if (resp.Status == Status.Success)
            {
                var uiresponse = resp.ToUIResult<VendorEditModel, C.Vendor>((vendor) => new VendorEditModel(resp.Value)
                    , (vm) => string.Empty);

                uiresponse.AdditionalPayload = new
                {
                    addressHtml = RenderPartialViewToString("DisplayAddress", uiresponse.Subject.Vendor)
                    ,
                    contactHtml = RenderPartialViewToString("DisplayContact", uiresponse.Subject.Vendor)
                };

                return Json(uiresponse);
            }
            else
            {
                var uiresponse = resp.ToUIResult<VendorEditModel, C.Vendor>((vendor) => new VendorEditModel(vendor)
                    , (vm) =>
                    {
                        vm.Merge(resp);

                        return RenderPartialViewToString("EditVendor", vm);
                    });
                return Json(uiresponse);
            }
        }
Example #2
0
 public static void ForUpdate(this UserOrderProfile existing, C.OrderProfile model)
 {
     existing.FirstName = model.FirstName;
     existing.LastName = model.LastName;
     existing.LunchPeriodId = model.LunchPeriodId;
     existing.SchoolGradeId = model.GradeId;
     existing.TeacherId = model.TeacherId;
     existing.Title = model.Title;
 }
Example #3
0
 public static void ForUpdate(this WFSUserAddress existing, C.PhoneAddress modified)
 {
     existing.Address1 = modified.Address1;
     existing.Address2 = modified.Address2;
     existing.City = modified.City;
     existing.State = modified.State;
     existing.ZipCode = modified.ZipCode;
     existing.PhoneNumber = modified.PhoneNumber;
     existing.PhoneExt = modified.PhoneExt;
 }
Example #4
0
        public static IExtendedOrganization GetExtensionClass(C.Enums.OrganizationTypeEnum type)
        {
            switch (type)
            {
                case WFS.Contract.Enums.OrganizationTypeEnum.Vendor:
                    return new ExtendVendor();
                case WFS.Contract.Enums.OrganizationTypeEnum.School:
                    return new ExtendSchool();
                default:
                    break;
            }

            return null;
        }
Example #5
0
 public static void ForUpdate(this School existing, C.School School)
 {
     School.Map(existing);
 }
Example #6
0
 public static void ForUpdate(this Organization existing, C.Vendor vendor)
 {
     vendor.Map(existing);
 }
Example #7
0
 public static void ForUpdate(this SupportTicket existing, C.SupportTicket ticket)
 {
     existing.ResolvedUserID = ticket.ResolvedByUserID;
     existing.ResolvedText = ticket.ResolvedText;
     existing.ResolvedDate = DateTime.Today;
 }
Example #8
0
 public static void ForUpdate(this VendorFoodCategory existing, C.FoodCategory foodCategory)
 {
     foodCategory.Map(existing);
 }
Example #9
0
 public static void ForUpdate(this FoodItem existing, C.FoodItem FoodItem)
 {
     FoodItem.Map(existing);
 }
Example #10
0
 public static void ForUpdate(this VendorFoodOption existing, C.FoodOption FoodOption)
 {
     FoodOption.Map(existing);
 }