コード例 #1
0
        public int CreateAssetDetails(AssetDetailsEntities AssetDetailEntities)
        {
            //DateTime? issuedate = null;
            //DateTime? returndate = null;
            var issuedate  = (DateTime?)null;
            var returndate = (DateTime?)null;

            if (AssetDetailEntities.ISSUEDDATE != null)
            {
                issuedate = DateTime.ParseExact(AssetDetailEntities.ISSUEDDATE, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            }
            if (AssetDetailEntities.RETURNEDDATE != null)
            {
                returndate = DateTime.ParseExact(AssetDetailEntities.RETURNEDDATE, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            }
            if (AssetDetailEntities != null)
            {
                var AssetDetails = new TBL_EMP_ASSETDETAILS
                {
                    EMPLOYEE_ID   = AssetDetailEntities.EMPLOYEE_ID,
                    ASSET_NAME    = AssetDetailEntities.ASSET_NAME,
                    ASSET_CODE    = AssetDetailEntities.ASSET_CODE,
                    ISSUED_DATE   = issuedate,
                    RETURNED_DATE = returndate,
                    ISSUEDBY      = AssetDetailEntities.ISSUEDBY,
                    RETURNEDTO    = AssetDetailEntities.RETURNEDTO,
                    ASSET_STATUS  = AssetDetailEntities.ASSET_STATUS
                };
                _UOW.EMP_ASSETDETAILSRepository.Insert(AssetDetails);
                _UOW.Save();
            }

            return(Convert.ToInt32(AssetDetailEntities.ID));
        }
コード例 #2
0
        public int CreateRelationshipdetails(RelationshipDetailEntities RelationshipdetailsEntities)
        {
            var dob = (DateTime?)null;

            if (RelationshipdetailsEntities.DATEOFBIRTH != null)
            {
                dob = DateTime.ParseExact(RelationshipdetailsEntities.DATEOFBIRTH, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            }
            if (RelationshipdetailsEntities != null)
            {
                var RelationshipDetail = new TBL_EMP_RELATIONSHIP_DETAILS
                {
                    EMPLOYEE_ID   = RelationshipdetailsEntities.EMPLOYEE_ID,
                    RELATIONSHIP  = RelationshipdetailsEntities.RELATIONSHIP,
                    RELATIVE_NAME = RelationshipdetailsEntities.RELATIVE_NAME,
                    DATE_OF_BIRTH = dob,
                    OCCUPATION    = RelationshipdetailsEntities.OCCUPATION,
                    DEPENDENT     = RelationshipdetailsEntities.DEPENDENT
                };
                _UOW.RELATIONSHIP_DETAILSRepository.Insert(RelationshipDetail);
                _UOW.Save();
            }

            return(Convert.ToInt32(RelationshipdetailsEntities.ID));
        }
コード例 #3
0
        public int CreateEmploymentDetails(BUSSINESS_ENTITIES.EmploymentEntities EmploymentDetailsEntities)
        {
            //DateTime? joindate = null;
            //DateTime? releivedate = null;
            var joindate    = (DateTime?)null;
            var releivedate = (DateTime?)null;

            if (EmploymentDetailsEntities.JOININGDATE != "" && EmploymentDetailsEntities.JOININGDATE != null)
            {
                joindate = DateTime.ParseExact(EmploymentDetailsEntities.JOININGDATE, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            }
            if (EmploymentDetailsEntities.RELIEVINGDATE != "" && EmploymentDetailsEntities.RELIEVINGDATE != null)
            {
                releivedate = DateTime.ParseExact(EmploymentDetailsEntities.RELIEVINGDATE, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            }
            if (EmploymentDetailsEntities != null)
            {
                var QualificationDetail = new TBL_EMP_EMPLOYMENT_RECORD
                {
                    EMPLOYEE_ID        = EmploymentDetailsEntities.EMPLOYEE_ID,
                    ORGANISATION_NAME  = EmploymentDetailsEntities.ORGANISATION_NAME,
                    JOINING_DATE       = joindate,
                    RELIEVING_DATE     = releivedate,
                    LAST_DESIGNATION   = EmploymentDetailsEntities.LAST_DESIGNATION,
                    JOINING_EMOLUMENTS = EmploymentDetailsEntities.JOINING_EMOLUMENTS,
                    LEAVING_EMOLUMENTS = EmploymentDetailsEntities.LEAVING_EMOLUMENTS,
                    REASON_FOR_LEAVING = EmploymentDetailsEntities.REASON_FOR_LEAVING
                };
                _UOW.EMPLOYMENT_RECORDRepository.Insert(QualificationDetail);
                _UOW.Save();
            }

            return(Convert.ToInt32(EmploymentDetailsEntities.ID));
        }
コード例 #4
0
        public int CreatePIPDetails(PIPDeatilsEntities PIPDetailEntities)
        {
            //DateTime? createddate = null;
            //DateTime? closeddate = null;
            var createddate = (DateTime?)null;
            var closeddate  = (DateTime?)null;

            if (PIPDetailEntities.CREATEDATE != null)
            {
                createddate = DateTime.ParseExact(PIPDetailEntities.CREATEDATE, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            }
            if (PIPDetailEntities.CLOSEDATE != null)
            {
                closeddate = DateTime.ParseExact(PIPDetailEntities.CLOSEDATE, "dd/MM/yyyy", CultureInfo.InvariantCulture);
            }
            if (PIPDetailEntities != null)
            {
                var PIPDetailDetail = new TBL_EMP_PIPDETAILS
                {
                    EMPLOYEE_ID   = PIPDetailEntities.EMPLOYEE_ID,
                    PIP_DATE      = createddate,
                    REASON        = PIPDetailEntities.REASON,
                    PERIOD        = PIPDetailEntities.PERIOD,
                    PIPCREATEDBY  = PIPDetailEntities.PIPCREATEDBY,
                    PIPCLOSEDBY   = PIPDetailEntities.PIPCLOSEDBY,
                    PIPCLOSEDDATE = closeddate,
                    REMARKS       = PIPDetailEntities.REMARKS
                };
                _UOW.PIPDETAILSRepository.Insert(PIPDetailDetail);
                _UOW.Save();
            }

            return(Convert.ToInt32(PIPDetailEntities.ID));
        }
コード例 #5
0
 private TARUser SaveUser(TARUserViewModel user)
 {
     using (var scope = new TransactionScope())
     {
         TARUser aUser = Mapper.Map <TARUser>(user);
         aUser.CreatedAt = DateTime.Now;
         _unitOfWork.UserRepository.Insert(aUser);
         _unitOfWork.Save();
         return(aUser);
     }
 }
コード例 #6
0
 public int CreateAssetType(BUSSINESS_ENTITIES.AssetTypeEntities AssetDetailEntities)
 {
     if (AssetDetailEntities != null)
     {
         var ASSETDetail = new TBL_HRMS_ASSETTYPE_MASTER
         {
             ASSETTYPE_NAME = AssetDetailEntities.ASSETTYPE_NAME,
         };
         _UOW.ASSETTYPE_MASTERRepository.Insert(ASSETDetail);
         _UOW.Save();
     }
     return(Convert.ToInt32(AssetDetailEntities.ID));
 }
コード例 #7
0
 public int CreateEmployeeHobbiesDetails(EmployeeHobbiesEntity EmployeeHobbiesEntities)
 {
     if (EmployeeHobbiesEntities != null)
     {
         var EmployeeHobbiesDetail = new TBL_EMP_HOBBIES
         {
             EMPLOYEEID = EmployeeHobbiesEntities.EMPLOYEEID,
             HOBBIES    = EmployeeHobbiesEntities.HOBBIES
         };
         _UOW.HOBBIESRepository.Insert(EmployeeHobbiesDetail);
         _UOW.Save();
     }
     return(Convert.ToInt32(EmployeeHobbiesEntities.ID));
 }
コード例 #8
0
 public int CreateGrade(GradeEnities GradeEntities)
 {
     if (GradeEntities != null)
     {
         var GradeDetail = new TBL_HRMS_GRADE_MASTER
         {
             GRADE_NAME = GradeEntities.GRADE_NAME,
         };
         _UOW.GRADERepository.Insert(GradeDetail);
         _UOW.Save();
         cache.Remove(CacheKey);
     }
     return(Convert.ToInt32(GradeEntities.ID));
 }
コード例 #9
0
 public int CreateDesignation(DesignationEntities DesignationEntities)
 {
     if (DesignationEntities != null)
     {
         var DesignationDetail = new TBL_HRMS_DESIGNATIONMASTER
         {
             DESIGNATION_NAME = DesignationEntities.DESIGNATION_NAME,
         };
         _UOW.DESIGNATIONRepository.Insert(DesignationDetail);
         _UOW.Save();
         cache.Remove(CacheKey);
     }
     return(Convert.ToInt32(DesignationEntities.ID));
 }
コード例 #10
0
 public int CreateBloodGroup(BUSSINESS_ENTITIES.BloodGroupEntities BloodGroupEntities)
 {
     if (BloodGroupEntities != null)
     {
         var BLOODGROUPDetail = new TBL_HRMS_BLOODGROUP_MASTER
         {
             BLOODGROUP_NAME = BloodGroupEntities.BLOODGROUP_NAME,
         };
         _UOW.BLOODGROUPRepository.Insert(BLOODGROUPDetail);
         _UOW.Save();
         cache.Remove(CacheKey);
     }
     return(Convert.ToInt32(BloodGroupEntities.ID));
 }
コード例 #11
0
 public int CreateDepartment(DepartmentEntities DepartmentEntities)
 {
     if (DepartmentEntities != null)
     {
         var DepartmentDetail = new TBL_HRMS_DEPARTMENTMASTER
         {
             DEPARTMENT_NAME = DepartmentEntities.DEPARTMENT_NAME,
         };
         _UOW.DEPARTMENTRepository.Insert(DepartmentDetail);
         _UOW.Save();
         cache.Remove(CacheKey);
     }
     return(Convert.ToInt32(DepartmentEntities.ID));
 }
コード例 #12
0
        public int CreateSalaryAccountDetails(EmpAcountEntity SalaryAccountDetailsEntities)
        {
            if (SalaryAccountDetailsEntities != null)
            {
                var SalaryAccountDetailsDetail = _UOW.SALARYACCOUNTDETAILSRepository.GetAll().ToList().Where(x => x.EMPLOYEE_ID == SalaryAccountDetailsEntities.EMPLOYEE_ID).FirstOrDefault();
                if (SalaryAccountDetailsDetail != null)
                {
                    if (SalaryAccountDetailsEntities.ACCOUNTNO != "" && SalaryAccountDetailsEntities.ACCOUNTNO != null)
                    {
                        SalaryAccountDetailsDetail.ACCOUNTNO = SalaryAccountDetailsEntities.ACCOUNTNO;
                    }
                    if (SalaryAccountDetailsEntities.IFSCCODE != "" && SalaryAccountDetailsEntities.IFSCCODE != null)
                    {
                        SalaryAccountDetailsDetail.IFSCCODE = SalaryAccountDetailsEntities.IFSCCODE;
                    }

                    if (SalaryAccountDetailsEntities.BRANCH != null && SalaryAccountDetailsEntities.BRANCH != "")
                    {
                        SalaryAccountDetailsDetail.BRANCH = SalaryAccountDetailsEntities.BRANCH;
                    }
                    if (SalaryAccountDetailsEntities.BANKNAME != null && SalaryAccountDetailsEntities.BANKNAME != "")
                    {
                        SalaryAccountDetailsDetail.BANKNAME = SalaryAccountDetailsEntities.BANKNAME;
                    }
                    if (SalaryAccountDetailsEntities.CTC != null && SalaryAccountDetailsEntities.CTC != "")
                    {
                        SalaryAccountDetailsDetail.CTC = SalaryAccountDetailsEntities.CTC;
                    }

                    _UOW.SALARYACCOUNTDETAILSRepository.Update(SalaryAccountDetailsDetail);
                    _UOW.Save();
                }
                else
                {
                    var SalaryAccountDetailsDetails = new TBL_EMP_SALARYACCOUNTDETAILS
                    {
                        EMPLOYEE_ID = SalaryAccountDetailsEntities.EMPLOYEE_ID,
                        ACCOUNTNO   = SalaryAccountDetailsEntities.ACCOUNTNO,
                        IFSCCODE    = SalaryAccountDetailsEntities.IFSCCODE,
                        BRANCH      = SalaryAccountDetailsEntities.BRANCH,
                        BANKNAME    = SalaryAccountDetailsEntities.BANKNAME
                    };
                    _UOW.SALARYACCOUNTDETAILSRepository.Insert(SalaryAccountDetailsDetails);
                    _UOW.Save();
                }
            }
            return(Convert.ToInt32(SalaryAccountDetailsEntities.ID));
        }
コード例 #13
0
 public void SaveAllChanges()
 {
     using (UOW uow = new UOW())
     {
         uow.Save();
     }
 }
コード例 #14
0
 public ActionResult Create(Election election)
 {
     election.Id = Guid.NewGuid();
     unit.ElectionRepository.Insert(election);
     unit.Save();
     return(View());
 }
コード例 #15
0
        public WSResponse <object> Cadastro(Parceiro p)
        {
            var resp = new WSResponse <object>();

            try
            {
                if (ModelState.IsValid)
                {
                    p.Token = Util.Crypto.ConvertSHA1(DateTime.Now.ToString());

                    var u = new UOW();
                    if (u.ParceiroRep.GetFirst(pa => pa.Email == p.Email) != null)
                    {
                        ModelState.AddModelError("Email", "E-mail já cadastrado");
                    }

                    u.ParceiroRep.Insert(p);
                    u.Save();
                    resp.Success = true;

                    return(resp);
                }
                var e = ModelState.Values.SelectMany(v => v.Errors);
                foreach (var error in e)
                {
                    resp.Errors.Add(error.ErrorMessage);
                }
                return(resp);
            }
            catch (Exception e)
            {
                resp.Success = false;
                return(resp);
            }
        }
コード例 #16
0
ファイル: LeadController.cs プロジェクト: ramonbrbs/o2m
        public WSResponse <object> Cadastrar(Indicado indicado)
        {
            var resp = new WSResponse <object>();

            try
            {
                if (ModelState.IsValid)
                {
                    var uow = new UOW();
                    indicado.Status      = Indicado.StatusLead.Pendente;
                    indicado.CodParceiro = Convert.ToInt32(RequestContext.Principal.Identity.Name);
                    indicado.DataEnvio   = DateTime.Now;
                    resp.Success         = true;
                    uow.IndicadoRep.Insert(indicado);
                    uow.Save();
                }

                foreach (var modelState in ModelState.Values)
                {
                    foreach (var error in modelState.Errors)
                    {
                        resp.Errors.Add(error.ErrorMessage);
                    }
                }
                return(resp);
            }
            catch (Exception e)
            {
                return(resp);
            }
        }
コード例 #17
0
 internal int EditArticle(Article article)
 {
     using (UOW uow = new UOW())
     {
         uow.ArticleRepository.Update(article);
         return(uow.Save());
     }
 }
コード例 #18
0
 public void DeleteArticle(Article itemForDelete)
 {
     using (UOW uow = new UOW())
     {
         uow.ArticleRepository.Delete(itemForDelete);
         uow.Save();
     }
 }
コード例 #19
0
 public int AddArtical(Article article)
 {
     using (UOW uow = new UOW())
     {
         uow.ArticleRepository.Insert(article);
         return(uow.Save());
     }
 }
コード例 #20
0
 public void AddDocument(Document document)
 {
     using (UOW uow = new UOW())
     {
         uow.DocumentRepository.Insert(document);
         uow.Save();
     }
 }
コード例 #21
0
 public void DeleteClient(Client itemForDelete)
 {
     using (UOW uow = new UOW())
     {
         uow.ClientRepository.Delete(itemForDelete);
         uow.Save();
     }
 }
コード例 #22
0
 public int EditClient(Client client)
 {
     using (UOW uow = new UOW())
     {
         uow.ClientRepository.Update(client);
         return(uow.Save());
     }
 }
コード例 #23
0
 public int AddClient(Client client)
 {
     using (UOW uow = new UOW())
     {
         uow.ClientRepository.Insert(client);
         return(uow.Save());
     }
 }
コード例 #24
0
ファイル: HomeController.cs プロジェクト: Guzel278/Test
        public void Save(Orders model)
        {
            model.tOrder = new Order();

            try
            {
                model.tOrder.Id         = model.countOrder;
                model.tOrder.Number     = model.oNumber;
                model.tOrder.Date       = model.oDate;
                model.tOrder.ProviderId = model.oProviderId;
                dbContext.Repository <Order>().Create(model.tOrder);
                dbContext.Save();
            }
            catch (IOException e)
            {
            }
        }
コード例 #25
0
 internal void DeleteDocument(Document document)
 {
     using (UOW uow = new UOW())
     {
         uow.DocumentRepository.Delete(document);
         uow.Save();
     }
 }
コード例 #26
0
 public void Remove(OrderDTO OrderDTO)
 {
     if (OrderDTO != null)
     {
         var order = UOW.OrderRepository.SingleOrDefault(x => x.Id == OrderDTO.Id);
         UOW.OrderRepository.Remove(order);
         UOW.Save();
     }
 }
コード例 #27
0
 public void Create(OrderDTO OrderDTO)
 {
     if (OrderDTO != null)
     {
         var order = MapperHelper.Mapper.Map <OrderDTO, Order>(OrderDTO);
         UOW.OrderRepository.Add(order);
         UOW.Save();
     }
 }
コード例 #28
0
ファイル: ProductService.cs プロジェクト: BlockiyDmitriy/EPAM
 public void Remove(ProductDTO productDTO)
 {
     if (productDTO != null)
     {
         var product = UOW.ProductRepository.SingleOrDefault(x => x.Id == productDTO.Id);
         UOW.ProductRepository.Remove(product);
         UOW.Save();
     }
 }
コード例 #29
0
ファイル: ClientService.cs プロジェクト: BlockiyDmitriy/EPAM
 public void Create(ClientDTO clientDTO)
 {
     if (clientDTO != null)
     {
         var client = MapperHelper.Mapper.Map <ClientDTO, Client>(clientDTO);
         UOW.ClientRepository.Add(client);
         UOW.Save();
     }
 }
コード例 #30
0
ファイル: ClientService.cs プロジェクト: BlockiyDmitriy/EPAM
 public void Remove(ClientDTO clientDTO)
 {
     if (clientDTO != null)
     {
         var client = UOW.ClientRepository.SingleOrDefault(x => x.Id == clientDTO.Id);
         UOW.ClientRepository.Remove(client);
         UOW.Save();
     }
 }