Example #1
0
        public ResponseDto UpdateGeneral(ShopGeneralDto updateDto)
        {
            ResponseDto responseDto = new ResponseDto();

            ShopGeneralBo shopGeneralBo = new ShopGeneralBo()
            {
                ShopId     = updateDto.ShopId,
                FullName   = updateDto.FullName,
                ShortName  = updateDto.ShortName,
                ShopTypeId = updateDto.ShopTypeId,

                IsIncludingVatPurhasePrice = updateDto.IsIncludingVatPurhasePrice,
                IsIncludingVatSalePrice    = updateDto.IsIncludingVatSalePrice,

                TaxOffice = updateDto.TaxOffice,
                TaxNumber = updateDto.TaxNumber,

                DefaultCurrencyId = updateDto.DefaultCurrencyId,

                UrlName = updateDto.UrlName,

                Phone  = updateDto.Phone,
                Phone2 = updateDto.Phone2,
                Email  = updateDto.Email,

                Session = Session
            };

            responseDto = shopPersonBusiness.UpdateGeneral(shopGeneralBo).ToResponseDto();

            return(responseDto);
        }
Example #2
0
        public ResponseBo UpdateGeneral(ShopGeneralBo updateBo)
        {
            ResponseBo responseBo = new ResponseBo();

            try
            {
                if (updateBo.Email.IsNotNull() && Validation.ValidateEmail(updateBo.Email) == false)
                {
                    responseBo.IsSuccess = false;
                    responseBo.Message   = GetDicValue("xEnterValidMailAddress", updateBo.Session.RealPerson.LanguageId);

                    return(responseBo);
                }

                using (SqlConnection conn = DbAccess.Connection.GetConn())
                {
                    var p = new DynamicParameters();
                    p.Add("@Message", dbType: DbType.String, direction: ParameterDirection.Output, size: 255);
                    p.Add("@IsSuccess", dbType: DbType.Boolean, direction: ParameterDirection.Output);

                    p.Add("@ShopId", updateBo.ShopId, DbType.Int64, ParameterDirection.Input);
                    p.Add("@ShortName ", updateBo.ShortName, DbType.String, ParameterDirection.Input, 255);
                    p.Add("@FullName ", updateBo.FullName, DbType.String, ParameterDirection.Input, 255);
                    p.Add("@ShopTypeId", updateBo.ShopTypeId, DbType.Int32, ParameterDirection.Input);

                    p.Add("@TaxOffice ", updateBo.TaxOffice, DbType.String, ParameterDirection.Input, 255);
                    p.Add("@TaxNumber ", updateBo.TaxNumber, DbType.String, ParameterDirection.Input, 50);

                    p.Add("@UrlName ", updateBo.UrlName, DbType.String, ParameterDirection.Input, 50);

                    p.Add("@Phone ", updateBo.Phone, DbType.String, ParameterDirection.Input, 50);
                    p.Add("@Phone2 ", updateBo.Phone2, DbType.String, ParameterDirection.Input, 50);
                    p.Add("@Email ", updateBo.Email, DbType.String, ParameterDirection.Input, 50);

                    p.Add("@IsIncludingVatPurhasePrice", updateBo.IsIncludingVatPurhasePrice, DbType.Boolean, ParameterDirection.Input);
                    p.Add("@IsIncludingVatSalePrice", updateBo.IsIncludingVatSalePrice, DbType.Boolean, ParameterDirection.Input);

                    p.Add("@DefaultCurrencyId", updateBo.DefaultCurrencyId, DbType.Int32, ParameterDirection.Input);

                    p.Add("@MyPersonId", updateBo.Session.MyPerson.Id, DbType.Int64, ParameterDirection.Input);
                    p.Add("@OperatorRealId", updateBo.Session.RealPerson.Id, DbType.Int64, ParameterDirection.Input);
                    p.Add("@LanguageId", updateBo.Session.RealPerson.LanguageId, DbType.Int32, ParameterDirection.Input);

                    var user = conn.Execute("spShopGeneralUpdate", p, commandType: CommandType.StoredProcedure);
                    responseBo.Message   = p.Get <string>("@Message");
                    responseBo.IsSuccess = p.Get <bool>("@IsSuccess");
                }
            }
            catch (Exception ex)
            {
                responseBo = base.SaveExLog(ex, this.GetType(), MethodBase.GetCurrentMethod().Name, updateBo);
            }

            return(responseBo);
        }