Пример #1
0
        public ActionResult _LocationAreaDropDownList(string controlName, string controlId, string selectedValue, bool? includeBlankOption, string blankOptionDescription, string blankOptionValue, string LocationCode)
        {
            ViewBag.ControlName = controlName;
            ViewBag.ControlId = controlId;
            //ViewBag.SelectedValue = selectedValue;
            IList<LocationArea> locationAreaList = base.genericMgr.FindAll<LocationArea>("from LocationArea as i where i.IsActive = ? and i.Location=?",
                                                                   new object[] { true, LocationCode });
            if (locationAreaList == null)
            {
                locationAreaList = new List<LocationArea>();
            }

            if (includeBlankOption.HasValue && includeBlankOption.Value)
            {
                LocationArea blankItem = new LocationArea();
                blankItem.Code = blankOptionValue;
                blankItem.Name = blankOptionDescription;

                locationAreaList.Insert(0, blankItem);
            }
            return PartialView(new SelectList(locationAreaList, "Code", "Name", selectedValue));
        }
Пример #2
0
 public ActionResult _LocationAreaNew(LocationArea locationArea, string locationCode)
 {
     locationArea.Location = locationCode;
     if (ModelState.IsValid)
     {
         if (base.genericMgr.FindAll<long>(locationAreaDuiplicateVerifyStatement, new object[] { locationArea.Code })[0] > 0)
         {
             SaveErrorMessage(Resources.ErrorMessage.Errors_Existing_Code, locationArea.Code);
         }
         else
         {
             base.genericMgr.Create(locationArea);
             SaveSuccessMessage(Resources.MD.LocationArea.LocationArea_Added);
             return RedirectToAction("_LocationAreaEdit/" + locationArea.Code);
         }
     }
     ViewBag.LocationCode = locationCode;
     return PartialView(locationArea);
 }
Пример #3
0
        public ActionResult _LocationAreaEdit(LocationArea locationArea)
        {
            if (ModelState.IsValid)
            {
                base.genericMgr.Update(locationArea);
                SaveSuccessMessage(Resources.MD.LocationArea.LocationArea_Updated);
            }

            return PartialView(locationArea);
        }
Пример #4
0
 public ActionResult _LocationAreaNew(LocationArea locationArea, string locationCode)
 {
     locationArea.Location = locationCode;
     if (ModelState.IsValid)
     {
         if (this.genericMgr.FindAll<long>(locationAreaDuiplicateVerifyStatement, new object[] { locationArea.Code })[0] > 0)
         {
             SaveErrorMessage(Resources.SYS.ErrorMessage.Errors_Existing_Code, locationArea.Code);
         }
         else
         {
             this.genericMgr.CreateWithTrim(locationArea);
             SaveSuccessMessage(Resources.MD.LocationArea.LocationArea_Added);
             return new RedirectToRouteResult(new RouteValueDictionary  
                                            { 
                                                { "action", "_LocationAreaList" }, 
                                                { "controller", "Location" },
                                                { "LocationCode", locationCode }
                                            });
         }
     }
     ViewBag.LocationCode = locationCode;
     return PartialView(locationArea);
 }