Beispiel #1
0
        public async Task <IActionResult> Edit(int id, [Bind("DesignationId,EmployeeTypeId,DesignationName")] Designations designations)
        {
            if (id != designations.DesignationId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(designations);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DesignationsExists(designations.DesignationId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EmployeeTypeId"] = new SelectList(_context.EmployeeType, "TypeId", "TypeId", designations.EmployeeTypeId);
            return(View(designations));
        }
        public async Task <IActionResult> Edit(int id, [Bind("DesignationId,DesignationName,DesignationDetails,IsActive")] Designations designations)
        {
            if (id != designations.DesignationId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(designations);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DesignationsExists(designations.DesignationId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(designations));
        }
 public string GetDesignation(int Id)
 {
     using (EmployeeContext employeeContext = new EmployeeContext())
     {
         Designations designations = employeeContext.EmployeeDesignations.Find(Id);
         return(designations.DesignationName);
     }
 }
        public ActionResult DeleteConfirmed(int id)
        {
            Designations designations = db.Designations.Find(id);

            db.Designations.Remove(designations);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #5
0
 public static void Add(Designations d)
 {
     using (var db = new LibraryDBEntities())
     {
         db.Designations.Add(d);
         db.SaveChanges();
     }
 }
Beispiel #6
0
 public Summary(string name, Designations designation, DevSkills dskill, Techskills tskill)
 {
     Id               = Id + 1;
     this.Name        = name;
     this.Designation = designation;
     this.Dskill      = new DevSkills(dskill.CodingSkills, dskill.QualityAssurance, dskill.TimeLogging, dskill.TroubleShootingSkills);
     this.Tskill      = new Techskills(tskill.AngularJS, tskill.ASPDotNETCORE, tskill.CSharp, tskill.GIT, tskill.Ruby, tskill.TFS);
 }
Beispiel #7
0
 public static void Update(Designations d)
 {
     using (var db = new LibraryDBEntities())
     {
         db.Entry(d).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
     }
 }
Beispiel #8
0
 public bool IsDesignation(Voxel reference)
 {
     if (reference == null)
     {
         return(false);
     }
     return(Designations.Any(put => (put.Location.Position - reference.Position).LengthSquared() < 0.1));
 }
Beispiel #9
0
        public void RemoveDesignation(CraftDesignation des)
        {
            Designations.Remove(des);

            if (des.WorkPile != null)
            {
                des.WorkPile.Die();
            }
        }
 public ActionResult Edit([Bind(Include = "id,Title,created_at,edited_at")] Designations designations)
 {
     if (ModelState.IsValid)
     {
         db.Entry(designations).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(designations));
 }
 public ActionResult Edit(Designations designations)
 {
     if (ModelState.IsValid)
     {
         db.Entry(designations).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(designations));
 }
 //Method to delete employee designation
 public void DeleteDesignations(int designationId)
 {
     using (EmployeeContext employeeContext = new EmployeeContext())
     {
         Designations designations = GetEmployeeById(designationId);
         SqlParameter sql          = new SqlParameter("@DesignationId", designations.DesignationId);
         employeeContext.Database.ExecuteSqlCommand("Designations_Delete @DesignationId", sql);
         //employeeContext.Entry(designations).State = EntityState.Deleted;
         //employeeContext.SaveChanges();
     }
 }
 //Method to add employee designation
 public bool AddDesignations(Designations designations)
 {
     using (EmployeeContext employeeContext = new EmployeeContext())
     {
         SqlParameter sql   = new SqlParameter("@DesignationName", designations.DesignationName);
         int          count = employeeContext.Database.ExecuteSqlCommand("Designations_Insert @DesignationName", sql);
         //employeeContext.Entry(designations).State = EntityState.Added;
         //employeeContext.SaveChanges();
     }
     return(true);
 }
        public ActionResult Create(Designations designations)
        {
            if (ModelState.IsValid)
            {
                db.designations.Add(designations);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View());
        }
        public ActionResult Create([Bind(Include = "id,Title,created_at,edited_at")] Designations designations)
        {
            if (ModelState.IsValid)
            {
                db.Designations.Add(designations);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(designations));
        }
        public async Task <IActionResult> Create([Bind("DesignationId,DesignationName,DesignationDetails,IsActive")] Designations designations)
        {
            if (ModelState.IsValid)
            {
                _context.Add(designations);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(designations));
        }
Beispiel #17
0
        public async Task <IActionResult> Create([Bind("DesignationId,EmployeeTypeId,DesignationName")] Designations designations)
        {
            if (ModelState.IsValid)
            {
                _context.Add(designations);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EmployeeTypeId"] = new SelectList(_context.EmployeeType, "TypeId", "TypeId", designations.EmployeeTypeId);
            return(View(designations));
        }
Beispiel #18
0
 public bool SetDesignation(Designations designations)
 {
     try
     {
         bool status = ControlPanelWriteHelper.SetDesignations(designations);
         return(status);
     }
     catch (Exception ex)
     {
         EventLogger.LogEvent(SysEventType.ERROR.ToString(), "Error", "SetDesignation failed with exception", ex);
         throw;
     }
 }
        // GET: Designations/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Designations designations = db.Designations.Find(id);

            if (designations == null)
            {
                return(HttpNotFound());
            }
            return(View(designations));
        }
Beispiel #20
0
        public IndividualItem(ConsolidatedList consolidated, XElement xelem) : this()
        {
            if (consolidated != null)
            {
                ConsolidatedList = consolidated;
                ConsListId       = consolidated.Id;
            }
            ;
            if (xelem != null && xelem.Name.LocalName == "INDIVIDUAL")
            {
                FillCommonInfo(xelem);

                SecondName  = xelem.Element(S("SECOND_NAME"))?.Value;
                ThirdName   = xelem.Element(S("THIRD_NAME"))?.Value;
                FourthName  = xelem.Element(S("FOURTH_NAME"))?.Value;
                Gender      = xelem.Element(S("GENDER"))?.Value;
                Nationality = xelem.Element(S("NATIONALITY2"))?.Value;
                SubmittedBy = xelem.Element(S("SUBMITTED_BY"))?.Value;


                Aliases   = xelem.Elements(S("INDIVIDUAL_ALIAS")).Select(s => new IndividualAlias(this, s)).Where(w => w.IsCorrect()).ToList();
                DOBs      = xelem.Elements(S("INDIVIDUAL_DATE_OF_BIRTH")).Select(s => new IndividualDOB(this, s)).Where(w => w != null && w.IsCorrect()).ToList();
                POBs      = xelem.Elements(S("INDIVIDUAL_PLACE_OF_BIRTH")).Select(s => new IndividualPOB(this, s)).Where(w => w != null && w.IsCorrect()).ToList();
                Docs      = xelem.Elements(S("INDIVIDUAL_DOCUMENT")).Select(s => new IndividualDoc(this, s)).Where(w => w != null && w.IsCorrect()).ToList();
                Addresses = xelem.Elements(S("INDIVIDUAL_ADDRESS")).Select(s => new Address(this, s)).Where(w => w != null && w.IsCorrect()).ToList();


                var titles        = xelem.Element(S("TITLE"));
                var designations  = xelem.Element(S("DESIGNATION"));
                var nationalities = xelem.Element(S("NATIONALITY"));

                if (titles != null)
                {
                    Titles.AddRange(titles.Elements().Select(s => new Title(this, s)).Where(w => w != null).ToList());
                }
                if (designations != null)
                {
                    Designations.AddRange(designations.Elements().Select(s => new Designation(this, s)).Where(w => w != null).ToList());
                }
                if (nationalities != null)
                {
                    Nationalities.AddRange(nationalities.Elements().Select(s => new Nationality(this, s)).Where(w => w != null).ToList());
                }


                FillLastDayUpdates(xelem.Element(S("LAST_DAY_UPDATED")));
            }
            ;
        }
        public ActionResult AddDesignations(DesignationViewModel designationViewModel)
        {
            Designations designations = new Designations();

            if (ModelState.IsValid)
            {
                designations.DesignationName = designationViewModel.DesignationName;
                designationBL.AddDesignation(designations);
                return(RedirectToAction("DisplayDesignations"));
            }
            else
            {
                return(View());
            }
        }
        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (txtDesignation.Text.Trim().Length == 0)
            {
                MessageBox.Show("Lütfen Designation ismini giriniz!", "Library Management System", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            Designations d = new Designations();

            d.Name = txtDesignation.Text;

            DesignationsHelper.Add(d);
            MessageBox.Show("Designation ekleme başarılı", "Library Management System", MessageBoxButtons.OK, MessageBoxIcon.Information);
            FillGrid();
        }
Beispiel #23
0
        protected void lnkSaveDesignation_Click(object sender, EventArgs e)
        {
            var designations = new Designations();

            foreach (GridViewRow gvRow in GridViewTable.Rows)
            {
                designations.Add(new Designation
                {
                    Id          = ((TextBox)gvRow.FindControl("txtCode")).Text,
                    Description = ((TextBox)gvRow.FindControl("txtDescription")).Text,
                    Level       = ((TextBox)gvRow.FindControl("txtAccess")).Text,
                    Action      = (string.IsNullOrEmpty((((HiddenField)gvRow.FindControl("hdnAction")).Value)) ?
                                   Constants.UpdateAction : ((HiddenField)gvRow.FindControl("hdnAction")).Value),
                    SlNo        = ((HiddenField)gvRow.FindControl("hdnSno")).Value,
                    CreatedDate = Dates.ToDateTime(((HiddenField)gvRow.FindControl("hidCreatedDate")).Value, DateFormat.Format_05)
                });
            }
            var firstOrDefault = designations.FirstOrDefault();

            if (firstOrDefault != null)
            {
                firstOrDefault.DataBaseInfo = UserContext.DataBaseInfo;
            }

            if (_controlPanel.SetDesignation(designations))
            {
                CustomMessageControl.MessageBodyText = GlobalCustomResource.DesignationSaved;
                CustomMessageControl.MessageType     = MessageTypes.Success;
                CustomMessageControl.ShowMessage();
                AuditLog.LogEvent(UserContext, SysEventType.INFO, "DESIGNATION SAVED",
                                  GlobalCustomResource.DesignationSaved, true);
                lnkAddNew.Enabled = true;
                lnkAddNew.Style.Add("cursor", "Pointer");
                BindData(BindType.List);
            }
            else
            {
                CustomMessageControl.MessageBodyText = GlobalCustomResource.DesignationFailed;
                CustomMessageControl.MessageType     = MessageTypes.Error;
                CustomMessageControl.ShowMessage();
                AuditLog.LogEvent(UserContext, SysEventType.INFO, "DESIGNATION UPDATE FAILED",
                                  GlobalCustomResource.DesignationFailed, true);
            }
        }
Beispiel #24
0
        protected void lnkAddNew_Click(object sender, EventArgs e)
        {
            var designations = new Designations();

            lnkAddNew.Enabled = false;
            lnkAddNew.Style.Add("cursor", "Not-allowed");
            designations.AddRange(from GridViewRow gvRow in GridViewTable.Rows
                                  select new Designation
            {
                Id          = ((TextBox)gvRow.FindControl("txtCode")).Text,
                Description = ((TextBox)gvRow.FindControl("txtDescription")).Text,
                Level       = ((TextBox)gvRow.FindControl("txtAccess")).Text,
                Action      = Constants.UpdateAction
            });
            designations.Add(new Designation
            {
                Action = Constants.InsertAction
            });
            BindAccessLevel(designations);
        }
        public EmployeeAccountModel()
        {
            BasicRepository _basic = new BasicRepository();

            BasicContants.StoredProcedure = "GetAdminRoles";
            Roles    = _basic.Get();
            RoleList = Roles.ToRoleSelectListItems(RoleID);

            BasicContants.StoredProcedure = "GetGender";
            Genders    = _basic.Get();
            GenderList = Genders.ToGenderSelectListItems(GenderID);

            BasicContants.StoredProcedure = "GetCity";
            Cities   = _basic.Get();
            CityList = Cities.ToCitySelectListItems(CityID);

            BasicContants.StoredProcedure = "GetDesignation";
            Designations    = _basic.Get();
            DesignationList = Designations.ToDesignationSelectListItems(DesignationID);
        }
Beispiel #26
0
        public List <Designations> GetAllDesignation()
        {
            string query = "SELECT * FROM Designations";

            Command = new SqlCommand(query, Connection);
            Connection.Open();
            Reader = Command.ExecuteReader();
            List <Designations> designationList = new List <Designations>();

            while (Reader.Read())
            {
                Designations aDesignations = new Designations();
                aDesignations.DesignationsId  = Convert.ToInt32(Reader["DesignationsId"]);
                aDesignations.DesignationName = Reader["DesignationsName"].ToString();
                designationList.Add(aDesignations);
            }
            Reader.Close();
            Connection.Close();
            return(designationList);
        }
Beispiel #27
0
        public List <Designations> GetDesignations()
        {
            var    _DesignationsList = new List <Designations>();
            string query             = ("Select *From Designations");
            var    reader            = _MainRepository.Reader(query, _MainRepository.ConnectionString());

            if (reader.HasRows)
            {
                while (reader.Read())
                {
                    var _Designations = new Designations();
                    _Designations.Id = Convert.ToInt32(reader["Id"].ToString());
                    _Designations.DesignationName = reader["DesignationName"].ToString();

                    _DesignationsList.Add(_Designations);
                }
            }
            reader.Close();

            return(_DesignationsList);
        }
        public async void Paint(MainWindow mainWindow, Designations designations)
        {
            double Range       = designations.Max - designations.Min;
            int    FieldHeight = Settings.ChartHeight - 35;

            for (int i = 0; i < designations.High.Count - 1; i++)
            {
                double Y1High = FieldHeight - FieldHeight / (Range / (designations.High[i + 1] - designations.Min));
                double Y2High = FieldHeight - FieldHeight / (Range / (designations.High[i] - designations.Min));
                await DrawLine(mainWindow, i, Y1High, Y2High, Brushes.Red);

                double Y1Low = FieldHeight - FieldHeight / (Range / (designations.Low[i + 1] - designations.Min));
                double Y2Low = FieldHeight - FieldHeight / (Range / (designations.Low[i] - designations.Min));
                await DrawLine(mainWindow, i, Y1Low, Y2Low, Brushes.Green);

                double Y1Middle = FieldHeight - FieldHeight / (Range / (designations.High[i + 1] - (designations.High[i + 1] - designations.Low[i + 1])
                                                                        / 2 - designations.Min));
                double Y2Middle = FieldHeight - FieldHeight / (Range / (designations.High[i] - (designations.High[i] - designations.Low[i])
                                                                        / 2 - designations.Min));
                await DrawLine(mainWindow, i, Y1Middle, Y2Middle, Brushes.Blue);
            }
        }
Beispiel #29
0
        public async Task <ActionResult> Register(RegisterViewModel model)
        {
            if (ModelState.IsValid)
            {
                var             context = new ApplicationDbContext();
                ApplicationUser applicationUser;

                Designations designation = context.Designation.Find(1);
                Departments  department  = context.Department.Find(1);

                if (designation != null && department != null)
                {
                    applicationUser = new ApplicationUser
                    {
                        UserName      = model.Email,
                        Email         = model.Email,
                        DesignationId = designation.Id,
                        DepartmentId  = department.Id,
                        IsActive      = model.IsActive,
                        DisplayName   = model.DisplayName
                    };

                    var result = await UserManager.CreateAsync(applicationUser, model.Password);

                    if (result.Succeeded)
                    {
                        await SignInManager.SignInAsync(applicationUser, isPersistent : false,
                                                        rememberBrowser : false);

                        return(RedirectToAction("Index", "Request"));
                    }
                    AddErrors(result);
                    return(View(model));
                }
                AddCustomizeError("Designation or Department Not Found.");
            }
            return(View(model));
        }
        public ActionResult GetRevieweeDesignation(string revieweeDepartmentId)
        {
            Employee employee = new Employee();
            int      revieweedepartmentId;
            List <SelectListItem> revieweeDesignations = new List <SelectListItem>();

            if (!string.IsNullOrEmpty(revieweeDepartmentId))
            {
                revieweedepartmentId = Convert.ToInt32(revieweeDepartmentId);
                List <Employee> employees       = employeeBL.GetEmployees();
                List <Employee> designationName = employees.Where(x => x.DepartmentId == revieweedepartmentId).ToList();

                designationName.ForEach(x =>
                {
                    int designationId  = x.DesignationId;
                    Designations desig = designationBL.GetDesignationByDesignationId(designationId);
                    revieweeDesignations.Add(new SelectListItem {
                        Text = desig.DesignationName, Value = x.DesignationId.ToString()
                    });
                });
            }
            return(Json(revieweeDesignations, JsonRequestBehavior.AllowGet));
        }