Ejemplo n.º 1
0
        public ActionResult Edit(int id)
        {
            // For Bind Company
            #region Company Bind
            List <CompanyItem> objCompany     = new List <CompanyItem>();
            CompanyService     objListCompany = new CompanyService();
            objCompany = objListCompany.GetALL();

            EmpWorkHistoryItem objEmpWorkHistoryItem = new EmpWorkHistoryItem();
            objEmpWorkHistoryItem.CompanyList = new List <CompanyItem>();
            objEmpWorkHistoryItem.CompanyList.AddRange(objCompany);

            #endregion

            //For Bind Branch
            #region  Bind Branch
            List <BranchItem> objbranchitm     = new List <BranchItem>();
            BranchService     objbranchservice = new BranchService();
            objbranchitm = objbranchservice.GetAll();

            //objEmpItem = new EmployeeItem();
            objEmpWorkHistoryItem.BranchList = new List <BranchItem>();
            objEmpWorkHistoryItem.BranchList.AddRange(objbranchitm);

            // for designation ddl
            WorkHistoryService objWorkHistoryService = new WorkHistoryService();
            objEmpWorkHistoryItem = objWorkHistoryService.GetByPk(id);
            #endregion

            return(View(objEmpWorkHistoryItem));
        }
Ejemplo n.º 2
0
        public ActionResult Create()
        {
            // For Bind Company
            #region Company Bind
            List <CompanyItem> objCompany     = new List <CompanyItem>();
            CompanyService     objListCompany = new CompanyService();
            objCompany = objListCompany.GetALL();

            EmpWorkHistoryItem objEmpWorkHistoryItem = new EmpWorkHistoryItem();
            objEmpWorkHistoryItem.CompanyList = new List <CompanyItem>();
            objEmpWorkHistoryItem.CompanyList.AddRange(objCompany);

            #endregion

            //For Bind Branch
            #region  Bind Branch
            List <BranchItem> objbranchitm     = new List <BranchItem>();
            BranchService     objbranchservice = new BranchService();
            objbranchitm = objbranchservice.GetAll();

            //objEmpItem = new EmployeeItem();
            objEmpWorkHistoryItem.BranchList = new List <BranchItem>();
            objEmpWorkHistoryItem.BranchList.AddRange(objbranchitm);

            // for designation ddl
            clsMasterDataMethod objclsMasterDataMethod = new clsMasterDataMethod();
            objEmpWorkHistoryItem.DesignationList = objclsMasterDataMethod.GetAllDesignation();
            objEmpWorkHistoryItem.EmpId           = Convert.ToInt32(Url.RequestContext.RouteData.Values["id"].ToString());
            #endregion

            return(View(objEmpWorkHistoryItem));
        }
Ejemplo n.º 3
0
 public ActionResult Edit(EmpWorkHistoryItem model)
 {
     if (ModelState.IsValid)
     {
         objService.Update(model);
     }
     return(View());
 }
Ejemplo n.º 4
0
 public ActionResult Create(EmpWorkHistoryItem model)
 {
     if (ModelState.IsValid)
     {
         // model.Status = "Active";
         //model.CreatedBy = Convert.ToString(Empid);
         //model.CreatedDate = System.DateTime.Now;
         objService.Insert(model);
     }
     return(View());
 }
Ejemplo n.º 5
0
 public int Update(EmpWorkHistoryItem model)
 {
     try
     {
         WorkHistory objWorkHistory = new WorkHistory();
         objWorkHistory               = DbContext.WorkHistories.SingleOrDefault(m => m.Id == model.Id);
         objWorkHistory.EmpId         = model.EmpId;
         objWorkHistory.CompId        = model.CompId;
         objWorkHistory.BranchId      = model.BranchId;
         objWorkHistory.FromDate      = model.FromDate;
         objWorkHistory.ToDate        = model.ToDate;
         objWorkHistory.DesignationId = model.DesignationId;
         objWorkHistory.Remarks       = model.Remarks;
         objWorkHistory.Perfomance    = model.Perfomance;
         DbContext.WorkHistories.Add(objWorkHistory);
         return(DbContext.SaveChanges());
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 6
0
 public int Insert(EmpWorkHistoryItem model)
 {
     try
     {
         WorkHistory objWorkHistory = new WorkHistory();
         objWorkHistory.EmpId         = model.EmpId;
         objWorkHistory.CompId        = model.CompId;
         objWorkHistory.BranchId      = model.BranchId;
         objWorkHistory.DesignationId = model.DesignationId;
         objWorkHistory.FromDate      = model.FromDate;
         objWorkHistory.CreatedOn     = DateTime.UtcNow;
         objWorkHistory.CreatedBy     = 1;
         objWorkHistory.ToDate        = model.ToDate;
         objWorkHistory.Remarks       = model.Remarks;
         objWorkHistory.Perfomance    = model.Perfomance;
         DbContext.WorkHistories.Add(objWorkHistory);
         return(DbContext.SaveChanges());
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }