Пример #1
0
        public List <sp_calendar_dashboard_Result> searchCalendar_v2(dashBoardModel value)
        {
            try
            {
                using (StandardCanEntities context = new StandardCanEntities())
                {
                    if (String.IsNullOrEmpty(value.user_id))
                    {
                        throw new Exception("Unauthorized Access");
                    }
                    var userId = JwtHelper.GetUserIdFromToken(value.user_id);
                    if (String.IsNullOrEmpty(userId))
                    {
                        throw new Exception("Unauthorized Access");
                    }
                    JavaScriptSerializer js = new JavaScriptSerializer();
                    string json             = js.Serialize(value);
                    context.interface_log.Add(new interface_log
                    {
                        data_log    = json,
                        module      = "dashBoard",
                        update_date = DateTime.Now
                    });
                    context.SaveChanges();

                    List <sp_calendar_dashboard_Result> result = context.sp_calendar_dashboard(userId).ToList();
                    return(result);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }