public async Task <ActionResult> Edit([Bind(Include = "mtypeId,MemType")] MemberType memberType) { if (ModelState.IsValid) { db.Entry(memberType).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(memberType)); }
public async Task <ActionResult> Edit([Bind(Include = "AreaId,Area_Name")] Area area) { if (ModelState.IsValid) { db.Entry(area).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(area)); }
public async Task <ActionResult> Edit([Bind(Include = "orgId,OrgType")] OrganizationType organizationType) { if (ModelState.IsValid) { db.Entry(organizationType).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(organizationType)); }
public async Task <ActionResult> Edit([Bind(Include = "HeaderId,HeaderName,HeaderType")] Header header) { if (ModelState.IsValid) { db.Entry(header).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(header)); }
public async Task <ActionResult> Edit([Bind(Include = "btypeid,btype")] BusinessType businessType) { if (ModelState.IsValid) { db.Entry(businessType).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(businessType)); }
public async Task <ActionResult> Edit([Bind(Include = "BillID,BillDate,memberId,Remarks,paid")] BillRegister billRegister) { if (ModelState.IsValid) { db.Entry(billRegister).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.memberId = new SelectList(db.MemberCompanyInfo, "memberId", "Organization_Name", billRegister.memberId); return(View(billRegister)); }
public async Task <ActionResult> Edit([Bind(Include = "mbillsetupid,HeaderId,Amount")] MonthlyBillSetUP monthlyBillSetUP) { if (ModelState.IsValid) { db.Entry(monthlyBillSetUP).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.HeaderId = new SelectList(db.Headers, "HeaderId", "HeaderName", monthlyBillSetUP.HeaderId); return(View(monthlyBillSetUP)); }
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)); }
public async Task <ActionResult> Edit([Bind(Include = "rid,rDate,memberId,Remarks,billId")] RecieveMaster recieveMaster, FormCollection form) { if (ModelState.IsValid) { string obillid = form["obillid"].ToString(); if (!String.IsNullOrEmpty(obillid)) { string[] obill = obillid.Split(','); foreach (var obi in obill) { int bi = Convert.ToInt32(obi); var billid = db.BillRegisters.Find(bi); if (billid != null) { billid.paid = "N"; db.SaveChanges(); } } } string bllid = form["billId"].ToString(); if (!String.IsNullOrEmpty(bllid)) { string[] oill = bllid.Split(','); foreach (var obi in oill) { int bi = Convert.ToInt32(obi); var billd = db.BillRegisters.Find(bi); if (billd != null) { billd.paid = "Y"; db.SaveChanges(); } } } recieveMaster.billId = bllid.ToString(); db.Entry(recieveMaster).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.memberId = new SelectList(db.MemberCompanyInfo, "memberId", "Organization_Name", recieveMaster.memberId); return(View(recieveMaster)); }