コード例 #1
0
        public ActionResult DeleteUserParamValue(int UserParamValueId)
        {
            try
            {
                UserParamValue p = UserParamValueRep.Get(UserParamValueId);

                Journal journal_record = new Journal()
                {
                    operation_name     = "удаление параметра у пользователя " + p.IdentityUser.LastName,
                    text_old           = p.UserParamName.param_group + "/" + p.UserParamName.name + "/" + String.Format("{0} N:0", p.numeric_value),
                    table_name         = "UserParamValues",
                    record_id_in_table = p.id,
                    cuser_name         = User.Identity.Name,
                    edited_date        = DateTime.Now,
                };
                JournalRep.AddOrUpdate(journal_record);
                UserParamValueRep.Delete(p);

                return(Json(new { success = true },
                            JsonRequestBehavior.AllowGet));
            }
            catch (Exception)
            {
                return(Json(new { success = false },
                            JsonRequestBehavior.AllowGet));
            }
        }
コード例 #2
0
        public ActionResult AddParamValue(float ParamValue,
                                          DateTime ParamStartDate,
                                          int UserId,
                                          int ParamId
                                          )
        {
            UserParamValue v = new UserParamValue();

            v.cuser_id      = UserId;
            v.numeric_value = ParamValue;
            v.param_id      = ParamId;
            v.HES_date      = ParamStartDate;
            v.set_date      = ParamStartDate;


            UserParamValueRep.AddOrUpdate(v);


            return(new EmptyResult());
        }