Beispiel #1
0
 public ActionResult Create(T_COM_Master_Location model)
 {
     try
     {
         if (ModelState.IsValid)
         {
             //model.CreatedUser = CurrentUser.UserName;
             if (model.LocationID != 0)
             {
                 //get default value
                 //	T_COM_Master_Location b = T_COM_Master_LocationManager.GetById(model.LocationID);
                 T_COM_Master_LocationManager.Update(model);
             }
             else
             {
                 // TODO: Add insert logic here
                 model.CreatedDate = SystemConfig.CurrentDate;
                 T_COM_Master_LocationManager.Add(model);
             }
             return(View(ViewFolder + "list.cshtml", T_COM_Master_LocationManager.GetAll()));
         }
     }
     catch
     {
         return(View(model));
     }
     return(View(model));
 }
Beispiel #2
0
        public ContentResult Save(string objdata, string value)
        {
            JsonObject js = new JsonObject();

            js.StatusCode = 200;
            js.Message    = "Upload Success";
            try
            {
                T_COM_Master_Location obj = JsonConvert.DeserializeObject <T_COM_Master_Location>(objdata);
                obj = T_COM_Master_LocationManager.Update(obj);
                if (obj.LocationID == 0)
                {
                    js.StatusCode = 400;
                    js.Message    = "Has Errors. Please contact Admin for more information";
                }
                else
                {
                    js.Data = obj;
                }
            }
            catch (Exception objEx)
            {
                js.StatusCode = 400;
                js.Message    = objEx.Message;
            }

            return(Content(JsonConvert.SerializeObject(js), "application/json"));
        }
Beispiel #3
0
 public ActionResult Update(T_COM_Master_Location model)
 {
     try
     {
         if (ModelState.IsValid)
         {
             // TODO: Add insert logic here
             T_COM_Master_LocationManager.Update(model);
             //return RedirectToAction("Index");
         }
         return(View(model));
     }
     catch
     {
         return(View(model));
     }
 }