public async Task <IActionResult> Edit(int id, [Bind("id,IntroducerName,IntroducerLegalName,DateTimeModified,DateTimeAdded")] Introducer introducer) { if (id != introducer.id) { return(NotFound()); } if (ModelState.IsValid) { try { introducer.DateTimeModified = Utility.GetLocalDateTime(); _context.Update(introducer); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!IntroducerExists(introducer.id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(introducer)); }
public void SaveIntroducers <T>(ICollection <Introducer> collaterals, string auditId) where T : class, new() { Type type = typeof(T); if (type.Equals(typeof(IntroducerAudit))) { IntroducerAuditDAL IntroducerDAL = new IntroducerAuditDAL(); foreach (var model in collaterals) { #region 介绍人信息 IntroducerAudit IntroducerModel = new IntroducerAudit() { ID = Guid.NewGuid().ToString(), AuditID = auditId, Name = model.Name, Contract = model.Contract, RebateAmmount = model.RebateAmmount, RebateRate = model.RebateRate, Account = model.Account, AccountBank = model.AccountBank, Sequence = model.Sequence }; #endregion 介绍人信息 IntroducerDAL.Add(IntroducerModel); //保存介绍人信息 } } else if (type.Equals(typeof(Introducer))) { IntroducerDAL IntroducerDAL = new IntroducerDAL(); foreach (var model in collaterals) { #region 介绍人信息 Introducer IntroducerModel = new Introducer() { ID = Guid.NewGuid().ToString(), Name = model.Name, Contract = model.Contract, RebateAmmount = model.RebateAmmount, RebateRate = model.RebateRate, Account = model.Account, AccountBank = model.AccountBank, CaseID = auditId, Sequence = model.Sequence }; #endregion 介绍人信息 IntroducerDAL.Add(IntroducerModel); //保存介绍人信息 } } }
public async Task <IActionResult> Create([Bind("id,IntroducerName,IntroducerLegalName,DateTimeModified,DateTimeAdded")] Introducer introducer) { if (ModelState.IsValid) { introducer.DateTimeModified = Utility.GetLocalDateTime(); introducer.DateTimeAdded = Utility.GetLocalDateTime(); _context.Add(introducer); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(introducer)); }
// Start is called before the first frame update void Start() { MatchMaker man = new Man(35, 100000, 99999, 0); MatchMaker woman = new Women(26, 5000, 1000, 0); //man.GetInformation(woman); //woman.GetInformation(man); //Debug.Log("1"); Introducer introducer = new Introducer(man, woman); //introducer.GetManInformation(); //introducer.GetWomanInformation(); man.GetInormationFromIntroducer(introducer); woman.GetInormationFromIntroducer(introducer); Debug.Log($"男方对女方好感度:{man.m_favor} 女方对男方好感度:{woman.m_favor}"); }
public async Task <ActionResult> Edit([Bind(Include = "memberId,membershipDate,Organization_Name,Organization_Address,Phone,Trade_License,Tin_Number,AreaId,btypeid,orgId,mtypeId,InCorporationDate,isVoter,status,Applicant_Name,Designation,Father_Name,Mother_Name,Present_address,Permanent_Address,National_Id,Mobile_No,Tin_No,disid,mid")] MemberCompanyInfo memberCompanyInfo, HttpPostedFileBase file, FormCollection frm) { if (ModelState.IsValid) { db.Entry(memberCompanyInfo).State = EntityState.Modified; await db.SaveChangesAsync(); if (file != null) { string pic = System.IO.Path.GetFileName(file.FileName); string path = System.IO.Path.Combine( Server.MapPath("~/MemberImg/"), memberCompanyInfo.mid.ToString() + ".jpg"); //memberCompanyInfo.photo_path = path; // file is uploaded file.SaveAs(path); // save the image path path to the database or you can send image // directly to database // in-case if you want to store byte[] ie. for DB } string int_mid = frm["int_mid"].ToString(); if (!string.IsNullOrEmpty(int_mid)) { var intr_id = db.Introducer.Where(s => s.REFID == memberCompanyInfo.mid).Count(); if (intr_id == 0) { Introducer intd = new Introducer(); intd.REFID = memberCompanyInfo.mid; intd.MEMBERID = int_mid; db.Introducer.Add(intd); db.SaveChanges(); } } return(RedirectToAction("Index")); } if (!ModelState.IsValid) { var modelStateErrors = this.ModelState.Keys.SelectMany(key => this.ModelState[key].Errors); //Response.Write(errors.ToString()); // Breakpoint, Log or examine the list with Exceptions. } ViewBag.AreaId = new SelectList(db.Area, "AreaId", "Area_Name", memberCompanyInfo.AreaId); ViewBag.btypeid = new SelectList(db.BusinessType, "btypeid", "btype", memberCompanyInfo.btypeid); ViewBag.orgId = new SelectList(db.OrganizationTypes, "orgId", "OrgType", memberCompanyInfo.orgId); ViewBag.mtypeId = new SelectList(db.MemberTypes, "mtypeId", "MemType", memberCompanyInfo.mtypeId); ViewBag.disid = new SelectList(db.Districts, "disid", "District_Name", "disid", memberCompanyInfo.disid); return(View(memberCompanyInfo)); }
/// <summary> /// 根据参数ID获取所有引导词列表 /// </summary> /// <param name="PramasId">参数ID</param> /// <returns>引导词列表</returns> public List <Introducer> Get_IntroducerList(int PramasId) { string sql = "select * from tb_Introducer where PramasId=@PramasId"; List <Introducer> IntroducerList = null; using (SqlDataReader sdr = SqlHelper.ExecuteReader(sql, new SqlParameter("@PramasId", PramasId))) { if (sdr.HasRows) { IntroducerList = new List <Introducer>(); while (sdr.Read()) { Introducer introducer = new Introducer(); introducer.IntroducerId = sdr.GetInt32(0); introducer.IntroducerText = sdr.GetString(1); introducer.PramasId = sdr.GetInt32(2); IntroducerList.Add(introducer); } } } return(IntroducerList); }
public async Task <ActionResult> Create([Bind(Include = "mid,memberId,membershipDate,Organization_Name,Organization_Address,Phone,Trade_License,Tin_Number,AreaId,btypeid,orgId,mtypeId,InCorporationDate,isVoter,status,Applicant_Name,Designation,Father_Name,Mother_Name,Present_address,Permanent_Address,National_Id,Mobile_No,Tin_No")] MemberCompanyInfo memberCompanyInfo, HttpPostedFileBase file, FormCollection frm) { if (ModelState.IsValid) { db.MemberCompanyInfo.Add(memberCompanyInfo); await db.SaveChangesAsync(); if (file != null) { string pic = System.IO.Path.GetFileName(file.FileName); string path = System.IO.Path.Combine( Server.MapPath("~/MemberImg/"), memberCompanyInfo.mid.ToString() + ".jpg"); //memberCompanyInfo.photo_path = path; // file is uploaded file.SaveAs(path); // save the image path path to the database or you can send image // directly to database // in-case if you want to store byte[] ie. for DB } string int_mid = frm["int_mid"].ToString(); if (!string.IsNullOrEmpty(int_mid)) { Introducer intd = new Introducer(); intd.REFID = memberCompanyInfo.mid; intd.MEMBERID = int_mid; db.Introducer.Add(intd); db.SaveChanges(); } //return RedirectToAction("Index"); } ViewBag.AreaId = new SelectList(db.Area, "AreaId", "Area_Name", memberCompanyInfo.AreaId); ViewBag.btypeid = new SelectList(db.BusinessType, "btypeid", "btype", memberCompanyInfo.btypeid); return(View(memberCompanyInfo)); }
public override void GetInormationFromIntroducer(Introducer introducer) { introducer.GetManInformation(); }
public abstract void GetInormationFromIntroducer(Introducer introducer);
public override byte[] Print() { return(Introducer.GetBytes().Concatenate(GetExtensionData(), Terminator.GetBytes())); }