Exemplo n.º 1
0
 public ActionResult EditUrinalysisRecord(BaneUrinalysisRecordModel model)
 {
     //string fileName;
     try
     {
         //string url = UpLoadFile(out fileName,model.ur_attach);
         //if(string.IsNullOrEmpty(url))
         //    return operateContext.RedirectAjax(1, "请上传现场检测记录附件~", "", "");
         int approveStatus            = RequestHelper.GetIntByName("approveStatus");
         Bane_UrinalysisRecord record = new Bane_UrinalysisRecord
         {
             //ur_file_name = fileName,
             //ur_attach = url,
             ur_manager      = model.ur_manager,
             ur_result       = model.ur_result,
             approve_status  = (approveStatus > 0)? approveStatus: model.approve_status,
             ur_reality_date = Convert.ToDateTime(model.ur_reality_date),
             ur_code         = model.ur_code,
             ur_site         = model.ur_site,
             ur_method       = model.ur_method,
             ur_result_show  = model.ur_result_show,
             ur_input_date   = DateTime.ParseExact(model.ur_input_date, "yyyy-MM-dd", new System.Globalization.CultureInfo("zh-CN"))
         };
         operateContext.bllSession.Bane_UrinalysisRecord.Modify(record, s => s.ur_id == model.ur_id, "ur_manager", "ur_result", "approve_status", "ur_reality_date", "ur_code", "ur_site", "ur_method", "ur_result_show", "ur_input_date");
         return(operateContext.RedirectAjax(0, "编辑记录成功~", "", ""));
     }
     catch (Exception ex)
     {
         return(operateContext.RedirectAjax(1, ex.Message, "", ""));
     }
 }
Exemplo n.º 2
0
 public ActionResult AddUrinalysisRecord(BaneUrinalysisRecordModel model)
 {
     if (!ModelState.IsValid)
     {
         return(operateContext.RedirectAjax(1, "数据验证失败~", "", ""));
     }
     try
     {
         //添加之前判断身份证是否被占用
         bool Isback = operateContext.bllSession.Bane_UrinalysisRecord.AddUrinalysisRecordUser(model);
         if (Isback)
         {
             return(operateContext.RedirectAjax(0, "添加数据成功~", "", ""));
         }
         return(operateContext.RedirectAjax(1, "添加数据失败~", "", ""));
     }
     catch (Exception ex)
     {
         return(operateContext.RedirectAjax(1, ex.Message, "", ""));
     }
 }
Exemplo n.º 3
0
        public ActionResult EditUrinalysisRecord(BaneUrinalysisRecordModel model)
        {
            ModelState.Remove("ur_code");
            if (!ModelState.IsValid)
            {
                return(operateContext.RedirectAjax(1, "数据验证失败~", "", ""));
            }
            bool IsBack = true;

            try
            {
                IsBack = operateContext.bllSession.Bane_UrinalysisRecord.EditUrinalysisRecordUser(model);
            }
            catch (Exception ex)
            {
                return(operateContext.RedirectAjax(1, ex.Message, "", ""));
            }
            if (IsBack)
            {
                return(operateContext.RedirectAjax(0, "编辑用户成功~", "", ""));
            }
            return(operateContext.RedirectAjax(1, "编辑用户失败~", "", ""));
        }
        /// <summary>
        ///  添加对象
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool EditUrinalysisRecordUser(BaneUrinalysisRecordModel model)
        {
            if (model == null)
            {
                return(false);
            }
            Bane_UrinalysisRecord record = new Bane_UrinalysisRecord
            {
                user_identify   = model.user_identify,
                ur_should_date  = DateTime.ParseExact(model.ur_should_date, "yyyy-MM-dd", new System.Globalization.CultureInfo("zh-CN")),
                ur_reality_date = Convert.ToDateTime(model.ur_reality_date), //DateTime.ParseExact(model.ur_reality_date, "yyyy-MM-dd", new System.Globalization.CultureInfo("zh-CN")),
                ur_manager      = model.ur_manager,
                ur_result       = model.ur_result,
                ur_attach       = model.ur_attach,
                ur_note         = model.ur_note,
                approve_status  = model.approve_status,
                ur_site         = model.ur_site,
                ur_method       = model.ur_method,
                ur_input_date   = DateTime.ParseExact(model.ur_input_date, "yyyy-MM-dd", new System.Globalization.CultureInfo("zh-CN"))
            };

            DBSession.IBane_UrinalysisRecordDAL.Modify(record, s => s.ur_id == model.ur_id, "ur_should_date", "ur_reality_date", "ur_manager", "ur_result", "approve_status", "ur_note");
            return(true);
        }