Example #1
0
        public dynamic AddEmployee(object form)
        {
            try
            {
                var json = JsonConvert.SerializeObject(form);
                //JObject oJson = JObject.Parse(json);
                EmployeeVO oEmployee = new JavaScriptSerializer().Deserialize <EmployeeVO>(json);

                string result = new JavaScriptSerializer().Serialize(SrvTools.AddEmployee(oEmployee));

                return(new
                {
                    data = result
                });
                //Context.Response.Write(result);
            }
            catch (Exception ex)
            {
                //Context.Response.Write(ex.Message);
                return(new
                {
                    error = ex.Message
                });
            }
        }
Example #2
0
 public void GetStates_by_Subject(string subject)
 {
     try
     {
         string result = new JavaScriptSerializer().Serialize(SrvTools.GetStates_by_Subject(subject));
         Context.Response.Write(result);
     }
     catch (Exception ex)
     {
         Context.Response.Write(ex.Message);
     }
 }
Example #3
0
 public void GetTopics_by_State(string stateCode, string categoryId)
 {
     try
     {
         string result = new JavaScriptSerializer().Serialize(SrvTools.GetTopics_by_State(stateCode, categoryId));
         Context.Response.Write(result);
     }
     catch (Exception ex)
     {
         Context.Response.Write(ex.Message);
     }
 }
Example #4
0
 public void ListAllCategories()
 {
     try
     {
         string result = new JavaScriptSerializer().Serialize(SrvTools.ListAllCategories());
         Context.Response.Write(result);
     }
     catch (Exception ex)
     {
         Context.Response.Write(ex.Message);
     }
 }
Example #5
0
        public dynamic SearchEmployee(string search, string next)
        {
            try
            {
                string result = new JavaScriptSerializer().Serialize(SrvTools.SearchEmployee(search));

                return(new {
                    data = result
                });
                //Context.Response.Write(result);
            }
            catch (Exception ex)
            {
                //Context.Response.Write(ex.Message);
                return(new
                {
                    error = ex.Message
                });
            }
        }
Example #6
0
        public string AddUpdateTopic(string topicId, string subject, string content, string state, string category)
        {
            int updatedTopicId = (string.IsNullOrEmpty(topicId)) ? -1 : Convert.ToInt32(topicId);

            try
            {
                TopicVO topic = new TopicVO()
                {
                    TopicId    = updatedTopicId,
                    Subject    = subject,
                    Content    = content,
                    StateCode  = state,
                    CategoryId = category
                };
                updatedTopicId = SrvTools.Add_Update_Topic(topic);
            }
            catch (Exception ex)
            {
                Context.Response.Write(ex.Message);
            }
            return(updatedTopicId.ToString());
        }