public ActionResult View(int id) { CredentialService objAppointService = new CredentialService(); CredentialItem objAItem = new CredentialItem(); objAItem = objAppointService.GetById(id); //Session["Empid"] = objPassItem.EmpId; List <CredentialItem> lstAppoint = new List <CredentialItem>(); objAItem.ListCredential = new List <CredentialItem>(); objAItem.ListCredential.AddRange(lstAppoint); ViewBag.Menuid = Request.QueryString["menuId"]; SponsorService objService1 = new SponsorService(); List <CompanyItem> lstCompany = new List <CompanyItem>(); lstCompany = objService1.GetCompany(); objAItem.ListCompany = new List <CompanyItem>(); objAItem.ListCompany.AddRange(lstCompany); VehicleMasterService objVehicle = new VehicleMasterService(); #region Bind DropDown Branch List <BranchItem> lstBranch = new List <BranchItem>(); lstBranch = objVehicle.GetBranch(); objAItem.ListBranch = new List <BranchItem>(); objAItem.ListBranch.AddRange(lstBranch); #endregion return(View(objAItem)); }
public CredentialItem GetById(int id) { Mapper.CreateMap <CredentialMaster, CredentialItem>(); CredentialMaster objAppoint = DbContext.CredentialMasters.SingleOrDefault(m => m.CrID == id); CredentialItem objAppointItem = Mapper.Map <CredentialItem>(objAppoint); return(objAppointItem); }
public int Update(CredentialItem model) { Mapper.CreateMap <CredentialItem, CredentialMaster>(); CredentialMaster objAppoint = DbContext.CredentialMasters.SingleOrDefault(m => m.CrID == model.CrID); objAppoint = Mapper.Map(model, objAppoint); return(DbContext.SaveChanges()); }
public ActionResult Edit(CredentialItem model) { // int Empid = Convert.ToInt32(Url.RequestContext.RouteData.Values["id"].ToString()); //model.EmpID = Empid; CredentialService objAppoint = new CredentialService(); objAppoint.Update(model); return(RedirectToAction("Create", new { @menuId = model.Viewbagidformenu })); }
public IActionResult ConfirmSelection(int credentialID) { List <SelectionConfirmationItem> selectionConfirmationItems = selectionService.GetSelectionConfirmationItems(credentialID); ViewBag.CandidateSelections = selectionConfirmationItems; CredentialItem credentialItem = credentialService.GetCredential(credentialID); return(View("ConfirmSelection", credentialItem)); }
public int Insert(CredentialItem model) { try { Mapper.CreateMap <CredentialItem, CredentialMaster>(); CredentialMaster objAppoint = Mapper.Map <CredentialMaster>(model); DbContext.CredentialMasters.Add(objAppoint); return(DbContext.SaveChanges()); } catch (Exception ex) { throw; } }
public ActionResult Create(CredentialItem model) { CredentialService objService = new CredentialService(); int cid = 0; if (Session["CompID"] != null) { cid = Convert.ToInt32(Session["CompID"].ToString()); } if (model.CompID == null) { model.CompID = cid; } objService.Insert(model); return(RedirectToAction("Create", new { @menuId = model.Viewbagidformenu })); }
/// <summary> /// Initializes a new instance of the LoginViewModel class. /// </summary> public LoginViewModel(ValidatorFactory validator) { _CredentialItem = new CredentialItem(); Remember = Properties.Settings.Default.UserCredentialRemember; UserPrincipalName = Properties.Settings.Default.UserCredentialUserName; string pass = Properties.Settings.Default.UserCredentialUserNamePassword; if (!string.IsNullOrEmpty(pass)) { byte[] passwordBytes = Encoding.ASCII.GetBytes(KeyVector); UserPassword = AES.Decrypt(pass, passwordBytes); } _CredentialItem.Validator = validator.GetValidator <CredentialItem>(); }
public ActionResult delete(int id, int menuid) { try { //int Empid = Convert.ToInt32(Url.RequestContext.RouteData.Values["id"].ToString()); CredentialService objService = new CredentialService(); CredentialItem objDoc = new CredentialItem(); objDoc = objService.GetById(id); db.CredentialMasters.Remove(db.CredentialMasters.Find(id)); db.SaveChanges(); //ViewBag.Empid = Empid; ViewBag.Menuid = Request.QueryString["menuId"]; } catch (Exception ex) { //ViewBag.ErrorMsg = "First Delete This Tenancy No's All Documents. "; return(View("Error")); } return(RedirectToAction("Create", new { @id = id, @menuId = Request.QueryString["menuId"] })); }
public ActionResult Create() { List <CredentialItem> lst = new List <CredentialItem>(); CredentialService objService = new CredentialService(); int cid = 0; if (Session["CompID"] != null) { cid = Convert.ToInt32(Session["CompID"].ToString()); } lst = objService.getCredentialData(cid); CredentialItem objModel = new CredentialItem(); objModel.ListCredential = new List <CredentialItem>(); objModel.ListCredential.AddRange(lst); ViewBag.Menuid = Request.QueryString["menuId"]; SponsorService objService1 = new SponsorService(); List <CompanyItem> lstCompany = new List <CompanyItem>(); lstCompany = objService1.GetCompany(); objModel.ListCompany = new List <CompanyItem>(); objModel.ListCompany.AddRange(lstCompany); VehicleMasterService objVehicle = new VehicleMasterService(); #region Bind DropDown Branch List <BranchItem> lstBranch = new List <BranchItem>(); lstBranch = objVehicle.GetBranch(); objModel.ListBranch = new List <BranchItem>(); objModel.ListBranch.AddRange(lstBranch); #endregion return(View(objModel)); }
public CredentialsDialog(URIish uri, IEnumerable <CredentialItem> credentials) { this.Build(); labelTop.Text = string.Format(labelTop.Text, uri.ToString()); Gtk.Table table = new Gtk.Table(0, 0, false); table.ColumnSpacing = 6; vbox.PackStart(table, true, true, 0); uint r = 0; Widget firstEditor = null; foreach (CredentialItem c in credentials) { Label lab = new Label(c.GetPromptText() + ":"); lab.Xalign = 0; table.Attach(lab, 0, 1, r, r + 1); Table.TableChild tc = (Table.TableChild)table [lab]; tc.XOptions = AttachOptions.Shrink; Widget editor = null; if (c is CredentialItem.YesNoType) { CredentialItem.YesNoType cred = (CredentialItem.YesNoType)c; if (credentials.Count(i => i is CredentialItem.YesNoType) == 1) { singleYesNoCred = cred; buttonOk.Hide(); buttonYes.Show(); buttonNo.Show(); // Remove the last colon lab.Text = lab.Text.Substring(0, lab.Text.Length - 1); } else { CheckButton btn = new CheckButton(); editor = btn; btn.Toggled += delegate { cred.SetValue(btn.Active); }; } } else if (c is CredentialItem.StringType || c is CredentialItem.CharArrayType) { CredentialItem cred = c; Entry e = new Entry(); editor = e; e.ActivatesDefault = true; if (cred.IsValueSecure()) { e.Visibility = false; } e.Changed += delegate { if (cred is CredentialItem.StringType) { ((CredentialItem.StringType)cred).SetValue(e.Text); } else { ((CredentialItem.CharArrayType)cred).SetValue(e.Text.ToCharArray()); } }; if (c is CredentialItem.Username) { e.Text = uri.GetUser() ?? ""; } } if (editor != null) { table.Attach(editor, 1, 2, r, r + 1); tc = (Table.TableChild)table [lab]; tc.XOptions = AttachOptions.Fill; if (firstEditor == null) { firstEditor = editor; } } r++; } table.ShowAll(); Focus = firstEditor; Default = buttonOk; }