/// <summary> /// 返回单个对象 /// </summary> /// <param name="id"></param> /// <returns></returns> public dynamic GetModel(int id) { try { dynamic model = null; string strSql = string.Format("select Id,FK_LiceTranId,Reviewer,AuditSay,AuditDate from T_LiceTranCheck where Id = {0}", id); using (dynamic read = DbHelperSQL.ExecuteReader(strSql)) { if (read.Read()) { model = new LiceTranCheck(); try { model.Id = int.Parse(read["Id"].ToString()); } catch { } try { model.FK_LiceTranId = int.Parse(read["FK_LiceTranId"].ToString()); } catch { } model.Reviewer = read["Reviewer"].ToString(); model.AuditSay = read["AuditSay"].ToString(); try { model.AuditDate = DateTime.Parse(read["AuditDate"].ToString()); } catch { } } read.Dispose(); } return(model); } catch { throw; } }
private dynamic GetModels(HttpContext context) { dynamic model = new LiceTranCheck(); try { model.Id = int.Parse(context.Request.Form["Id"].ToString()); } catch { } try { model.FK_LiceTranId = int.Parse(context.Request.Form["FK_LiceTranId"].ToString()); } catch { } model.Reviewer = adminUser.AdminName; model.AuditSay = context.Request.Form["AuditSay"].ToString(); try { model.AuditDate = DateTime.Now; } catch { } return(model); }
/// <summary> /// /// </summary> /// <param name="model"></param> /// <returns></returns> private SqlParameter[] GetSqlParameter(LiceTranCheck model) { SqlParameter[] parameters = { new SqlParameter("@FK_LiceTranId", SqlDbType.Int, 4), new SqlParameter("@Reviewer", SqlDbType.NVarChar, 100), new SqlParameter("@AuditSay", SqlDbType.NVarChar, 100), new SqlParameter("@AuditDate", SqlDbType.DateTime), new SqlParameter("@Id", SqlDbType.Int, 4) }; parameters[0].Value = model.FK_LiceTranId; parameters[1].Value = model.Reviewer; parameters[2].Value = model.AuditSay; parameters[3].Value = model.AuditDate; parameters[4].Value = model.Id; return(parameters); }
/// <summary> /// 添加操作 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool Create(LiceTranCheck model) { try { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into T_LiceTranCheck("); strSql.Append("FK_LiceTranId,Reviewer,AuditSay,AuditDate)"); strSql.Append(" values ("); strSql.Append("@FK_LiceTranId,@Reviewer,@AuditSay,@AuditDate)"); if (DbHelperSQL.ExecuteSql(strSql.ToString(), GetSqlParameter(model)) > 0) { return(true); } else { return(false); } } catch { throw; } }
/// <summary> /// 更新操作 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool Update(LiceTranCheck model) { try { StringBuilder strSql = new StringBuilder(); strSql.Append("update T_LiceTranCheck set "); strSql.Append("FK_LiceTranId=@FK_LiceTranId,"); strSql.Append("Reviewer=@Reviewer,"); strSql.Append("AuditSay=@AuditSay,"); strSql.Append("AuditDate=@AuditDate"); strSql.Append(" where Id=@Id"); if (DbHelperSQL.ExecuteSql(strSql.ToString(), GetSqlParameter(model)) > 0) { return(true); } else { return(false); } } catch { throw; } }
// private string LiTrCheckCreate(HttpContext context) { try { SysLogBll.Create("出让/受让方", "出让/受让方审核操作", adminUser.AdminName); LiceTranCheck ltc = new LiceTranCheck(); ltc.AuditDate = DateTime.Now; ltc.AuditSay = context.Request.QueryString["AuditSay"]; ltc.FK_LiceTranId = int.Parse(context.Request.QueryString["FK_LiceTranId"]); ltc.Reviewer = adminUser.AdminName; //if (0 == dal.GetComnoData(ltc.FK_LiceTranId).Rows.Count) //{ if (new LiceTranCheckDal().Create(ltc)) { if (dal.UpdateState("AuditType", "1", ltc.FK_LiceTranId)) { return("审核意见添加成功,审核操作完成。"); } else { return("审核意见添加成功,审核操作没有完成!"); } } else { return("审核意见添加失败,审核操作未完成!"); } //} //else //{ // return "出让,受让方需要上传的扫描件没有上传全面还有[" + dal.GetComnoData(ltc.FK_LiceTranId).Rows.Count.ToString() + "]个附件需要上传,无法通过审核!"; //} } catch (Exception ex) { SystemErrorPlug.ErrorRecord("时间:[" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "]类名:[" + this.GetType().Name + "],行号:[" + Component.GetLineNum().ToString() + "行],错误信息:[" + ex.Message + "]"); return(string.Empty); } }