Exemplo n.º 1
0
        //public IEnumerable<Eva_SalesTypeMultiModel> Get()
        //{
        //    BaseService service = new BaseService();
        //    string status = string.Empty;
        //    var listEntity = service.GetData<Eva_SalesTypeMultiModel>(string.Empty, ConstantSql.hrm_eva_sp_get_SalesType_multi, ref status);

        //    if (listEntity != null)
        //    {
        //        var listModel = listEntity.Translate<Eva_SalesTypeMultiModel>();
        //        return listModel;
        //    }
        //    return new List<Eva_SalesTypeMultiModel>();
        //}

        public Eva_SaleEvaluationModel GetById(Guid id)
        {
            string status = string.Empty;
            var model = new Eva_SaleEvaluationModel();
            var service = new ActionService(UserLogin);
            var entity = service.GetByIdUseStore<Eva_SaleEvaluationEntity>(id, ConstantSql.hrm_eva_sp_get_SaleEvaluationByID, ref status);
            if (entity != null)
            {
                model = entity.CopyData<Eva_SaleEvaluationModel>();
            }
            model.ActionStatus = status;
            return model;
        }
Exemplo n.º 2
0
 public ActionResult EditSaleEvaluation(Guid id)
 {
     if (!CheckPermission()) return RedirectToAction("Denied", "Portal");
     string status = string.Empty;
     var model = new Eva_SaleEvaluationModel();
     ActionService service = new ActionService(UserLogin);
     var entity = service.GetByIdUseStore<Eva_SaleEvaluationEntity>(id, ConstantSql.hrm_eva_sp_get_SaleEvaluationByID, ref status);
     if (entity != null)
     {
         model = entity.CopyData<Eva_SaleEvaluationModel>();
     }
     model.ActionStatus = status;
     return GetOnlyView(model);
 }
Exemplo n.º 3
0
        //public ActionResult Paysips()
        //{
        //    if (!CheckedLogin)
        //    {
        //        return CheckLogin();
        //    }
        //     var id = Session[SessionObjects.ProfileID];
        //    var service = new Hre_ProfileServices();
        //    string status = string.Empty;
        //    var listModel = service.GetData<Hre_ProfileModelPortal>(HRM.Infrastructure.Utilities.Common.DotNetToOracle(id.ToString()), ConstantSql.hrm_hr_sp_get_ProfileById, ref status).FirstOrDefault();
        //    if (listModel != null)
        //    {
        //        listModel.ActionStatus = status;
        //    }
        //    return View(listModel);
        //}


        public string SaveSaleEvalution(Eva_SaleEvaluationModel model)
        {

            #region Tính tỉ lệ = thực đạt / chỉ tiêu

            if (model != null)
            {
                model.ResultNumber = model.ResultNumber.HasValue ? model.ResultNumber.Value : 0;
                model.TagetNumber = model.TagetNumber.HasValue ? model.TagetNumber.Value : 0;
                if (model.TagetNumber > 0)
                {
                    model.ResultPercent = (model.ResultNumber / model.TagetNumber) * 100;
                }
            }
            #endregion
            ActionService service = new ActionService(UserLogin);
             service.UpdateOrCreate<Eva_SaleEvaluationEntity, Eva_SaleEvaluationModel>(model);
            //IdLeaveday = model.ID;
             if (model.ID != Guid.Empty)
             {
                 return model.ID.ToString();
             }
             return model.ActionStatus;
        }
Exemplo n.º 4
0
 public ActionResult CreateInlineSaleEvaluation([Bind(Prefix = "models")] Eva_SaleEvaluationModel model)
 {
     var service = new RestServiceClient<Eva_SaleEvaluationModel>(UserLogin);
     service.SetCookies(this.Request.Cookies, _hrm_Hr_Service);
     var result = new Eva_SaleEvaluationModel();
     result = service.Post(_hrm_Eva_Service, "api/Eva_SaleEvaluation/", model);
     return Json(result);
 }