public Lau_LaundryRecordModel Post([Bind] Lau_LaundryRecordModel model)
        {
            model.Type = LaundryRecordType.E_MANUAL.ToString();
            ActionService service = new ActionService(UserLogin);

            return(service.UpdateOrCreate <LMS_LaundryRecordEntity, Lau_LaundryRecordModel>(model));
        }
        /// <summary>
        /// [Tin.Nguyen] - Lấy dữ liệu Tủ Đồ(Lau_Locker) theo Id
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Lau_LaundryRecordModel GetById(Guid id)
        {
            string        status  = string.Empty;
            var           model   = new Lau_LaundryRecordModel();
            ActionService service = new ActionService(UserLogin);
            var           entity  = service.GetData <LMS_LaundryRecordEntity>(id, ConstantSql.hrm_lau_sp_get_LaundryRecord_byId, ref status).FirstOrDefault();

            if (entity != null)
            {
                model = entity.CopyData <Lau_LaundryRecordModel>();
            }
            model.ActionStatus = status;
            return(model);
        }
Beispiel #3
0
        /// <summary>
        /// Xử lí thay doi trang thai cua ngày công
        /// </summary>
        /// <param name="contract"></param>
        /// <returns></returns>
        public ActionResult SetStatusSelected(string selectedIds, string status)
        {
            var model = new Lau_LaundryRecordModel();

            if (selectedIds != null)
            {
                var service = new RestServiceClient <Lau_LaundryRecordModel>(UserLogin);
                service.SetCookies(this.Request.Cookies, _hrm_Lau_Service);
                model.ProfileIDs = selectedIds;
                model.Status     = status;
                service.Put(_hrm_Lau_Service, "api/LaundryRecord/", model);
            }
            return(Json(""));
        }
        public Lau_LaundryRecordModel Put([Bind] Lau_LaundryRecordModel model)
        {
            model.ProfileIDs = Common.DotNetToOracle(model.ProfileIDs);
            BaseService   service = new BaseService();
            string        status  = string.Empty;
            List <object> lstObj  = new List <object>();

            lstObj.Add(model.ProfileIDs);
            lstObj.Add(model.Status);
            var rs = service.UpdateData <Lau_LaundryRecordModel>(lstObj, ConstantSql.hrm_att_sp_get_LaundryRecord_UpdateStatus, ref status);

            if (rs != null)
            {
                return(model);
            }
            return(null);
        }