Beispiel #1
0
 public ActionResult Create(T_COM_Master_Degree model)
 {
     try
     {
         if (ModelState.IsValid)
         {
             //  model.CreatedUser = CurrentUser.UserName;
             if (model.DegreeID != 0)
             {
                 //get default value
                 //	T_COM_Master_Degree b = T_COM_Master_DegreeManager.GetById(model.DegreeID);
                 T_COM_Master_DegreeManager.Update(model);
             }
             else
             {
                 // TODO: Add insert logic here
                 //	 model.CreatedDate = SystemConfig.CurrentDate;
                 T_COM_Master_DegreeManager.Add(model);
             }
             return(View(ViewFolder + "list.cshtml", T_COM_Master_DegreeManager.GetAll()));
         }
     }
     catch
     {
         return(View(model));
     }
     return(View(model));
 }
Beispiel #2
0
        public ContentResult SaveExcel(string item)
        {
            //string b = Request["item"];
            IEnumerable <T_COM_Master_Degree> objItemList = JsonConvert.DeserializeObject <IEnumerable <T_COM_Master_Degree> >(item);

            JsonObject obj = new JsonObject();

            obj.StatusCode = 200;
            obj.Message    = "The process is sucessed";
            foreach (T_COM_Master_Degree objitem in objItemList)
            {
                //default value
                //objitem.CreatedUser = CurrentUser.UserName;
                objitem.CreatedDate = SystemConfig.CurrentDate;

                T_COM_Master_DegreeManager.Add(objitem);
            }

            return(Content(JsonConvert.SerializeObject(obj), "application/json"));
        }