예제 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="modelContract"></param>
        /// <returns></returns>
        public ObjectModel.Contract GetContractByID(ObjectModel.Contract modelContract)
        {
            var rmodel       = new ConvertModel();
            var dao          = new ContractRepository();
            var dataContract = dao.Query(s => s.Id == modelContract.Id).FirstOrDefault();

            return(rmodel.ReturnModel <ObjectModel.Contract, Contract>(dataContract));
        }
예제 #2
0
        /// <summary>
        ///  save Entity Method
        /// </summary>
        /// <param name="svarContract"></param>
        public Decimal Add(ObjectModel.Contract svarContract)
        {
            svarContract.IsActive = "1";
            var rmodel    = new ConvertModel();
            var sContract = rmodel.ReturnModel <Contract, ObjectModel.Contract>(svarContract);
            var dao       = new ContractRepository();
            var newItem   = dao.Insert(sContract);

            return(newItem.Id);
        }
예제 #3
0
        /// <summary>
        ///  Edit Entity Method
        /// </summary>
        /// <param name="evarContract"></param>
        public void Update(ObjectModel.Contract evarContract)
        {
            var rmodel       = new ConvertModel();
            var eContract    = rmodel.ReturnModel <Contract, ObjectModel.Contract>(evarContract);
            var dao          = new ContractRepository();
            var dataContract = dao.Query(s => s.Id == evarContract.Id).FirstOrDefault();

            //eContract.CreatedOn =dataContract.CreatedOn;
            //eContract.CreatedByEmployeeId =dataContract.CreatedByEmployeeId;
            //eContract.ModifiedByEmployeeId =ConstantManager.GetCurrentUserId();
            //eContract.ModifiedOn =DateTime.Now;
            eContract.IsActive = dataContract.IsActive;
            dao.Update(eContract, c => c.Id == eContract.Id);
        }
예제 #4
0
        /// <summary>
        ///  Delete Entity Method
        /// </summary>
        /// <param name="dvarContract"></param>
        public void Remove(ObjectModel.Contract dvarContract)
        {
            var dao = new ContractRepository();

            dao.Delete(s => s.Id == dvarContract.Id);
        }