public void OrderApply() { OrderApplyInputModel model = new OrderApplyInputModel(); model.transNo = UtilityHelper.CommonHelper.OrderNoOne(); //model.customkey = "bowangjishi"; model.caseCode = "0000052178002133"; model.insurantDateLimit = "365"; ApplicationData _applicationData = new ApplicationData(); _applicationData.applicationDate = "2017-09-07 13:00:00"; _applicationData.startDate = "2017-09-08"; _applicationData.endDate = "2018-09-08"; ApplicantInfo _applicantInfo = new ApplicantInfo(); _applicantInfo.cName = "倪成智"; _applicantInfo.eName = "nichengzhi"; _applicantInfo.cardType = 1; _applicantInfo.cardCode = "210623199008092631"; _applicantInfo.sex = 1; _applicantInfo.birthday = "1990-08-09"; _applicantInfo.mobile = "15841505041"; _applicantInfo.email = "*****@*****.**"; _applicantInfo.cardPeriod = "2020-10-01"; InsurantInfo _insurantInfo = new InsurantInfo(); _insurantInfo.cName = "倪成智"; _insurantInfo.eName = "nichengzhi"; _insurantInfo.cardType = 1; _insurantInfo.cardCode = "210623199008092631"; _insurantInfo.sex = 1; _insurantInfo.birthday = "1990-08-09"; _insurantInfo.mobile = "15841505041"; _insurantInfo.relationId = 1; _insurantInfo.count = 1; _insurantInfo.singlePrice = 12; _insurantInfo.cardPeriod = "2020-10-01"; OtherInfo _otherInfo = new OtherInfo(); _otherInfo.provCityId = "510000-511800-511821"; _otherInfo.cardPeriod = "2020-10-01"; _otherInfo.notifyAnswerId = ""; _otherInfo.priceArgsId = ""; model.applicationdata = _applicationData; model.applicantinfo = _applicantInfo; model.insurantInfo = _insurantInfo; model.otherInfo = _otherInfo; BaoxianDataBLL baoxianDataBLL = new BaoxianDataBLL(); var res = baoxianDataBLL.OrderApply(model); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(InsurantInfo model) { StringBuilder strSql = new StringBuilder(); strSql.Append("update InsurantInfo set "); strSql.Append(" OrderApplyID = @OrderApplyID , "); strSql.Append(" CName = @CName , "); strSql.Append(" EName = @EName , "); strSql.Append(" Sex = @Sex , "); strSql.Append(" CardType = @CardType , "); strSql.Append(" CardCode = @CardCode , "); strSql.Append(" Birthday = @Birthday , "); strSql.Append(" RelationID = @RelationID , "); strSql.Append(" Count = @Count , "); strSql.Append(" SinglePrice = @SinglePrice , "); strSql.Append(" CardPeriod = @CardPeriod , "); strSql.Append(" Mobile = @Mobile , "); strSql.Append(" RecordUpdateUserID = @RecordUpdateUserID , "); strSql.Append(" RecordUpdateTime = GetDate(), "); strSql.Append(" Email = @Email "); strSql.Append(" Job = @Job ,"); strSql.Append(" where InsurantInfoID=@InsurantInfoID and RecordUpdateTime = @RecordUpdateTime"); SqlParameter[] parameters = { new SqlParameter("@InsurantInfoID", model.InsurantInfoID), new SqlParameter("@OrderApplyID", model.OrderApplyID), new SqlParameter("@CName", model.CName), new SqlParameter("@EName", model.EName), new SqlParameter("@Sex", model.Sex), new SqlParameter("@CardType", model.CardType), new SqlParameter("@CardCode", model.CardCode), new SqlParameter("@Birthday", model.Birthday), new SqlParameter("@RelationID", model.RelationID), new SqlParameter("@Count", model.Count), new SqlParameter("@SinglePrice", model.SinglePrice), new SqlParameter("@CardPeriod", model.CardPeriod), new SqlParameter("@Mobile", model.Mobile), new SqlParameter("@RecordUpdateUserID", model.RecordUpdateUserID), new SqlParameter("@RecordUpdateTime", model.RecordUpdateTime), new SqlParameter("@Email", model.Email), new SqlParameter("@Job", model.Job) }; int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); if (rows > 0) { return(true); } else { return(false); } }
public void GetInsurantInfotabs(HttpContext context) { int OrderApplyID = 0; if (!string.IsNullOrEmpty(context.Request.QueryString["OrderApplyID"])) { OrderApplyID = Convert.ToInt32(context.Request.QueryString["OrderApplyID"]); } InsurantInfo ort = new InsurantInfo(); InsurantInfoBLL insurantInfobll = new InsurantInfoBLL(); ort = insurantInfobll.GetOrdertModel(OrderApplyID); var b = SerializerHelper.SerializeObject(new { data = ort }); context.Response.Write(b); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(InsurantInfo model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into InsurantInfo("); strSql.Append("OrderApplyID,CName,EName,Sex,CardType,CardCode,Birthday,RelationID,Count,SinglePrice,CardPeriod,Mobile,CreatUserID,RecordUpdateUserID,RecordIsDelete,RecordUpdateTime,RecordCreateTime,Email,Job"); strSql.Append(") values ("); strSql.Append("@OrderApplyID,@CName,@EName,@Sex,@CardType,@CardCode,@Birthday,@RelationID,@Count,@SinglePrice,@CardPeriod,@Mobile,@CreatUserID,@RecordUpdateUserID,@RecordIsDelete,@RecordUpdateTime,@RecordCreateTime,@Email,@Job"); strSql.Append(") "); strSql.Append(";select SCOPE_IDENTITY()"); SqlParameter[] parameters = { new SqlParameter("@OrderApplyID", model.OrderApplyID), new SqlParameter("@CName", model.CName), new SqlParameter("@EName", model.EName), new SqlParameter("@Sex", model.Sex), new SqlParameter("@CardType", model.CardType), new SqlParameter("@CardCode", model.CardCode), new SqlParameter("@Birthday", model.Birthday), new SqlParameter("@RelationID", model.RelationID), new SqlParameter("@Count", model.Count), new SqlParameter("@SinglePrice", model.SinglePrice), new SqlParameter("@CardPeriod", model.CardPeriod), new SqlParameter("@Mobile", model.Mobile), new SqlParameter("@CreatUserID", model.CreatUserID), new SqlParameter("@RecordUpdateUserID", model.RecordUpdateUserID), new SqlParameter("@RecordIsDelete", model.RecordIsDelete), new SqlParameter("@RecordUpdateTime", model.RecordUpdateTime), new SqlParameter("@RecordCreateTime", model.RecordCreateTime), new SqlParameter("@Email", model.Email), new SqlParameter("@Job", model.Job) }; object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters); if (obj == null) { return(0); } else { return(Convert.ToInt32(obj)); } }
/// <summary> /// 得到一个对象实体 /// </summary> public InsurantInfo GetModel(int InsurantInfoID) { StringBuilder strSql = new StringBuilder(); strSql.Append("select InsurantInfoID, OrderApplyID, CName, EName, Sex, CardType, CardCode, Birthday, RelationID, Count, SinglePrice, CardPeriod, Mobile, CreatUserID, RecordUpdateUserID, RecordIsDelete, RecordUpdateTime, RecordCreateTime ,Email ,Job"); strSql.Append(" from InsurantInfo "); strSql.Append(" where InsurantInfoID=@InsurantInfoID"); SqlParameter[] parameters = { new SqlParameter("@InsurantInfoID", SqlDbType.Int, 4) }; parameters[0].Value = InsurantInfoID; InsurantInfo model = new InsurantInfo(); DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["InsurantInfoID"].ToString() != "") { model.InsurantInfoID = int.Parse(ds.Tables[0].Rows[0]["InsurantInfoID"].ToString()); } if (ds.Tables[0].Rows[0]["OrderApplyID"].ToString() != "") { model.OrderApplyID = int.Parse(ds.Tables[0].Rows[0]["OrderApplyID"].ToString()); } model.CName = ds.Tables[0].Rows[0]["CName"].ToString(); model.EName = ds.Tables[0].Rows[0]["EName"].ToString(); if (ds.Tables[0].Rows[0]["Sex"].ToString() != "") { model.Sex = int.Parse(ds.Tables[0].Rows[0]["Sex"].ToString()); } if (ds.Tables[0].Rows[0]["CardType"].ToString() != "") { model.CardType = int.Parse(ds.Tables[0].Rows[0]["CardType"].ToString()); } model.CardCode = ds.Tables[0].Rows[0]["CardCode"].ToString(); model.Birthday = ds.Tables[0].Rows[0]["Birthday"].ToString(); if (ds.Tables[0].Rows[0]["RelationID"].ToString() != "") { model.RelationID = int.Parse(ds.Tables[0].Rows[0]["RelationID"].ToString()); } if (ds.Tables[0].Rows[0]["Count"].ToString() != "") { model.Count = int.Parse(ds.Tables[0].Rows[0]["Count"].ToString()); } if (ds.Tables[0].Rows[0]["SinglePrice"].ToString() != "") { model.SinglePrice = decimal.Parse(ds.Tables[0].Rows[0]["SinglePrice"].ToString()); } model.CardPeriod = ds.Tables[0].Rows[0]["CardPeriod"].ToString(); model.Mobile = ds.Tables[0].Rows[0]["Mobile"].ToString(); if (ds.Tables[0].Rows[0]["CreatUserID"].ToString() != "") { model.CreatUserID = int.Parse(ds.Tables[0].Rows[0]["CreatUserID"].ToString()); } if (ds.Tables[0].Rows[0]["RecordUpdateUserID"].ToString() != "") { model.RecordUpdateUserID = int.Parse(ds.Tables[0].Rows[0]["RecordUpdateUserID"].ToString()); } if (ds.Tables[0].Rows[0]["RecordIsDelete"].ToString() != "") { if ((ds.Tables[0].Rows[0]["RecordIsDelete"].ToString() == "1") || (ds.Tables[0].Rows[0]["RecordIsDelete"].ToString().ToLower() == "true")) { model.RecordIsDelete = true; } else { model.RecordIsDelete = false; } } if (ds.Tables[0].Rows[0]["RecordUpdateTime"].ToString() != "") { model.RecordUpdateTime = DateTime.Parse(ds.Tables[0].Rows[0]["RecordUpdateTime"].ToString()); } if (ds.Tables[0].Rows[0]["RecordCreateTime"].ToString() != "") { model.RecordCreateTime = DateTime.Parse(ds.Tables[0].Rows[0]["RecordCreateTime"].ToString()); } if (ds.Tables[0].Rows[0]["Email"].ToString() != "") { model.Email = ds.Tables[0].Rows[0]["Email"].ToString(); } if (ds.Tables[0].Rows[0]["Job"].ToString() != "") { model.Job = ds.Tables[0].Rows[0]["Job"].ToString(); } return(model); } else { return(null); } }
/// <summary> /// 获得数据列表 /// </summary> public List <InsurantInfo> DataTableToList(DataTable dt) { List <InsurantInfo> modelList = new List <InsurantInfo>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { InsurantInfo model; for (int n = 0; n < rowsCount; n++) { model = new InsurantInfo(); if (dt.Rows[n]["InsurantInfoID"].ToString() != "") { model.InsurantInfoID = int.Parse(dt.Rows[n]["InsurantInfoID"].ToString()); } if (dt.Rows[n]["OrderApplyID"].ToString() != "") { model.OrderApplyID = int.Parse(dt.Rows[n]["OrderApplyID"].ToString()); } model.CName = dt.Rows[n]["CName"].ToString(); model.EName = dt.Rows[n]["EName"].ToString(); if (dt.Rows[n]["Sex"].ToString() != "") { model.Sex = int.Parse(dt.Rows[n]["Sex"].ToString()); } if (dt.Rows[n]["CardType"].ToString() != "") { model.CardType = int.Parse(dt.Rows[n]["CardType"].ToString()); } model.CardCode = dt.Rows[n]["CardCode"].ToString(); model.Birthday = dt.Rows[n]["Birthday"].ToString(); if (dt.Rows[n]["RelationID"].ToString() != "") { model.RelationID = int.Parse(dt.Rows[n]["RelationID"].ToString()); } if (dt.Rows[n]["Count"].ToString() != "") { model.Count = int.Parse(dt.Rows[n]["Count"].ToString()); } if (dt.Rows[n]["SinglePrice"].ToString() != "") { model.SinglePrice = decimal.Parse(dt.Rows[n]["SinglePrice"].ToString()); } model.CardPeriod = dt.Rows[n]["CardPeriod"].ToString(); model.Mobile = dt.Rows[n]["Mobile"].ToString(); if (dt.Rows[n]["CreatUserID"].ToString() != "") { model.CreatUserID = int.Parse(dt.Rows[n]["CreatUserID"].ToString()); } if (dt.Rows[n]["RecordUpdateUserID"].ToString() != "") { model.RecordUpdateUserID = int.Parse(dt.Rows[n]["RecordUpdateUserID"].ToString()); } if (dt.Rows[n]["RecordIsDelete"].ToString() != "") { if ((dt.Rows[n]["RecordIsDelete"].ToString() == "1") || (dt.Rows[n]["RecordIsDelete"].ToString().ToLower() == "true")) { model.RecordIsDelete = true; } else { model.RecordIsDelete = false; } } if (dt.Rows[n]["RecordUpdateTime"].ToString() != "") { model.RecordUpdateTime = DateTime.Parse(dt.Rows[n]["RecordUpdateTime"].ToString()); } if (dt.Rows[n]["RecordCreateTime"].ToString() != "") { model.RecordCreateTime = DateTime.Parse(dt.Rows[n]["RecordCreateTime"].ToString()); } modelList.Add(model); } } return(modelList); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(InsurantInfo model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(InsurantInfo model) { return(dal.Add(model)); }