public static Particular.Licensing.License PromptUserForLicense(Particular.Licensing.License currentLicense) { SynchronizationContext synchronizationContext = null; try { synchronizationContext = SynchronizationContext.Current; using (var form = new LicenseExpiredForm()) { form.CurrentLicense = currentLicense; form.ShowDialog(); if (form.ResultingLicenseText == null) { return null; } new RegistryLicenseStore() .StoreLicense(form.ResultingLicenseText); return LicenseDeserializer.Deserialize(form.ResultingLicenseText); } } finally { SynchronizationContext.SetSynchronizationContext(synchronizationContext); } }
public ActionResult DeleteConfirmed(int id) { Particular particular = db.Particulares.Find(id); db.Particulares.Remove(particular); db.SaveChanges(); return(RedirectToAction("Index")); }
//Delete Field Fees public ActionResult DeleteParticular(FM_Fees_Fee model, int ParticularID) { Particular tblParticular = (from e in TOSSDB.Particulars where e.ParticularID == ParticularID select e).FirstOrDefault(); TOSSDB.Particulars.Remove(tblParticular); TOSSDB.SaveChanges(); return(RedirectToAction("Index")); }
//Get Update Field Fees public ActionResult Get_UpdateParticular(FM_Fees_Fee model, int ParticularID) { Particular tblParticular = (from e in TOSSDB.Particulars where e.ParticularID == ParticularID select e).FirstOrDefault(); model.getParticularcolumns.ParticularID = tblParticular.ParticularID; model.NatureOfParticularTempIDCT = tblParticular.NatureofParticularID; model.GeneralAccountTempIDCT = tblParticular.GeneralAccountID; return(PartialView("Particulars/_UpdateParticulars", model)); }
public ActionResult Edit([Bind(Include = "Id,Name,CreatedDate,CreatedBy,UpdatedDate,UpdatedBy,IsActive")] Particular particular) { if (ModelState.IsValid) { db.Entry(particular).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(particular)); }
public JsonResult AddParticular(FM_Fees_Fee model) { Particular tblParticular = new Particular(); tblParticular.NatureofParticularID = model.NatureOfParticularIDCT; tblParticular.GeneralAccountID = model.GeneralAccountIDCT; TOSSDB.Particulars.Add(tblParticular); TOSSDB.SaveChanges(); return(Json(tblParticular)); }
public ActionResult UpdateParticular(FM_Fees_Fee model) { Particular tblParticular = (from e in TOSSDB.Particulars where e.ParticularID == model.getParticularcolumns.ParticularID select e).FirstOrDefault(); tblParticular.NatureofParticularID = model.NatureOfParticularIDCT; tblParticular.GeneralAccountID = model.GeneralAccountIDCT; TOSSDB.Entry(tblParticular); TOSSDB.SaveChanges(); return(PartialView("Particulars/_UpdateParticulars", model)); }
public ActionResult Edit([Bind(Include = "ParticularId,Nome,Bi,Morada,DataNascimento,Cconducao,Email,Tel")] Particular particular) { if (ModelState.IsValid) { db.Entry(particular).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(particular)); }
public ActionResult Edit([Bind(Include = "ID,Esipei,WaterMeter,HouseNumber,ResidentID,Comments")] Particular particular) { if (ModelState.IsValid) { db.Entry(particular).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ResidentID = new SelectList(db.Residents, "ResidentID", "CardNumber", particular.ResidentID); return(View(particular)); }
public ActionResult _Create(Particular particular) { if (ModelState.IsValid) { particular.Id = Guid.NewGuid(); db.Particular.Add(particular); db.SaveChanges(); return(Json(new { success = true })); } return(View(particular)); }
public ActionResult Create(Particular particular) { if (ModelState.IsValid) { particular.Id = Guid.NewGuid(); db.Particular.Add(particular); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(particular)); }
public async Task <ActionResult> CreateParticular(ViewModelParticular model) { if (ModelState.IsValid) { var dados = new Particular { Nome = model.Nome, Bi = model.Bi, Morada = model.Morada, DataNascimento = model.DataNascimento, Cconducao = model.Cconducao, Email = model.Cconducao, Tel = model.Tel }; db.Particulares.Add(dados); db.SaveChanges(); var user = new ApplicationUser { UserName = model.Email, Email = model.Email, Perfil = "Particular", ParticularId = dados.ParticularId }; var adminresult = await UserManager.CreateAsync(user, model.Password); //Add User ao Role if (adminresult.Succeeded) { var result = await UserManager.AddToRoleAsync(user.Id, "Particular"); if (!result.Succeeded) { ModelState.AddModelError("", result.Errors.First()); return(View()); } } else { ModelState.AddModelError("", adminresult.Errors.First()); return(View()); } return(RedirectToAction("Index")); } return(View()); }
// GET: Particulars/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Particular particular = db.Particulares.Find(id); if (particular == null) { return(HttpNotFound()); } return(View(particular)); }
// GET: Particulars/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Particular particular = db.Particulars.Find(id); if (particular == null) { return(HttpNotFound()); } ViewBag.ResidentID = new SelectList(db.Residents, "ResidentID", "CardNumber", particular.ResidentID); return(View(particular)); }
public void AnadirCliente() { if (cantidadClientes < MAX_CLIENTES) { Console.Write(" Cliente particular (1) o de empresa (2): "); string opcion = Console.ReadLine().ToUpper(); Console.Write(" Código: "); string cod = Console.ReadLine(); Console.Write(" Direccion: "); string dir = Console.ReadLine(); Console.Write(" Telefono: "); string tel = Console.ReadLine(); switch (opcion) { case "1": Console.Write(" Nombre: "); string nomP = Console.ReadLine(); Console.Write(" Apellidos: "); string apP = Console.ReadLine(); clientes[cantidadClientes] = new Particular(cod, nomP, apP, dir, tel); break; case "2": Console.Write(" Razón Social: "); string razE = Console.ReadLine(); clientes[cantidadClientes] = new Particular(cod, razE, dir, tel); break; default: Console.WriteLine("Tipo de cliente no encontrado."); break; } cantidadClientes++; } else { Console.WriteLine("Base de datos de clientes llena!"); } }
public async Task <ActionResult> RegisterParticular(ViewModelParticular model) { if (ModelState.IsValid) { var dados = new Particular { Nome = model.Nome, Bi = model.Bi, Morada = model.Morada, DataNascimento = model.DataNascimento, Cconducao = model.Cconducao, Email = model.Cconducao, Tel = model.Tel }; db.Particulares.Add(dados); db.SaveChanges(); var user = new ApplicationUser { UserName = model.Email, Email = model.Email, Perfil = "Particular", ParticularId = dados.ParticularId }; var result = await UserManager.CreateAsync(user, model.Password); if (result.Succeeded) { var code = await UserManager.GenerateEmailConfirmationTokenAsync(user.Id); //var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: Request.Url.Scheme); //await UserManager.SendEmailAsync(user.Id, "Confirm your account", "Please confirm your account by clicking this link: <a href=\"" + callbackUrl + "\">link</a>"); await this.UserManager.AddToRoleAsync(user.Id, "Geral"); return(RedirectToAction("Login")); } AddErrors(result); } // If we got this far, something failed, redisplay form return(View(model)); }
public void AddParticular(ParticularDto particular) { Particular parti = new Particular(); if (particular.Id > 0) { parti = _dbContext.Particulars.Where(_ => _.Id == particular.Id).FirstOrDefault(); parti.ParticularFF = particular.ParticularFF; parti.ParticularSF = particular.ParticularSF; parti.IsExclude = particular.IsExclude; parti.UpdatedDate = DateTime.Now; } else { parti.ParticularFF = particular.ParticularFF; parti.ParticularSF = particular.ParticularSF; parti.IsExclude = particular.IsExclude; parti.CreatedDate = DateTime.Now; parti.UpdatedDate = DateTime.Now; _dbContext.Particulars.Add(parti); } _dbContext.SaveChanges(); }
public FM_Fees_Fee() { getFieldFee = new List <FieldFee>(); getFieldFeecolumns = new FieldFee(); getFieldFeeList = new List <FieldFeeList>(); getFeeCategory = new List <FeeCategory>(); getFeeCategorycolumns = new FeeCategory(); getFeeCategoryList = new List <FeeCategoryList>(); // fieldFeeDDs = new List<FieldFeeDD>(); globalClasses = new GlobalClasses(); getNatureofParticular = new List <NatureOfParticular>(); getNatureofParticularcolumns = new NatureOfParticular(); getNatureofParticularList = new List <NatureofParticularList>(); getParticular = new List <Particular>(); getParticularcolumns = new Particular(); getParticularList = new List <ParticularList>(); }
private void TsbGuardar_Click(object sender, EventArgs e) { if (txtNome.Text != "" && mtxtTelefone.MaskCompleted) { if (radParticulares.Checked) { Particular clientesx = new Particular(); clientesx.Nome = Convert.ToString(txtNome.Text); clientesx.Morada = Convert.ToString(txtMorada.Text); clientesx.Localidade = Convert.ToString(txtLocalide.Text); clientesx.Email = Convert.ToString(txtEmail.Text); clientesx.Telefone = Convert.ToInt32(mtxtTelefone.Text); clientesx.Postal = Convert.ToString(mtxtCP.Text); if (mtxtContribuinte.MaskCompleted) { clientesx.Contribuinte = Convert.ToInt32(mtxtContribuinte.Text); } else { clientesx.Contribuinte = 0; } listaparticular.Add(clientesx); } else if (radEmpresas.Checked) { Empresa clientesx = new Empresa(); clientesx.Nome = Convert.ToString(txtNome.Text); clientesx.Morada = Convert.ToString(txtMorada.Text); clientesx.Localidade = Convert.ToString(txtLocalide.Text); clientesx.Email = Convert.ToString(txtEmail.Text); clientesx.Telefone = Convert.ToInt32(mtxtTelefone.Text); if (mtxtCAE.MaskCompleted) { clientesx.Cae = Convert.ToInt32(mtxtCAE.Text); } else { clientesx.Cae = 0; } if (mtxtContribuinte.MaskCompleted) { clientesx.Contribuinte = Convert.ToInt32(mtxtContribuinte.Text); } else { clientesx.Contribuinte = 0; } clientesx.Postal = Convert.ToString(mtxtCP.Text); listaempresa.Add(clientesx); } } else { MessageBox.Show("Insira pelo menos um nome e um telefone!"); } tsbCancelar.PerformClick(); }