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

            JsonObject obj = new JsonObject();

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

                T_CMS_InterfaceLacviet_WorkingHoursManager.Add(objitem);
            }

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