Exemplo n.º 1
0
        //public List<SelectListDto> GetAccountHeadJVSelectList()
        //{
        //    List<SelectListDto> lstSelectJvDto = new List<SelectListDto>();
        //    List<uspGetAccountHeadsForJV_Result> lstuspAccountHeadGetAll_Result = _dbContext.uspGetAccountHeadsForJV().ToList();
        //    foreach (var objuspGetAccountHeadsForJV_Result in lstuspAccountHeadGetAll_Result)
        //    {
        //        SelectListDto objSelectListDto = new SelectListDto()
        //        {
        //            ID = uspGetAccountHeadsForJV_Result.A,
        //            Text = uspGetAccountHeadsForJV_Result.AHName
        //        };
        //        lstSelectJvDto.Add(objSelectListDto);
        //    }
        //    return lstSelectJvDto;
        //}
        public ResultDto MoveAccountHead(AccountHeadDto accountHeadDto)
        {
            ResultDto resultDto = new ResultDto();

            try
            {
                resultDto.ObjectId = accountHeadDto.ParentAHID;
                int effectedCount = _dbContext.uspAccountHeadMove(accountHeadDto.AHIDS, accountHeadDto.ParentAHID, accountHeadDto.AHLevel, accountHeadDto.AHType, accountHeadDto.UserID);

                if (effectedCount > 0)
                {
                    resultDto.Message = "AccountHead details moved success fully";
                }
                else if (effectedCount == -1)
                {
                    resultDto.Message  = "Error occured while moved AccountHead";
                    resultDto.ObjectId = -1;
                }
                else
                {
                    resultDto.Message  = "Error occured while moved AccountHead details";
                    resultDto.ObjectId = -1;
                }
            }
            catch (Exception ex)
            {
                resultDto.Message  = "Service layer error occured while moved the AccountHead details";
                resultDto.ObjectId = -98;
            }
            return(resultDto);
        }