示例#1
0
        /// <summary>
        /// 上传话单
        /// </summary>
        /// <param name="calllog">接受话单json字符串</param>
        /// <returns></returns>

        public ActionResult PushFollowUpRecord(string calllog)
        {
            string url = Request.Url.ToString();
            //WriteInLog log = new WriteInLog();
            //log.writeInLog(url);
            //log.writeInLog(calllog);
            string calllogBit = calllog.Replace(":true", ":1").Replace(":false", ":0");

            //log.writeInLog(calllogBit);

            try
            {
                CRM_CallLogEntity entity = Newtonsoft.Json.JsonConvert.DeserializeObject <CRM_CallLogEntity>(calllogBit);
                //log.writeInLog("序列化完毕");
                crm_calllogbll.SaveForm(entity);
                return(Content(new ReturnMessage {
                    Success = true, Message = "上传成功", Value = null, ErrorCode = 0
                }.ToString()));
                //int row = crm_calllogbll.SaveForm(entity);
                //if (row == 1)
                //{
                //    return Content(new ReturnMessage { Success = true, Message = "上传成功", Value = null, ErrorCode = 0 }.ToString());
                //}
                //else
                //{
                //    return Content(new ReturnMessage { Success = false, Message = "上传失败", Value = null, ErrorCode = 0 }.ToString());
                //}
            }
            catch (System.Exception)
            {
                return(Content(new ReturnMessage {
                    Success = false, Message = "写入数据库失败", Value = null, ErrorCode = 0
                }.ToString()));
            }
        }
示例#2
0
 /// <summary>
 /// 保存表单(新增、修改)
 /// </summary>
 /// <param name="entity">实体对象</param>
 /// <returns></returns>
 public int SaveForm(CRM_CallLogEntity entity)
 {
     try
     {
         return(service.SaveForm(entity));
     }
     catch (Exception)
     {
         throw;
     }
 }
示例#3
0
 /// <summary>
 /// 保存表单(新增、修改)
 /// </summary>
 /// <param name="keyValue">主键值</param>
 /// <param name="entity">实体对象</param>
 /// <returns></returns>
 public void SaveForm(string keyValue, CRM_CallLogEntity entity)
 {
     try
     {
         service.SaveForm(keyValue, entity);
     }
     catch (Exception)
     {
         throw;
     }
 }
示例#4
0
 /// <summary>
 /// 保存表单(新增、修改)
 /// </summary>
 /// <param name="entity">实体对象</param>
 /// <returns></returns>
 public void SaveForm(CRM_CallLogEntity entity)
 {
     try
     {
         service.SaveForm(entity);
     }
     catch (Exception)
     {
         throw;
     }
 }
示例#5
0
        /// <summary>
        /// 保存表单(新增、修改)
        /// </summary>
        /// <param name="keyValue">主键值</param>
        /// <param name="entity">实体对象</param>
        /// <returns></returns>
        //[HttpPost]
        //[ValidateAntiForgeryToken]
        //[AjaxOnly]
        //public ActionResult SaveForm(string keyValue, CRM_CallLogEntity entity)
        //{
        //    crm_calllogbll.SaveForm(keyValue, entity);
        //    return Success("操作成功。");
        //}

        public ActionResult SaveForm(CRM_CallLogEntity entity)
        {
            crm_calllogbll.SaveForm("", entity);
            var jsonData = new
            {
                Success   = true,
                Message   = "",
                Value     = "",
                ErrorCode = 0
            };

            return(ToJsonResult(jsonData));
        }
示例#6
0
        /// <summary>
        /// 保存表单(新增、修改)
        /// </summary>
        /// <param name="keyValue">主键值</param>
        /// <param name="entity">实体对象</param>
        /// <returns></returns>
        //[HttpPost]
        //[ValidateAntiForgeryToken]
        //[AjaxOnly]
        //public ActionResult SaveForm(string keyValue, CRM_CallLogEntity entity)
        //{
        //    crm_calllogbll.SaveForm(keyValue, entity);
        //    return Success("操作成功。");
        //}

        public ActionResult SaveForm(CRM_CallLogEntity entity)
        {
            crm_calllogbll.SaveForm(entity);
            return(Success("操作成功。"));
            //var jsonData = new
            //{
            //    Success = true,
            //    Message = "",
            //    Value = "",
            //    ErrorCode = 0
            //};
            //return ToJsonResult(jsonData);
        }