示例#1
0
        /// <summary>
        /// Check processing
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>ResultModel</returns>
        private void Check(UpdateDataModel inputObject)
        {
            // Local variable declaration
            AdminGiftListDao adminGiftListDao = null;
            MCodeCom mCodeCom = null;

            // Variable initialize
            adminGiftListDao = new AdminGiftListDao();
            mCodeCom = new MCodeCom();

            // Check role
            if (!PageHelper.AuthRole(Logics.RL_GIFTS))
                throw new ExecuteException("E_MSG_00013");

            // Check valid
            int i = 0;
            foreach (var obj in inputObject.ListGifts)
            {
                if (DataCheckHelper.IsNull(obj.GiftStatus))
                    throw new ExecuteException("E_MSG_00004", string.Format("Trạng thái ({0})", i + 1));
                if (!mCodeCom.IsExist(Logics.GROUP_GIFT_STATUS, obj.GiftStatus, false))
                    throw new DataNotExistException(string.Format("Trạng thái ({0})", i + 1));
                if (!adminGiftListDao.IsExistGift(obj.GiftCd))
                    throw new DataNotExistException(string.Format("Thẻ ({0})", i + 1));

                i++;
            }
        }
示例#2
0
        /// <summary>
        /// Check processing
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>DataModel</returns>
        private void Check(SaveDataModel inputObject)
        {
            // Local variable declaration
            AdminOfferEntryDao adminOfferEntryDao = null;
            MCodeCom mCodeCom = null;

            // Variable initialize
            adminOfferEntryDao = new AdminOfferEntryDao();
            mCodeCom = new MCodeCom();

            // Check role
            if (!PageHelper.AuthRole(Logics.RL_OFFERS))
                throw new ExecuteException("E_MSG_00013");

            // Check valid
            if (DateTime.Compare(inputObject.StartDate, inputObject.EndDate) > 0)
                throw new ExecuteException("E_MSG_00015", "Ngày bắt đầu", "Ngày kết thúc");
            if (inputObject.Percent < 0)
                throw new ExecuteException("E_MSG_00011", "Giảm (%)");
            if (!mCodeCom.IsExist(Logics.GROUP_OFFER_DIV, inputObject.OfferDiv, false))
                throw new DataNotExistException("Dữ liệu");
            if (!adminOfferEntryDao.IsExistItem(inputObject.ItemCd))
                throw new DataNotExistException("Sản phẩm");
            if (adminOfferEntryDao.IsExistOffer(inputObject.OfferCd))
                throw new DataExistException("Khuyến mãi");
        }
示例#3
0
        /// <summary>
        /// Check processing
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>ResultModel</returns>
        private void Check(UpdateDataModel inputObject)
        {
            // Local variable declaration
            AdminGroupRoleListDao adminGroupRoleListDao = null;
            MCodeCom mCodeCom = null;

            // Variable initialize
            adminGroupRoleListDao = new AdminGroupRoleListDao();
            mCodeCom = new MCodeCom();

            // Check role
            if (!PageHelper.AuthRole(Logics.RL_USERS))
                throw new ExecuteException("E_MSG_00013");

            // Check valid
            int i = 0;
            foreach (var obj in inputObject.ListGroupRoles)
            {
                var dFlag = DataHelper.ToString(obj.DeleteFlag);

                if (DataCheckHelper.IsNull(obj.DeleteFlag))
                    throw new ExecuteException("E_MSG_00004", string.Format("Dữ liệu ({0})", i + 1));
                if (!mCodeCom.IsExist(Logics.GROUP_DELETE_FLAG, dFlag, false))
                    throw new DataNotExistException(string.Format("Dữ liệu ({0})", i + 1));
                if (!adminGroupRoleListDao.IsExistGroupRole(obj.GroupCd, obj.RoleCd))
                    throw new DataNotExistException(string.Format("Quyền ({0})", i + 1));
                i++;
            }
        }
示例#4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (IsPostBack) return;
     MCodeCom codeCom = new MCodeCom();
     IList<ComboItem> citylst = MCodeCom.ToComboItems(codeCom.GetListCity(), "294").ListItems;
     DropDownList1.DataSource = citylst;
     DropDownList1.DataBind();
 }
示例#5
0
        /// <summary>
        /// Execute convert ouput.
        /// </summary>
        /// <param name="resultObject">DataModel</param>
        /// <returns>ResponseModel</returns>
        private FilterResponseModel Convert(FilterDataModel resultObject)
        {
            // Local variable declaration
            FilterResponseModel responseModel = null;
            IList<OutputAcceptModel> listAccepts = null;
            MCodeCom mCodeCom = null;
            OutputAcceptModel accept = null;

            // Variable initialize
            responseModel = new FilterResponseModel();
            listAccepts = new List<OutputAcceptModel>();
            mCodeCom = new MCodeCom();

            // Get value
            var slipStatusName = string.Empty;
            var paymentMethodsName = string.Empty;
            var deleteFlagName = string.Empty;
            var cbSlipStatus = new ComboModel();
            foreach (var obj in resultObject.ListAccepts)
            {
                accept = new OutputAcceptModel();
                accept.AcceptSlipNo = DataHelper.ToString(obj.AcceptSlipNo);
                accept.SlipStatus = DataHelper.ToString(obj.SlipStatus);
                slipStatusName = mCodeCom.GetCodeName(Logics.GROUP_SLIP_STATUS, accept.SlipStatus);
                accept.SlipStatusName = DataHelper.ToString(slipStatusName);
                accept.AcceptDate = DataHelper.ToString(Formats.DATE, obj.AcceptDate);
                accept.DeliveryDate = DataHelper.ToString(Formats.DATE, obj.DeliveryDate);
                accept.ClientCd = DataHelper.ToString(obj.ClientCd);
                accept.ClientName = DataHelper.ToString(obj.ClientName);
                accept.ClientAddress = DataHelper.ToString(obj.ClientAddress);
                accept.ClientTel = DataHelper.ToString(obj.ClientTel);
                accept.DeliveryCd = DataHelper.ToString(obj.DeliveryCd);
                accept.DeliveryName = DataHelper.ToString(obj.DeliveryName);
                accept.DeliveryAddress = DataHelper.ToString(obj.DeliveryAddress);
                accept.DeliveryTel = DataHelper.ToString(obj.DeliveryTel);
                accept.PaymentMethods = DataHelper.ToString(obj.PaymentMethods);
                paymentMethodsName = mCodeCom.GetCodeName(Logics.GROUP_PAYMENT_METHODS, accept.PaymentMethods);
                accept.PaymentMethodsName = DataHelper.ToString(paymentMethodsName);
                accept.GiftCd = DataHelper.ToString(obj.GiftCd);
                accept.ViewId = DataHelper.ToString(obj.ViewId);
                accept.Notes = DataHelper.ToString(obj.Notes);
                accept.UpdateUser = DataHelper.ToString(obj.UpdateUser);
                accept.UpdateDate = DataHelper.ToString(Formats.UPDATE_DATE, obj.UpdateDate);
                accept.DeleteFlag = DataHelper.ToString(obj.DeleteFlag);
                deleteFlagName = mCodeCom.GetCodeName(Logics.GROUP_DELETE_FLAG, accept.DeleteFlag);
                accept.DeleteFlagName = DataHelper.ToString(deleteFlagName);
                cbSlipStatus = MCodeCom.ToComboItems(resultObject.ListSlipStatus, accept.SlipStatus);
                accept.ListSlipStatus = cbSlipStatus.ListItems;
                accept.SlipStatus = cbSlipStatus.SeletedValue;
                listAccepts.Add(accept);
            }

            // Set value
            responseModel.ListAccepts = listAccepts;

            // Return value
            return responseModel;
        }
示例#6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                return;
            }
            else
            {
                //load data
                MCodeCom codeCom = new MCodeCom();
                IList<ComboItem> citylst = MCodeCom.ToComboItems(codeCom.GetListCity(), "294").ListItems;
                DropDownList1.DataSource = citylst;
                DropDownList1.DataBind();
                DropDownList1.SelectedValue = "294";
                DropDownList2.DataSource = citylst;
                DropDownList2.DataBind();
                DropDownList2.SelectedValue = "294";

                UserComDao userCom = new UserComDao();
                if (Session["Cart"] == null || Session["payMethod"] == null)
                {
                    Response.Redirect(Pages.CLIENT_INDEX);
                }
                if (Session["payMethod"].ToString().Equals("1"))
                {
                    if (Session["userCd"] == null)
                    {
                        Response.Redirect(Pages.CLIENT_LOGIN);
                    }
                    Guid userCd = new Guid(Session["userCd"].ToString());

                    result = userCom.GetSingle(userCd, false);
                    if (result == null)
                    {
                        Response.Redirect(Pages.CLIENT_LOGIN);
                    }
                    else
                    {
                        clientName.Text = result.FullName;
                        clientAddress.Text = result.Address;
                        clientTell.Text = result.Phone1;
                        txtClientCd.Value = result.Email;
                        DropDownList1.SelectedValue = result.CityCd;

                        RadioButton1.Checked = true;

                        deliveryName.Text = result.FullName;
                        deliveryAddress.Text = result.Address;
                        deliveryTell.Text = result.Phone1;
                        DropDownList2.SelectedValue = result.CityCd;

                    }

                }

            }
        }
示例#7
0
        /// <summary>
        /// Execute convert ouput.
        /// </summary>
        /// <param name="resultObject">DataModel</param>
        /// <returns>ResponseModel</returns>
        private InitResponseModel Convert(InitDataModel resultObject)
        {
            // Local variable declaration
            InitResponseModel responseModel = null;
            IList<OutputOfferModel> listOffers = null;
            OutputOfferModel offer = null;
            MCodeCom mCodeCom = null;

            // Variable initialize
            responseModel = new InitResponseModel();
            listOffers = new List<OutputOfferModel>();
            mCodeCom = new MCodeCom();

            // Get value
            var cbDeleteFlag = new ComboModel();
            var offerDivName = string.Empty;
            foreach (var obj in resultObject.ListOffers)
            {
                offer = new OutputOfferModel();
                offer.OfferCd = DataHelper.ToString(obj.OfferCd);
                offer.OfferGroupCd = DataHelper.ToString(obj.OfferGroupCd);
                offer.ItemCd = DataHelper.ToString(obj.ItemCd);
                offer.StartDate = DataHelper.ToString(Formats.DATE, obj.StartDate);
                offer.EndDate = DataHelper.ToString(Formats.DATE, obj.EndDate);
                offer.Percent = DataHelper.ToString(Formats.NUMBER, obj.Percent);
                offer.Notes = DataHelper.ToString(obj.Notes);
                offer.DeleteFlag = DataHelper.ToString(obj.DeleteFlag);
                offer.UpdateDate = DataHelper.ToString(Formats.UPDATE_DATE, obj.UpdateDate);

                offerDivName = mCodeCom.GetCodeName(Logics.GROUP_OFFER_DIV, obj.OfferDiv);
                offer.OfferDiv = DataHelper.ToString(obj.OfferDiv);
                offer.OfferDivName = DataHelper.ToString(offerDivName);

                cbDeleteFlag = MCodeCom.ToComboItems(resultObject.ListDeleteFlag, offer.DeleteFlag);
                offer.ListDeleteFlag = cbDeleteFlag.ListItems;
                offer.DeleteFlag = cbDeleteFlag.SeletedValue;

                listOffers.Add(offer);
            }

            var cbOfferDiv = MCodeCom.ToComboItems(resultObject.ListOfferDiv, null);
            cbDeleteFlag = MCodeCom.ToComboItems(resultObject.ListDeleteFlag, null);

            // Set value
            responseModel.ListOfferDiv = cbOfferDiv.ListItems;
            responseModel.ListDeleteFlag = cbDeleteFlag.ListItems;
            responseModel.ListOffers = listOffers;

            // Return value
            return responseModel;
        }
示例#8
0
        /// <summary>
        /// Execute convert ouput.
        /// </summary>
        /// <param name="resultObject">DataModel</param>
        /// <returns>ResponseModel</returns>
        private FilterResponseModel Convert(FilterDataModel resultObject)
        {
            // Local variable declaration
            FilterResponseModel responseModel = null;
            IList<OutputItemModel> listItems = null;
            MCodeCom mCodeCom = null;
            OutputItemModel item = null;

            // Variable initialize
            responseModel = new FilterResponseModel();
            listItems = new List<OutputItemModel>();
            mCodeCom = new MCodeCom();

            // Get value
            var itemDivName = string.Empty;
            var deleteFlagName = string.Empty;
            foreach (var obj in resultObject.ListItems)
            {
                item = new OutputItemModel();

                item.ItemCd = DataHelper.ToString(obj.ItemCd);
                item.ItemName = DataHelper.ToString(obj.ItemName);
                item.CategoryCd = DataHelper.ToString(obj.CategoryCd);
                item.CategoryName = DataHelper.ToString(obj.Category.CategoryName);
                item.AgeCd = DataHelper.ToString(obj.AgeCd);
                item.AgeName = DataHelper.ToString(obj.Age.AgeName);
                item.GenderCd = DataHelper.ToString(obj.GenderCd);
                item.GenderName = DataHelper.ToString(obj.Gender.GenderName);
                item.BrandCd = DataHelper.ToString(obj.BrandCd);
                item.BrandName = DataHelper.ToString(obj.Brand.BrandName);
                item.CountryCd = DataHelper.ToString(obj.CountryCd);
                item.CountryName = DataHelper.ToString(obj.Country.CountryName);
                item.UnitCd = DataHelper.ToString(obj.UnitCd);
                item.UnitName = DataHelper.ToString(obj.Unit.UnitName);
                item.ItemDiv = DataHelper.ToString(obj.ItemDiv);
                itemDivName = mCodeCom.GetCodeName(Logics.GROUP_ITEM_DIV, item.ItemDiv);
                item.ItemDivName = DataHelper.ToString(itemDivName);
                item.UpdateDate = DataHelper.ToString(Formats.UPDATE_DATE, obj.UpdateDate);
                item.DeleteFlag = DataHelper.ToString(obj.DeleteFlag);
                deleteFlagName = mCodeCom.GetCodeName(Logics.GROUP_DELETE_FLAG, item.DeleteFlag);
                item.DeleteFlagName = DataHelper.ToString(deleteFlagName);
                listItems.Add(item);
            }

            // Set value
            responseModel.ListItems = listItems;

            // Return value
            return responseModel;
        }
示例#9
0
        /// <summary>
        /// Execute convert ouput.
        /// </summary>
        /// <param name="resultObject">DataModel</param>
        /// <returns>ResponseModel</returns>
        private FilterResponseModel Convert(FilterDataModel resultObject)
        {
            // Local variable declaration
            FilterResponseModel responseModel = null;
            IList<OutputUserModel> listUsers = null;
            MCodeCom mCodeCom = null;
            OutputUserModel user = null;

            // Variable initialize
            responseModel = new FilterResponseModel();
            listUsers = new List<OutputUserModel>();
            mCodeCom = new MCodeCom();

            // Get value
            var deleteFlagName = string.Empty;
            foreach (var obj in resultObject.ListUsers)
            {
                user = new OutputUserModel();

                user.UserCd = DataHelper.ToString(obj.UserCd);
                user.Email = DataHelper.ToString(obj.Email);
                user.FullName = DataHelper.ToString(obj.FullName);
                user.Address = DataHelper.ToString(obj.Address);
                user.CityCd = DataHelper.ToString(obj.CityCd);
                user.CityName = DataHelper.ToString(obj.City.CityName);
                user.Phone1 = DataHelper.ToString(obj.Phone1);
                user.Phone2 = DataHelper.ToString(obj.Phone2);
                user.UpdateDate = DataHelper.ToString(Formats.UPDATE_DATE, obj.UpdateDate);
                user.DeleteFlag = DataHelper.ToString(obj.DeleteFlag);
                deleteFlagName = mCodeCom.GetCodeName(Logics.GROUP_DELETE_FLAG, user.DeleteFlag);
                user.DeleteFlagName = DataHelper.ToString(deleteFlagName);
                if (obj.UserGroups.Count > decimal.Zero)
                {
                    user.GroupCd = DataHelper.ToString(obj.UserGroups[0].GroupCd);
                    user.GroupName = DataHelper.ToString(obj.UserGroups[0].Group.GroupName);
                }
                listUsers.Add(user);
            }

            // Set value
            responseModel.ListUsers = listUsers;

            // Return value
            return responseModel;
        }
示例#10
0
        /// <summary>
        /// Execute convert ouput.
        /// </summary>
        /// <param name="resultObject">DataModel</param>
        /// <returns>ResponseModel</returns>
        private InitResponseModel Convert(InitDataModel resultObject)
        {
            // Local variable declaration
            InitResponseModel responseModel = null;
            IList<OutputBrandModel> listBrands = null;
            MCodeCom mCodeCom = null;
            OutputBrandModel brand = null;

            // Variable initialize
            responseModel = new InitResponseModel();
            listBrands = new List<OutputBrandModel>();
            mCodeCom = new MCodeCom();

            // Get value
            var deleteFlagName = string.Empty;
            foreach (var obj in resultObject.ListBrands)
            {
                brand = new OutputBrandModel();

                brand.BrandCd = DataHelper.ToString(obj.BrandCd);
                brand.BrandName = DataHelper.ToString(obj.BrandName);
                brand.FileId = DataHelper.ToString(obj.FileId);
                brand.SortKey = DataHelper.ToString(Formats.NUMBER, obj.SortKey);
                brand.Notes = DataHelper.ToString(obj.Notes);
                brand.UpdateDate = DataHelper.ToString(Formats.UPDATE_DATE, obj.UpdateDate);
                brand.DeleteFlag = DataHelper.ToString(obj.DeleteFlag);
                deleteFlagName = mCodeCom.GetCodeName(Logics.GROUP_DELETE_FLAG, brand.DeleteFlag);
                brand.DeleteFlagName = DataHelper.ToString(deleteFlagName);

                listBrands.Add(brand);
            }

            // Set value
            var cbDeleteFlag = MCodeCom.ToComboItems(resultObject.ListDeleteFlag, null);
            responseModel.ListDeleteFlag = cbDeleteFlag.ListItems;
            responseModel.DeleteFlag = cbDeleteFlag.SeletedValue;
            responseModel.ListBrands = listBrands;

            // Return value
            return responseModel;
        }
示例#11
0
        /// <summary>
        /// Execute convert ouput.
        /// </summary>
        /// <param name="resultObject">DataModel</param>
        /// <returns>ResponseModel</returns>
        private FilterResponseModel Convert(FilterDataModel resultObject)
        {
            // Local variable declaration
            FilterResponseModel responseModel = null;
            IList<OutputGiftModel> listGifts = null;
            MCodeCom mCodeCom = null;
            OutputGiftModel gift = null;

            // Variable initialize
            responseModel = new FilterResponseModel();
            listGifts = new List<OutputGiftModel>();
            mCodeCom = new MCodeCom();

            // Get value
            var deleteFlagName = string.Empty;
            ComboModel cbGiftStatus = null;
            foreach (var obj in resultObject.ListGifts)
            {
                gift = new OutputGiftModel();

                gift.GiftCd = DataHelper.ToString(obj.GiftCd);
                gift.GiftStatus = DataHelper.ToString(obj.GiftStatus);
                gift.StartDate = DataHelper.ToString(Formats.DATE, obj.StartDate);
                gift.EndDate = DataHelper.ToString(Formats.DATE, obj.EndDate);
                gift.Price = DataHelper.ToString(Formats.CURRENCY, obj.Price);
                gift.UpdateDate = DataHelper.ToString(Formats.UPDATE_DATE, obj.UpdateDate);
                gift.DeleteFlag = DataHelper.ToString(obj.DeleteFlag);
                deleteFlagName = mCodeCom.GetCodeName(Logics.GROUP_DELETE_FLAG, gift.DeleteFlag);
                gift.DeleteFlagName = DataHelper.ToString(deleteFlagName);
                cbGiftStatus = MCodeCom.ToComboItems(resultObject.ListGiftStatus, gift.GiftStatus);
                gift.ListGiftStatus = cbGiftStatus.ListItems;
                gift.GiftStatus = cbGiftStatus.SeletedValue;
                listGifts.Add(gift);
            }

            // Set value
            responseModel.ListGifts = listGifts;

            // Return value
            return responseModel;
        }
示例#12
0
        /// <summary>
        /// Check processing
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>DataModel</returns>
        private void Check(SaveDataModel inputObject)
        {
            // Local variable declaration
            var adminGroupRoleEntryDao = new AdminGroupRoleEntryDao();
            var mCodeCom = new MCodeCom();

            // Check role
            if (!PageHelper.AuthRole(Logics.RL_USERS))
                throw new ExecuteException("E_MSG_00013");

            // Exist group
            if (!adminGroupRoleEntryDao.IsExistGroup(inputObject.GroupCd))
                throw new DataNotExistException("Nhóm");

            // Check valid
            var dFlag = DataHelper.ToString(inputObject.DeleteFlag);

            if (!mCodeCom.IsExist(Logics.GROUP_DELETE_FLAG, dFlag, false))
                throw new DataNotExistException("Dữ liệu");
            if (adminGroupRoleEntryDao.IsExistGroupRole(inputObject.GroupCd, inputObject.RoleCd))
                throw new DataExistException("Quyền");
        }
示例#13
0
        /// <summary>
        /// Check processing
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>DataModel</returns>
        private void Check(SaveDataModel inputObject)
        {
            // Local variable declaration
            var adminOfferItemEntryDao = new AdminOfferItemEntryDao();
            var mCodeCom = new MCodeCom();

            // Check role
            if (!PageHelper.AuthRole(Logics.RL_OFFERS))
                throw new ExecuteException("E_MSG_00013");

            // Exist offer
            if (!adminOfferItemEntryDao.IsExistOffer(inputObject.OfferCd))
                throw new DataNotExistException("Khuyến mãi");

            // Check valid
            if (inputObject.OfferItemQtty <= 0)
                throw new ExecuteException("E_MSG_00011", "Số lượng");
            var dFlag = DataHelper.ToString(inputObject.DeleteFlag);
            if (!mCodeCom.IsExist(Logics.GROUP_DELETE_FLAG, dFlag, false))
                throw new DataNotExistException("Dữ liệu");
            if (!adminOfferItemEntryDao.IsExistItem(inputObject.OfferItemCd))
                throw new DataNotExistException("Mã sản phẩm");
        }
示例#14
0
        /// <summary>
        /// Execute convert ouput.
        /// </summary>
        /// <param name="resultObject">DataModel</param>
        /// <returns>ResponseModel</returns>
        private InitResponseModel Convert(InitDataModel resultObject)
        {
            // Local variable declaration
            InitResponseModel responseModel = null;
            IList<OutputAcceptModel> listAccepts = null;
            OutputAcceptModel accept = null;
            MCodeCom mCodeCom = null;

            // Variable initialize
            responseModel = new InitResponseModel();
            listAccepts = new List<OutputAcceptModel>();
            mCodeCom = new MCodeCom();

            // Get value
            string slipStatusName = null;
            foreach (var obj in resultObject.ListAccepts)
            {
                accept = new OutputAcceptModel();

                accept.AcceptSlipNo = DataHelper.ToString(obj.AcceptSlipNo);
                accept.AcceptDate = DataHelper.ToString(Formats.DATE, obj.AcceptDate);
                accept.DeliveryName = DataHelper.ToString(obj.DeliveryName);
                accept.TotalAmount = DataHelper.ToString(Formats.CURRENCY, obj.TotalAmount);
                slipStatusName = mCodeCom.GetCodeName(Logics.GROUP_SLIP_STATUS, obj.SlipStatus);
                accept.SlipStatus = DataHelper.ToString(obj.SlipStatus);
                accept.SlipStatusName = DataHelper.ToString(slipStatusName);

                listAccepts.Add(accept);
            }

            // Set value
            responseModel.ListAccepts = listAccepts;
            responseModel.AcceptCount = DataHelper.ToString(Formats.NUMBER, listAccepts.Count);

            // Return value
            return responseModel;
        }
示例#15
0
        /// <summary>
        /// Check processing
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>ResultModel</returns>
        private void Check(UpdateDataModel inputObject)
        {
            // Local variable declaration
            AdminCategoryListDao adminCategoryListDao = null;
            MCodeCom mCodeCom = null;

            // Variable initialize
            adminCategoryListDao = new AdminCategoryListDao();
            mCodeCom = new MCodeCom();

            // Check role
            if (!PageHelper.AuthRole(Logics.RL_CATEGORIES))
                throw new ExecuteException("E_MSG_00013");

            // Check valid
            int i = 0;
            foreach (var obj in inputObject.ListCategories)
            {
                var dFlag = DataHelper.ToString(obj.DeleteFlag);

                if (DataCheckHelper.IsNull(obj.CategoryName))
                    throw new ExecuteException("E_MSG_00004", string.Format("Tên loại ({0})", i + 1));
                if (DataCheckHelper.IsNull(obj.CategoryDiv))
                    throw new ExecuteException("E_MSG_00004", string.Format("Chủng loại ({0})", i + 1));
                if (!mCodeCom.IsExist(Logics.GROUP_CATEGORY_DIV, obj.CategoryDiv, false))
                    throw new DataNotExistException(string.Format("Chủng loại ({0})", i + 1));
                if (DataCheckHelper.IsNull(obj.SortKey))
                    throw new ExecuteException("E_MSG_00004", string.Format("Thứ tự ({0})", i + 1));
                if (DataCheckHelper.IsNull(obj.DeleteFlag))
                    throw new ExecuteException("E_MSG_00004", string.Format("Dữ liệu ({0})", i + 1));
                if (!mCodeCom.IsExist(Logics.GROUP_DELETE_FLAG, dFlag, false))
                    throw new DataNotExistException(string.Format("Dữ liệu ({0})", i + 1));
                if (!adminCategoryListDao.IsExistCategory(obj.CategoryCd))
                    throw new DataNotExistException(string.Format("Loại sản phẩm ({0})", i + 1));
                i++;
            }
        }
示例#16
0
        /// <summary>
        /// Execute convert ouput.
        /// </summary>
        /// <param name="resultObject">DataModel</param>
        /// <returns>ResponseModel</returns>
        private InitResponseModel Convert(InitDataModel resultObject)
        {
            // Local variable declaration
            InitResponseModel responseModel = null;
            IList<OutputBannerModel> listBanners = null;
            OutputBannerModel banner = null;
            MCodeCom mCodeCom = null;

            // Variable initialize
            responseModel = new InitResponseModel();
            listBanners = new List<OutputBannerModel>();
            mCodeCom = new MCodeCom();

            // Get value
            var deleteFlagName = string.Empty;
            foreach (var obj in resultObject.ListBanners)
            {
                banner = new OutputBannerModel();

                banner.BannerCd = DataHelper.ToString(obj.BannerCd);
                banner.BannerName = DataHelper.ToString(obj.BannerName);
                banner.OfferGroupCd = DataHelper.ToString(obj.OfferGroupCd);
                banner.SortKey = DataHelper.ToString(obj.SortKey);
                banner.DeleteFlag = DataHelper.ToString(obj.DeleteFlag);
                deleteFlagName = mCodeCom.GetCodeName(Logics.GROUP_DELETE_FLAG, banner.DeleteFlag);
                banner.DeleteFlagName = DataHelper.ToString(deleteFlagName);
                banner.UpdateDate = DataHelper.ToString(Formats.UPDATE_DATE, obj.UpdateDate);

                listBanners.Add(banner);
            }

            // Set value
            responseModel.ListBanners = listBanners;

            // Return value
            return responseModel;
        }
示例#17
0
        /// <summary>
        /// Check processing
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>ResultModel</returns>
        private void Check(UpdateDataModel inputObject)
        {
            // Local variable declaration
            AdminOfferItemListDao adminOfferItemListDao = null;
            MCodeCom mCodeCom = null;

            // Variable initialize
            adminOfferItemListDao = new AdminOfferItemListDao();
            mCodeCom = new MCodeCom();

            // Check role
            if (!PageHelper.AuthRole(Logics.RL_OFFERS))
                throw new ExecuteException("E_MSG_00013");

            // Check valid
            int i = 0;
            foreach (var obj in inputObject.ListOfferItems)
            {
                if (DataCheckHelper.IsNull(obj.OfferItemCd))
                    throw new ExecuteException("E_MSG_00004", string.Format("Mã sản phẩm ({0})", i + 1));
                if (DataCheckHelper.IsNull(obj.OfferItemQtty))
                    throw new ExecuteException("E_MSG_00004", string.Format("Số lượng ({0})", i + 1));
                if (obj.OfferItemQtty <= 0)
                    throw new ExecuteException("E_MSG_00011", "Số lượng");
                var dFlag = DataHelper.ToString(obj.DeleteFlag);
                if (DataCheckHelper.IsNull(obj.DeleteFlag))
                    throw new ExecuteException("E_MSG_00004", string.Format("Dữ liệu ({0})", i + 1));
                if (!mCodeCom.IsExist(Logics.GROUP_DELETE_FLAG, dFlag, false))
                    throw new DataNotExistException(string.Format("Dữ liệu ({0})", i + 1));
                if (!adminOfferItemListDao.IsExistItem(obj.OfferItemCd))
                    throw new DataNotExistException(string.Format("Mã sản phẩm ({0})", i + 1));
                if (!adminOfferItemListDao.IsExistOfferItem(obj.OfferCd, obj.DetailNo))
                    throw new DataNotExistException(string.Format("Sản phẩm tặng ({0})", i + 1));
                i++;
            }
        }
示例#18
0
        /// <summary>
        /// Check processing
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>DataModel</returns>
        private void Check(SaveDataModel inputObject)
        {
            // Local variable declaration
            AdminCategoryEntryDao adminCategoryEntryDao = null;
            MCodeCom mCodeCom = null;

            // Variable initialize
            adminCategoryEntryDao = new AdminCategoryEntryDao();
            mCodeCom = new MCodeCom();

            // Check role
            if (!PageHelper.AuthRole(Logics.RL_CATEGORIES))
                throw new ExecuteException("E_MSG_00013");

            // Check valid
            var dFlag = DataHelper.ToString(inputObject.DeleteFlag);

            if (!mCodeCom.IsExist(Logics.GROUP_CATEGORY_DIV, inputObject.CategoryDiv, false))
                throw new DataNotExistException("Chủng loại");
            if (!mCodeCom.IsExist(Logics.GROUP_DELETE_FLAG, dFlag, false))
                throw new DataNotExistException("Dữ liệu");
            if (adminCategoryEntryDao.IsExistCategory(inputObject.CategoryCd))
                throw new DataExistException("Loại sản phẩm");
        }
示例#19
0
        /// <summary>
        /// Execute get email model.
        /// </summary>
        /// <param name="param">String</param>
        /// <returns>EmailModel</returns>
        private OutputEmailModel GetEmailModel(string param)
        {
            // Local variable declaration
            OutputEmailModel emailModel = null;
            ClientCheckoutDao clientCheckoutDao = null;
            MParameterCom mParameterCom = null;
            MCodeCom mCodeCom = null;
            IList<OutputAcceptDetailsModel> listAcceptDetails = null;

            // Variable initialize
            emailModel = new OutputEmailModel();
            clientCheckoutDao = new ClientCheckoutDao();
            mParameterCom = new MParameterCom();
            mCodeCom = new MCodeCom();
            listAcceptDetails = new List<OutputAcceptDetailsModel>();

            // Get data
            var accept = clientCheckoutDao.GetAccept(param);
            var strHotline = mParameterCom.GetString(Logics.PR_HOTLINE, false);
            var strEmail = mParameterCom.GetString(Logics.PR_EMAIL_SUPPORT, false);
            var paymentMethodsContent = mCodeCom.GetCodeContent(Logics.GROUP_PAYMENT_METHODS, accept.PaymentMethods);
            OutputAcceptDetailsModel acceptDetails = null;
            foreach (var obj in accept.AcceptDetails)
            {
                acceptDetails = new OutputAcceptDetailsModel();
                acceptDetails.ItemName = DataHelper.ToString(obj.ItemName);
                acceptDetails.DetailPrice = DataHelper.ToString(Formats.CURRENCY, obj.DetailPrice);
                acceptDetails.DetailQtty = DataHelper.ToString(Formats.NUMBER, obj.DetailQtty);
                acceptDetails.DetailAmt = DataHelper.ToString(Formats.CURRENCY, obj.DetailAmt);
                listAcceptDetails.Add(acceptDetails);
            }

            // Set data
            emailModel.AcceptSlipNo = DataHelper.ToString(accept.AcceptSlipNo);
            emailModel.ViewId = DataHelper.ToString(accept.ViewId);
            emailModel.AcceptDate = DataHelper.ToString(Formats.RFC_DATE, accept.AcceptDate);
            emailModel.ClientName = DataHelper.ToString(accept.ClientName);
            emailModel.ClientAddress = DataHelper.ToString(accept.ClientAddress);
            emailModel.ClientTel = DataHelper.ToString(accept.ClientTel);
            emailModel.DeliveryName = DataHelper.ToString(accept.DeliveryName);
            emailModel.DeliveryAddress = DataHelper.ToString(accept.DeliveryAddress);
            emailModel.DeliveryTel = DataHelper.ToString(accept.DeliveryTel);
            emailModel.PaymentMethodsContent = DataHelper.ToString(paymentMethodsContent);
            emailModel.Notes = DataHelper.ToString(accept.Notes);
            emailModel.Hotline = DataHelper.ToString(strHotline);
            emailModel.EmailSupport = DataHelper.ToString(strEmail);
            emailModel.AcceptDetails = listAcceptDetails;
            emailModel.TotalAmount = DataHelper.ToString(Formats.CURRENCY, accept.TotalAmount);

            // Return value;
            return emailModel;
        }
示例#20
0
        /// <summary>
        /// Get infomation
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>DataModel</returns>
        private InitDataModel GetInfo(InitDataModel inputObject)
        {
            // Local variable declaration
            InitDataModel getResult = null;
            MCodeCom mCodeCom = null;
            AdminUserEntryDao adminUserEntryDao = null;

            // Variable initialize
            getResult = new InitDataModel();
            mCodeCom = new MCodeCom();
            adminUserEntryDao = new AdminUserEntryDao();

            // Get data
            var listCity = mCodeCom.GetListCity(false, false);
            var listDeleteFlag = mCodeCom.GetListCode(Logics.GROUP_DELETE_FLAG, null, false, false);
            var listGroup = mCodeCom.GetListGroup(false, false);
            var user = new User();
            if (!IsAdd) user = adminUserEntryDao.GetSingle(inputObject.UserCd);

            // Set value
            getResult.ListCity = listCity;
            getResult.ListDeleteFlag = listDeleteFlag;
            getResult.ListGroup = listGroup;
            getResult.User = user;

            // Return value
            return getResult;
        }
示例#21
0
        /// <summary>
        /// Get infomation
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>DataModel</returns>
        private InitDataModel GetInfo(InitDataModel inputObject)
        {
            // Local variable declaration
            InitDataModel getResult = null;
            MCodeCom mCodeCom = null;
            AdminBrandEntryDao adminBrandEntryDao = null;

            // Variable initialize
            getResult = new InitDataModel();
            mCodeCom = new MCodeCom();
            adminBrandEntryDao = new AdminBrandEntryDao();

            // Get data
            var listDeleteFlag = mCodeCom.GetListCode(Logics.GROUP_DELETE_FLAG, null, false, false);
            var brand = new Brand();
            if (!IsAdd) brand = adminBrandEntryDao.GetSingleBrand(inputObject.BrandCd);
            else brand.FileId = DataHelper.GetUniqueKey();

            // Set value
            getResult.ListDeleteFlag = listDeleteFlag;
            getResult.Brand = brand;

            // Return value
            return getResult;
        }
示例#22
0
        /// <summary>
        /// Get infomation
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>DataModel</returns>
        private FilterDataModel GetInfo(FilterDataModel inputObject)
        {
            // Local variable declaration
            FilterDataModel getResult = null;
            MCodeCom mCodeCom = null;
            AdminAcceptListDao adminAcceptListDao = null;

            // Variable initialize
            getResult = new FilterDataModel();
            mCodeCom = new MCodeCom();
            adminAcceptListDao = new AdminAcceptListDao();

            // Get data
            var listSlipStatus = mCodeCom.GetListCode(Logics.GROUP_SLIP_STATUS, null, true, false);
            var listAccepts = adminAcceptListDao.GetListAccepts(inputObject);

            // Set value
            getResult.ListSlipStatus = listSlipStatus;
            getResult.ListAccepts = listAccepts;

            // Return value
            return getResult;
        }
示例#23
0
        /// <summary>
        /// Get infomation
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>DataModel</returns>
        private FilterDataModel GetInfo(FilterDataModel inputObject)
        {
            // Local variable declaration
            FilterDataModel getResult = null;
            MCodeCom mCodeCom = null;
            AdminOfferListDao adminOfferListDao = null;

            // Variable initialize
            getResult = new FilterDataModel();
            mCodeCom = new MCodeCom();
            adminOfferListDao = new AdminOfferListDao();

            // Get data
            var listDeleteFlag = mCodeCom.GetListCode(Logics.GROUP_DELETE_FLAG, null, true, false);
            var listOffers = adminOfferListDao.GetListOffers(inputObject);

            // Set value
            getResult.ListDeleteFlag = listDeleteFlag;
            getResult.ListOffers = listOffers;

            // Return value
            return getResult;
        }
示例#24
0
        /// <summary>
        /// Get infomation
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>DataModel</returns>
        private FilterDataModel GetInfo(FilterDataModel inputObject)
        {
            // Local variable declaration
            FilterDataModel getResult = null;
            MCodeCom mCodeCom = null;
            AdminBrandListDao adminBrandListDao = null;

            // Variable initialize
            getResult = new FilterDataModel();
            mCodeCom = new MCodeCom();
            adminBrandListDao = new AdminBrandListDao();

            // Get data
            var listBrands = adminBrandListDao.GetListBrands(inputObject);

            // Set value
            getResult.ListBrands = listBrands;

            // Return value
            return getResult;
        }
示例#25
0
        /// <summary>
        /// Get infomation
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>DataModel</returns>
        private InitDataModel GetInfo(InitDataModel inputObject)
        {
            // Local variable declaration
            InitDataModel getResult = null;
            MCodeCom mCodeCom = null;
            AdminAcceptListDao adminAcceptListDao = null;

            // Variable initialize
            getResult = new InitDataModel();
            mCodeCom = new MCodeCom();
            adminAcceptListDao = new AdminAcceptListDao();

            // Get data
            var listSlipStatus = mCodeCom.GetListCode(Logics.GROUP_SLIP_STATUS, null, true, false);
            var acceptDateStart = DataHelper.GetFirstDayOfMonth();
            var acceptDateEnd = DataHelper.GetLastDayOfMonth();
            var listAccepts = adminAcceptListDao.GetListAccepts();

            // Set value
            getResult.ListSlipStatus = listSlipStatus;
            getResult.AcceptDateStart = acceptDateStart;
            getResult.AcceptDateEnd = acceptDateEnd;
            getResult.ListAccepts = listAccepts;

            // Return value
            return getResult;
        }
示例#26
0
        /// <summary>
        /// Get infomation
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>DataModel</returns>
        private InitDataModel GetInfo(InitDataModel inputObject)
        {
            // Local variable declaration
            InitDataModel getResult = null;
            ClientMasterDao clientMasterDao = null;
            MCodeCom mCodeCom = null;
            MParameterCom mParameterCom = null;
            CartCom cartCom = null;

            // Variable initialize
            getResult = new InitDataModel();
            clientMasterDao = new ClientMasterDao();
            mCodeCom = new MCodeCom();
            mParameterCom = new MParameterCom();
            cartCom = new CartCom(inputObject.Cart);

            // Get data
            var cartCount = cartCom.Count;
            var strEmail = mParameterCom.GetString(Logics.PR_EMAIL_SUPPORT, false);

            var listToys = clientMasterDao.GetListCategories(Logics.CD_CATEGORY_DIV_TOYS);
            var listLearningTools = clientMasterDao.GetListCategories(Logics.CD_CATEGORY_DIV_LEARNING_TOOLS);
            var listBooks = clientMasterDao.GetListCategories(Logics.CD_CATEGORY_DIV_BOOKS);
            var listAge = clientMasterDao.GetListAge();
            var listGender = clientMasterDao.GetListGender();
            var listBrand = clientMasterDao.GetListBrand();
            var listCountry = clientMasterDao.GetListCountry();

            // Set value
            getResult.CartCount = cartCount;
            getResult.Email = strEmail;

            getResult.ListToys = listToys;
            getResult.ListLearningTools = listLearningTools;
            getResult.ListBooks = listBooks;
            getResult.ListAge = listAge;
            getResult.ListGender = listGender;
            getResult.ListBrand = listBrand;
            getResult.ListCountry = listCountry;

            // Return value
            return getResult;
        }
示例#27
0
        /// <summary>
        /// Get infomation
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>DataModel</returns>
        private InitDataModel GetInfo(InitDataModel inputObject)
        {
            // Local variable declaration
            InitDataModel getResult = null;
            MCodeCom mCodeCom = null;
            AdminBannerListDao adminBannerListDao = null;

            // Variable initialize
            getResult = new InitDataModel();
            mCodeCom = new MCodeCom();
            adminBannerListDao = new AdminBannerListDao();

            // Get data
            var listBanners = adminBannerListDao.GetListBanners();

            // Set value
            getResult.ListBanners = listBanners;

            // Return value
            return getResult;
        }
示例#28
0
        /// <summary>
        /// Execute convert ouput.
        /// </summary>
        /// <param name="resultObject">DataModel</param>
        /// <returns>ResponseModel</returns>
        private InitResponseModel Convert(InitDataModel resultObject)
        {
            // Local variable declaration
            InitResponseModel responseModel = null;
            IList<OutputItemModel> listItems = null;
            MCodeCom mCodeCom = null;
            OutputItemModel item = null;

            // Variable initialize
            responseModel = new InitResponseModel();
            listItems = new List<OutputItemModel>();
            mCodeCom = new MCodeCom();

            // Get value
            var itemDivName = string.Empty;
            var deleteFlagName = string.Empty;
            foreach (var obj in resultObject.ListItems)
            {
                item = new OutputItemModel();

                item.ItemCd = DataHelper.ToString(obj.ItemCd);
                item.ItemName = DataHelper.ToString(obj.ItemName);
                item.CategoryCd = DataHelper.ToString(obj.CategoryCd);
                item.CategoryName = DataHelper.ToString(obj.Category.CategoryName);
                item.AgeCd = DataHelper.ToString(obj.AgeCd);
                item.AgeName = DataHelper.ToString(obj.Age.AgeName);
                item.GenderCd = DataHelper.ToString(obj.GenderCd);
                item.GenderName = DataHelper.ToString(obj.Gender.GenderName);
                item.BrandCd = DataHelper.ToString(obj.BrandCd);
                item.BrandName = DataHelper.ToString(obj.Brand.BrandName);
                item.CountryCd = DataHelper.ToString(obj.CountryCd);
                item.CountryName = DataHelper.ToString(obj.Country.CountryName);
                item.UnitCd = DataHelper.ToString(obj.UnitCd);
                item.UnitName = DataHelper.ToString(obj.Unit.UnitName);
                item.ItemDiv = DataHelper.ToString(obj.ItemDiv);
                itemDivName = mCodeCom.GetCodeName(Logics.GROUP_ITEM_DIV, item.ItemDiv);
                item.ItemDivName = DataHelper.ToString(itemDivName);
                item.UpdateDate = DataHelper.ToString(Formats.UPDATE_DATE, obj.UpdateDate);
                item.DeleteFlag = DataHelper.ToString(obj.DeleteFlag);
                deleteFlagName = mCodeCom.GetCodeName(Logics.GROUP_DELETE_FLAG, item.DeleteFlag);
                item.DeleteFlagName = DataHelper.ToString(deleteFlagName);

                listItems.Add(item);
            }

            // Set value
            var cbCategory = MCodeCom.ToComboItems(resultObject.ListCategory, null);
            responseModel.ListCategory = cbCategory.ListItems;
            responseModel.CategoryCd = cbCategory.SeletedValue;
            var cbAge = MCodeCom.ToComboItems(resultObject.ListAge, null);
            responseModel.ListAge = cbAge.ListItems;
            responseModel.AgeCd = cbAge.SeletedValue;
            var cbGender = MCodeCom.ToComboItems(resultObject.ListGender, null);
            responseModel.ListGender = cbGender.ListItems;
            responseModel.GenderCd = cbGender.SeletedValue;
            var cbBrand = MCodeCom.ToComboItems(resultObject.ListBrand, null);
            responseModel.ListBrand = cbBrand.ListItems;
            responseModel.BrandCd = cbBrand.SeletedValue;
            var cbCountry = MCodeCom.ToComboItems(resultObject.ListCountry, null);
            responseModel.ListCountry = cbCountry.ListItems;
            responseModel.CountryCd = cbCountry.SeletedValue;
            var cbUnit = MCodeCom.ToComboItems(resultObject.ListUnit, null);
            responseModel.ListUnit = cbUnit.ListItems;
            responseModel.UnitCd = cbUnit.SeletedValue;
            var cbItemDiv = MCodeCom.ToComboItems(resultObject.ListItemDiv, null);
            responseModel.ListItemDiv = cbItemDiv.ListItems;
            responseModel.ItemDiv = cbItemDiv.SeletedValue;
            var cbDeleteFlag = MCodeCom.ToComboItems(resultObject.ListDeleteFlag, null);
            responseModel.ListDeleteFlag = cbDeleteFlag.ListItems;
            responseModel.DeleteFlag = cbDeleteFlag.SeletedValue;
            responseModel.ListItems = listItems;

            // Return value
            return responseModel;
        }
示例#29
0
        /// <summary>
        /// Get infomation
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>DataModel</returns>
        private InitDataModel GetInfo(InitDataModel inputObject)
        {
            // Local variable declaration
            InitDataModel getResult = null;
            MCodeCom mCodeCom = null;
            AdminItemListDao adminItemListDao = null;

            // Variable initialize
            getResult = new InitDataModel();
            mCodeCom = new MCodeCom();
            adminItemListDao = new AdminItemListDao();

            // Get data
            var listCategory = mCodeCom.GetListCategory(true, false);
            var listAge = mCodeCom.GetListAge(true, false);
            var listGender = mCodeCom.GetListGender(true, false);
            var listBrand = mCodeCom.GetListBrand(true, false);
            var listCountry = mCodeCom.GetListCountry(true, false);
            var listUnit = mCodeCom.GetListUnit(true, false);
            var listItemDiv = mCodeCom.GetListCode(Logics.GROUP_ITEM_DIV, null, true, false);
            var listDeleteFlag = mCodeCom.GetListCode(Logics.GROUP_DELETE_FLAG, null, true, false);
            var listItems = adminItemListDao.GetListItems();

            // Set value
            getResult.ListCategory = listCategory;
            getResult.ListAge = listAge;
            getResult.ListGender = listGender;
            getResult.ListBrand = listBrand;
            getResult.ListCountry = listCountry;
            getResult.ListUnit = listUnit;
            getResult.ListItemDiv = listItemDiv;
            getResult.ListDeleteFlag = listDeleteFlag;
            getResult.ListItems = listItems;

            // Return value
            return getResult;
        }
示例#30
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                return;
            }
            if (Session["Cart"] == null || Session["payMethod"] == null)
            {
                Response.Redirect(Pages.CLIENT_INDEX);
            }
            if (Session["CheckoutRequestModel"] == null || Session["hasCheckout"] == null)
            {
                Response.Redirect(Pages.CLIENT_CHECKOUT);
            }
            if (Session["payMethod"].ToString().Equals("0") && Session["SaveRequestModel"] == null)
            {
                Response.Redirect(Pages.CLIENT_CHECKOUT);
            }
            else
            {
                Session["hasCheckout"] = null;
            }

            //load data
            MCodeCom codeCom = new MCodeCom();
            IList<ComboItem> citylst = MCodeCom.ToComboItems(codeCom.GetListCity(), "294").ListItems;
            DropDownList1.DataSource = citylst;
            DropDownList1.DataBind();
            DropDownList1.SelectedValue = "294";
            DropDownList2.DataSource = citylst;
            DropDownList2.DataBind();
            DropDownList2.SelectedValue = "294";

            if (Session["payMethod"].ToString().Equals("0"))
            {
                SaveRequestModel accCreate = (SaveRequestModel)Session["SaveRequestModel"];
                email.Text = accCreate.Email;
            }
            CheckoutRequestModel checkout = (CheckoutRequestModel)Session["CheckoutRequestModel"];
            Accept accept = checkout.Accept;
            clientName.Text = accept.ClientName;
            clientAddress.Text = accept.ClientAddress;
            clientTell.Text = accept.ClientTel;
            DropDownList1.SelectedValue = accept.ClientCityCd;
            deliveryName.Text = accept.DeliveryName;
            deliveryAddress.Text = accept.DeliveryAddress;
            deliveryTell.Text = accept.DeliveryTel;
            DropDownList2.SelectedValue = accept.DeliveryCityCd;
            note.Text = accept.Notes;
            if (accept.PaymentMethods == "01")
            {
                lblPay.Text = "Thanh toán tiền mặt khi nhận hàng";
            }
            else if (accept.PaymentMethods == "02")
            {
                lblPay.Text = "Thanh toán trực truyến bằng thẻ ATM - Internet Banking";
            }
            IList<CartItem> cart = (IList<CartItem>)Session["Cart"];
            CartCom cartCom = new CartCom(cart);
            decimal amount = cartCom.TotalAmount;
            decimal ship = 0;
            if (Session["GiftPrice"] != null && Session["GiftCd"] != null)
            {
                amount = amount - (decimal)Session["GiftPrice"];

            }
            total = amount;
            if (accept.DeliveryCityCd == "294")
            {
                if (amount < 200000)
                {
                    ship = 20000;
                    total = total + ship;
                }
            }
            else
            {
                if (amount < 1000000)
                {
                    ship = 30000;
                    total = total + ship;
                }
            }
            Label1.Text = DataHelper.ToString(Formats.CURRENCY, amount);
            if (ship != 0)
            {
                Label2.Text = DataHelper.ToString(Formats.CURRENCY, ship);
            }
            Label3.Text = DataHelper.ToString(Formats.CURRENCY, total);
            Session["TotalAmt"] = total;
        }