private static PropArchiveRelation GetPropArchiveRelation(ArchiveIndex archiveIndex, Certificate certificate) { PropArchiveRelation propArchiveRelation = new PropArchiveRelation(); propArchiveRelation.RelationID = CreateGuid(32); propArchiveRelation.ArchiveId = archiveIndex.ArchiveId; propArchiveRelation.CertificateID = certificate.CertificateID; return(propArchiveRelation); }
private static int Insert_PropArchiveRelation(PropArchiveRelation propArchiveRelation, DbTransaction trans) { string sql = "insert into PropArchiveRelation(RelationID,ArchiveId,CertificateID) " + "values(@RelationID,@ArchiveId,@CertificateID)"; List <DbParameter> list = new List <DbParameter>(); ListAdd(list, "@RelationID", propArchiveRelation.RelationID); ListAdd(list, "@ArchiveId", propArchiveRelation.ArchiveId); ListAdd(list, "@CertificateID", propArchiveRelation.CertificateID); DbHelper.SetProvider(MyDBType.Sql); return(DbHelper.ExecuteNonQuery(MyDBType.Sql, trans, System.Data.CommandType.Text, sql, list.ToArray())); }
private static List <PropArchiveRelation> CreatePropArchList(FCDA da) { if (null != da.CerList && da.CerList.Count > 0 && null != da.archiveInfo) { List <PropArchiveRelation> list = new List <PropArchiveRelation>(); foreach (Certificate cer in da.CerList) { PropArchiveRelation cr = new PropArchiveRelation(); cr.RelationID = CreateGuid(32); cr.ArchiveId = da.archiveInfo.ArchiveId; cr.CertificateID = cer.CertificateID; list.Add(cr); } return(list); } return(null); }
public static void Insert(ArchiveIndex archiveIndex, List <VolEleArc> volEleArc, HouseInfo houseInfo, List <Person> persons, Certificate certificate, HouseArchiveRelation houseArchiveRelation, PropArchiveRelation propArchiveRelation, List <VolEleArcDtl> volEleArcDtl) { using (TransactionScope ts = new TransactionScope()) { Insert_ArchiveIndex(archiveIndex); foreach (VolEleArc item in volEleArc) { Insert_VolEleArc(item); } Insert_HouseInfo(houseInfo); foreach (Person person in persons) { Insert_Person(person); } Insert_Certificate(certificate); Insert_HouseArchiveRelation(houseArchiveRelation); Insert_PropArchiveRelation(propArchiveRelation); if (null != volEleArcDtl) { foreach (VolEleArcDtl v in volEleArcDtl) { Insert_VolEleArcDtl(v); } } //trans.Commit(); ts.Complete(); } }
/// <summary> /// 插入产权处档案库 /// </summary> /// <param name="pageParams"></param> /// <returns>1:插入成功;0:宗地业务;异常信息:失败</returns> public static BDCFilterResult Insert_FCDA(PageParams pageParams) { BDCFilterResult res = new BDCFilterResult(); try { if (IsFW(pageParams.PrjId)) { if (CanPush(pageParams.PrjId)) { ArchiveIndex archiveIndex = GetArchiveIndex(pageParams); HouseInfo houseInfo = GetHouseInfo(pageParams); Certificate certificate = GetCertificate(archiveIndex, houseInfo, pageParams); List <Person> person_list = GetPerson(archiveIndex, pageParams); List <VolEleArc> volEleArc = GetVolEleArc(archiveIndex, pageParams); //List<VolEleArcDtl> volEleArcDtl_list = GetVolEleArcDtl(volEleArc, pageParams); PropArchiveRelation propArchiveRelation = GetPropArchiveRelation(archiveIndex, certificate); HouseArchiveRelation houseArchiveRelation = GetHouseArchiveRelation(archiveIndex, houseInfo); FCDA_DAL.Insert(archiveIndex, volEleArc, houseInfo, person_list, certificate, houseArchiveRelation, propArchiveRelation, null); res.ConfirmType = 0; res.IsSuccess = true; res.Message = "成功!业务已经成功推送!"; } else { res.ConfirmType = 0; res.IsSuccess = false; res.Message = "失败!该业务已经推送!"; } } else { res.ConfirmType = 0; res.IsSuccess = false; res.Message = "拒绝!未找到业务宗号或非房产业务,暂不推送"; } } catch (Exception ex) { res.ConfirmType = 0; res.IsSuccess = false; res.Message = "失败!" + ex.Message; } FC_DA_TAG tag = new FC_DA_TAG(); tag.ID = Guid.NewGuid().ToString(); tag.ISSUCCESS = res.IsSuccess?"1":"0"; tag.MESSAGE = res.Message; tag.PUSHDATE = DateTime.Now; tag.PUSHUSER = pageParams.UserName; tag.SLBH = pageParams.PrjId; InsertLog(tag); return(res); }