Beispiel #1
0
        /// <summary>
        /// Tạo mời một Can_Line
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public ActionResult Add([Bind] Can_LineModel model)
        {
            var service = new RestServiceClient <Can_LineModel>(UserLogin);

            service.SetCookies(this.Request.Cookies, _hrm_Can_Service);
            var result = service.Put(_hrm_Can_Service, "api/Can_Line/", model);

            return(Json(result));
        }
Beispiel #2
0
 public ActionResult Create(Can_LineModel model)
 {
     if (ModelState.IsValid)
     {
         var service = new RestServiceClient <Can_LineModel>(UserLogin);
         service.SetCookies(this.Request.Cookies, _hrm_Can_Service);
         var result = service.Put(_hrm_Can_Service, "api/Can_Line/", model);
         ViewBag.MsgInsert = ConstantDisplay.HRM_Canteen_Line_InsertSuccess.TranslateString();
     }
     return(View());
 }
Beispiel #3
0
 public ActionResult Edit([DataSourceRequest] DataSourceRequest request, Can_LineModel Can_Line)
 {
     if (ModelState.IsValid)
     {
         var service = new RestServiceClient <Can_LineModel>(UserLogin);
         service.SetCookies(this.Request.Cookies, _hrm_Can_Service);
         var result = service.Put(_hrm_Can_Service, "api/Can_Line/", Can_Line);
         //return Json(result);
         ViewBag.MsgUpdate = ConstantDisplay.HRM_Canteen_Line_UpdateSuccess.TranslateString();
     }
     return(View());
 }
Beispiel #4
0
        /// <summary>
        /// [Tam.Le] - Lấy dữ liệu Line theo Id
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Can_LineModel GetById(Guid id)
        {
            string        status  = string.Empty;
            var           model   = new Can_LineModel();
            ActionService service = new ActionService(UserLogin);
            var           entity  = service.GetData <Can_LineEntity>(id, ConstantSql.hrm_can_sp_get_LineById, ref status).FirstOrDefault();

            if (entity != null)
            {
                model = entity.CopyData <Can_LineModel>();
            }
            model.ActionStatus = status;
            return(model);
        }
Beispiel #5
0
        public Can_LineModel Post([Bind] Can_LineModel model)
        {
            ActionService service = new ActionService(UserLogin);

            return(service.UpdateOrCreate <Can_LineEntity, Can_LineModel>(model));
        }