Пример #1
0
        public ActionResult Search(string SearchField)
        {
            object result = "";

            try
            {
                if (string.IsNullOrEmpty(SearchField))
                {
                    result = new B_Learns().GetLearns().OrderByDescending(x => x.Id);
                }
                else
                {
                    result = new B_Learns().GetLearns().Where(x => x.Title.Contains(SearchField)).ToList().OrderByDescending(x => x.Id);
                }
            }
            catch (Exception ex)
            {
                M_SystemLog exx = new M_SystemLog(E_SystemType.SHAHRDARI_USER_WEB_APPLICATION, E_LogType.ERROR, ex);
                result = "Error";
                if (ex.Source == E_LogType.SYSTEM_ERROR.ToString())
                {
                    exx.LogType = E_LogType.SYSTEM_ERROR;
                    result      = exx;
                }
                L_Log.SubmitLog(exx);
            }
            return(Json(result));
        }
Пример #2
0
        public ActionResult GetEducations()
        {
            object result = "";

            try
            {
                result = new B_Learns().GetLearns();
            }
            catch (Exception ex)
            {
                M_SystemLog exx = new M_SystemLog(E_SystemType.SHAHRDARI_USER_WEB_APPLICATION, E_LogType.ERROR, ex);
                result = "Error";
                if (ex.Source == E_LogType.SYSTEM_ERROR.ToString())
                {
                    exx.LogType = E_LogType.SYSTEM_ERROR;
                    result      = exx;
                }
                L_Log.SubmitLog(exx);
            }
            return(Json(result));
        }
Пример #3
0
        public ActionResult Delete(int Id)
        {
            object result = "";

            try
            {
                B_Learns bPersonel = new B_Learns();
                bPersonel.Delete(Id);
                result = "Success";
            }
            catch (Exception ex)
            {
                M_SystemLog exx = new M_SystemLog(E_SystemType.SHAHRDARI_WEB_APPLICATION, E_LogType.ERROR, ex);
                result = "Error";
                if (ex.Source == E_LogType.SYSTEM_ERROR.ToString())
                {
                    exx.LogType = E_LogType.SYSTEM_ERROR;
                    result      = exx;
                }
                L_Log.SubmitLog(exx);
            }
            return(Json(result));
        }