public int EditCustomerRecieptDetails(List <RecPayDetail> rpayDetails, int recpayID) { //code for edit try { foreach (var CU in rpayDetails) { if (recpayID > 0) { RecPayDetail objrpayDetails = Context1.RecPayDetails.Where(item => item.RecPayDetailID == CU.RecPayDetailID).FirstOrDefault(); objrpayDetails.Amount = CU.Amount; objrpayDetails.CurrencyID = CU.CurrencyID; objrpayDetails.InvDate = CU.InvDate; objrpayDetails.InvNo = CU.InvNo; objrpayDetails.InvoiceID = CU.InvoiceID; objrpayDetails.Remarks = CU.Remarks; Context1.Entry(objrpayDetails).State = EntityState.Modified; } Context1.SaveChanges(); } return(1); } catch (Exception) { return(0); } }
public ActionResult ForgotPassword(UserLoginVM vm) { string emailid = vm.UserName; var _user = entity.UserRegistrations.Where(cc => cc.EmailId == emailid).FirstOrDefault(); if (_user != null) { string newpassword = RandomPassword(6); _user.Password = newpassword; entity.Entry(_user).State = EntityState.Modified; entity.SaveChanges(); EmailDAO _emaildao = new EmailDAO(); _emaildao.SendForgotMail(_user.EmailId, "User", newpassword); TempData["SuccessMsg"] = "Reset Password Details are sent,Check Email!"; return(RedirectToAction("Index", "Login")); //return Json(new { status = "ok", message = "Reset Password Details are sent,Check Email" }, JsonRequestBehavior.AllowGet); } else { Session["ForgotStatus"] = "Forgot"; Session["StatusMessage"] = "Invalid EmailId!"; return(RedirectToAction("Index", "Login")); //return Json(new { status = "Failed", message = "Invalid EmailId!" }, JsonRequestBehavior.AllowGet); } }
public ActionResult Edit(Supplier supplier) { if (ModelState.IsValid) { db.Entry(supplier).State = EntityState.Modified; db.SaveChanges(); ViewBag.SuccessMsg = "You have successfully updated Supplier."; return(View("Index", db.Suppliers.ToList())); } return(View(supplier)); }
public ActionResult Edit(UserRegistration userregistration) { if (ModelState.IsValid) { userregistration.EmailId = userregistration.UserName; db.Entry(userregistration).State = EntityState.Modified; db.SaveChanges(); TempData["SuccessMSG"] = "You have successfully updated User."; return(RedirectToAction("Index")); } return(View(userregistration)); }
public int EditAcJDetails(int acjournalId, decimal amount) { using (SHIPPING_FinalEntities Context1 = new SHIPPING_FinalEntities()) { var query = (from t in Context1.AcJournalDetails where t.AcJournalID == acjournalId select t).ToList(); foreach (var itme1 in query) { AcJournalDetail acjD = new AcJournalDetail(); acjD.AcJournalDetailID = itme1.AcJournalDetailID; acjD.AcJournalID = itme1.AcJournalID; acjD.AcHead = itme1.AcHead; acjD.AcHeadID = itme1.AcHeadID; if (itme1.Amount < 0) { acjD.Amount = -(amount); } else { acjD.Amount = (amount); } acjD.BranchID = itme1.BranchID; acjD.ID = itme1.ID; Context1.Entry(itme1).CurrentValues.SetValues(acjD); Context1.SaveChanges(); } return(1); } }
public int EditRecpayDetailsCustR(int recpayid, decimal amount) { using (SHIPPING_FinalEntities Context1 = new SHIPPING_FinalEntities()) { var obj = (from t in Context1.RecPayDetails where t.RecPayID == recpayid && t.InvoiceID == 0 select t).FirstOrDefault(); //var obj = Context1.RecPayDetails.Find(recpayid,0); if (obj != null) { RecPayDetail recpdetail = new RecPayDetail(); recpdetail.RecPayDetailID = obj.RecPayDetailID; recpdetail.Amount = -(amount); // recpdetail.CurrencyID = cueencyid; //recpd.InvDate = item.InvoiceDate.Value; recpdetail.RecPayID = obj.RecPayID; // recpdetail.Remarks = remark; recpdetail.InvoiceID = 0; recpdetail.StatusInvoice = obj.StatusInvoice; recpdetail.InvDate = obj.InvDate; recpdetail.InvNo = obj.InvNo; recpdetail.Lock = false; Context1.Entry(obj).CurrentValues.SetValues(recpdetail); // Context1.Entry(recpdetail).State = EntityState.Modified; Context1.SaveChanges(); return(1); } else { return(0); } } }
public ActionResult Edit(AspNetRole aspnetrole) { if (ModelState.IsValid) { db.Entry(aspnetrole).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(aspnetrole)); }
public ActionResult Edit(RoleMaster rolemaster) { if (ModelState.IsValid) { db.Entry(rolemaster).State = EntityState.Modified; db.SaveChanges(); ViewBag.SuccessMsg = "You have successfully updated Role."; return(View("Index", db.RoleMasters.ToList())); } return(View(rolemaster)); }
public ActionResult Edit(ItemUnit u) { if (ModelState.IsValid) { context.Entry(u).State = EntityState.Modified; context.SaveChanges(); TempData["SuccessMSG"] = "You have successfully updated Unit."; return(RedirectToAction("Index")); } return(View()); }
public ActionResult Edit(ContainerType containertype) { if (ModelState.IsValid) { db.Entry(containertype).State = EntityState.Modified; db.SaveChanges(); ViewBag.SuccessMsg = "You have successfully updated Container Type."; return(View("Index", db.ContainerTypes.ToList())); } return(View(containertype)); }
public ActionResult Edit(CurrencyMaster currencymaster) { if (ModelState.IsValid) { db.Entry(currencymaster).State = EntityState.Modified; db.SaveChanges(); ViewBag.SuccessMsg = "You have successfully updated Currency."; return(View("Index", db.CurrencyMasters.ToList())); } return(View(currencymaster)); }
public ActionResult Edit(Menu menu) { if (ModelState.IsValid) { menu.IsAccountMenu = false; db.Entry(menu).State = EntityState.Modified; db.SaveChanges(); ViewBag.SuccessMsg = "You have successfully updated Menu Creation."; return(View("Index", db.Menus.ToList())); } return(View(menu)); }
public ActionResult Edit(RemarksVM data) { Remark obj = new Remark(); obj.RemarksID = data.RemarksID; obj.Remarks = data.Remarks; db.Entry(obj).State = EntityState.Modified; db.SaveChanges(); TempData["SuccessMsg"] = "You have successfully Updated Remarks."; return(RedirectToAction("Index")); }
public ActionResult Edit(ValidityVM v) { if (ModelState.IsValid) { Validity c = new Validity(); c.ValidityID = v.ValidityID; c.Validity1 = v.Validity; db.Entry(c).State = EntityState.Modified; db.SaveChanges(); TempData["SuccessMsg"] = "You have successfully Upadated Validity."; return(RedirectToAction("Index")); } return(View()); }
public ActionResult Edit(PaymentTermsVM data) { PaymentTerm obj = new PaymentTerm(); obj.PaymentTermID = data.PaymentTermID; obj.PaymentTerm1 = data.PaymentTerm; db.Entry(obj).State = EntityState.Modified; db.SaveChanges(); TempData["SuccessMsg"] = "You have successfully Updated Payment Term."; return(RedirectToAction("Index")); }
public ActionResult Edit(BranchMaster branchmaster) { if (ModelState.IsValid) { db.Entry(branchmaster).State = EntityState.Modified; db.SaveChanges(); TempData["SuccessMsg"] = "You have successfully updated Branch."; return(RedirectToAction("Index")); } ViewBag.Company = new SelectList(db.AcCompanies, "AcCompanyID", "AcCompany1"); ViewBag.CountryID = new SelectList(db.CountryMasters, "CountryID", "CountryName", branchmaster.CountryID); ViewBag.CurrencyID = new SelectList(db.CurrencyMasters, "CurrencyID", "CurrencyName", branchmaster.CurrencyID); ViewBag.DesignationID = new SelectList(db.Designations, "DesignationID", "Designation1", branchmaster.DesignationID); ViewBag.LocationID = new SelectList(db.Locations, "LocationID", "Location1", branchmaster.LocationID); return(View(branchmaster)); }
public int SaveCostUpdation(costUpdationVM CU) { int costupdationId = 0; CostUpdation objcostUpdation = new CostUpdation(); //int i = Context1.SP_InsertCostUpdationAndDetails(CU.SupplierID, CU.JobID, CU.InvoiceNo, CU.InvoiceDate, CU.EmployeeID, // CU.DocumentNo, CU.SupplierPaymentStatus, CU.UserID, SupplierRef, Convert.ToDecimal(amountPaidTillDate)); //Edit Code if (CU.CostUpdationID > 0) { objcostUpdation = Context1.CostUpdations.Where(ite => ite.CostUpdationID == CU.CostUpdationID).FirstOrDefault(); if (objcostUpdation != null) { objcostUpdation.SupplierID = CU.SupplierID; objcostUpdation.JobID = CU.JobID; objcostUpdation.InvoiceNo = CU.InvoiceNo; objcostUpdation.InvoiceDate = CU.InvoiceDate; objcostUpdation.DocumentNo = CU.DocumentNo; objcostUpdation.SupplierPaymentStatus = CU.SupplierPaymentStatus; objcostUpdation.UserID = CU.UserID; objcostUpdation.EmployeeID = CU.EmployeeID; objcostUpdation.CostUpdationID = CU.CostUpdationID; objcostUpdation.AcJournalID = CU.AcJournalID; objcostUpdation.TransactionDate = CU.TransactionDate; objcostUpdation.InvoiceAmount = CU.InvoiceAmount; Context1.Entry(objcostUpdation).State = EntityState.Modified; Context1.SaveChanges(); costupdationId = objcostUpdation.CostUpdationID; } } else { // foreach (var item in CU.MultiJobID) // { // CU.InvoiceNo = GetInvoiceNoByJobID(0); objcostUpdation = new CostUpdation(); var costupdations = Context1.CostUpdations; var maxValue = 0; int MaxcostupdationID = 0; if (costupdations.Count() > 0) { maxValue = Context1.CostUpdations.Max(x => x.CostUpdationID); MaxcostupdationID = Context1.CostUpdations.First(x => x.CostUpdationID == maxValue).CostUpdationID; } if (Convert.ToInt32(MaxcostupdationID) <= 0) { MaxcostupdationID = 1; } else { MaxcostupdationID = (MaxcostupdationID) + 1; } // int MaxcostupdationID = 33831; objcostUpdation.CostUpdationID = MaxcostupdationID; objcostUpdation.SupplierID = CU.SupplierID; objcostUpdation.JobID = 0; objcostUpdation.InvoiceNo = CU.InvoiceNo; objcostUpdation.InvoiceDate = CU.InvoiceDate; objcostUpdation.DocumentNo = CU.DocumentNo; objcostUpdation.SupplierPaymentStatus = CU.SupplierPaymentStatus; objcostUpdation.UserID = CU.UserID; objcostUpdation.EmployeeID = CU.EmployeeID; // objcostUpdation.AcJournalID = CU.AcJournalID; objcostUpdation.PrevCostupID = CU.PrevCostupID; objcostUpdation.TransactionDate = CU.TransactionDate; objcostUpdation.InvoiceAmount = CU.InvoiceAmount; //Updation Jinvoice Entry //todo: sethu. move this to cost detail insert /* var joinvoice = Context1.JInvoices.Where(ite => ite.JobID == item && ite.SupplierID == CU.SupplierID).ToList(); * foreach (var objjoince in joinvoice) * { * objjoince.CostUpdationStatus = "2"; * }*/ // 5000,1,1,'','2016-1-1',1,1,'','',1,0 Context1.SP_InsertCostUpdation(objcostUpdation.CostUpdationID, objcostUpdation.SupplierID.Value, objcostUpdation.JobID.Value, objcostUpdation.InvoiceNo, objcostUpdation.InvoiceDate, 0, objcostUpdation.EmployeeID.Value, objcostUpdation.DocumentNo, objcostUpdation.PrevCostupID, objcostUpdation.SupplierPaymentStatus, objcostUpdation.UserID.Value, false, objcostUpdation.TransactionDate, objcostUpdation.InvoiceAmount); // Context1.CostUpdations.Add(objcostUpdation); Context1.SaveChanges(); costupdationId = objcostUpdation.CostUpdationID; // } } return(costupdationId); }