Beispiel #1
0
        /// <summary>
        /// Execute convert ouput.
        /// </summary>
        /// <param name="resultObject">DataModel</param>
        /// <returns>ResponseModel</returns>
        private InitResponseModel Convert(InitDataModel resultObject)
        {
            // Local variable declaration
            InitResponseModel  response = null;
            OutputDetailsModel details  = null;

            // Variable initialize
            response = new InitResponseModel();
            details  = new OutputDetailsModel();

            // Get value
            var brand = resultObject.Brand;

            details.Status          = DataHelper.ToString(_status);
            details.BrandCd         = DataHelper.ToString(brand.BrandCd);
            details.BrandName       = DataHelper.ToString(brand.BrandName);
            details.BrandSearchName = DataHelper.ToString(brand.BrandSearchName);
            details.FileId          = DataHelper.ToString(brand.FileId);
            details.Notes           = DataHelper.ToString(brand.Notes);
            details.SortKey         = DataHelper.ToString(brand.SortKey);
            details.DeleteFlag      = DataHelper.ToString(brand.DeleteFlag);
            var cbDeleteFlag = MCodeCom.ToComboItems(resultObject.ListDeleteFlag, details.DeleteFlag);

            details.ListDeleteFlag = cbDeleteFlag.ListItems;
            details.DeleteFlag     = cbDeleteFlag.SeletedValue;

            // Set value
            response.Details = new List <OutputDetailsModel>()
            {
                details
            };

            // Return value
            return(response);
        }
Beispiel #2
0
        /// <summary>
        /// Execute convert ouput.
        /// </summary>
        /// <param name="resultObject">DataModel</param>
        /// <returns>ResponseModel</returns>
        private InitResponseModel Convert(InitDataModel resultObject)
        {
            // Local variable declaration
            InitResponseModel  response = null;
            OutputDetailsModel details  = null;

            // Variable initialize
            response = new InitResponseModel();
            details  = new OutputDetailsModel();

            // Get value
            details.OfferCd   = DataHelper.ToString(resultObject.OfferCd);
            details.StartDate = DataHelper.ToString(Formats.DATE, resultObject.StartDate);
            details.EndDate   = DataHelper.ToString(Formats.DATE, resultObject.EndDate);
            details.OfferDiv  = DataHelper.ToString(resultObject.OfferDiv);

            var cbOfferDiv = MCodeCom.ToComboItems(resultObject.ListOfferDiv, details.OfferDiv);

            details.ListOfferDiv = cbOfferDiv.ListItems;
            details.OfferDiv     = cbOfferDiv.SeletedValue;

            var cbBrand = MCodeCom.ToComboItems(resultObject.ListBrand, null);

            details.ListBrand = cbBrand.ListItems;
            details.BrandCd   = cbBrand.SeletedValue;

            // Set value
            response.Details = new List <OutputDetailsModel>()
            {
                details
            };

            // Return value
            return(response);
        }
Beispiel #3
0
        /// <summary>
        /// Execute convert ouput.
        /// </summary>
        /// <param name="resultObject">DataModel</param>
        /// <returns>ResponseModel</returns>
        private InitResponseModel Convert(InitDataModel resultObject)
        {
            // Local variable declaration
            InitResponseModel  response = null;
            OutputDetailsModel details  = null;

            // Variable initialize
            response = new InitResponseModel();
            details  = new OutputDetailsModel();

            // Get value
            details.DeleteFlag = DataHelper.ToString(resultObject.DeleteFlag);

            var cbDeleteFlag = MCodeCom.ToComboItems(resultObject.ListDeleteFlag, details.DeleteFlag);

            details.ListDeleteFlag = cbDeleteFlag.ListItems;
            details.DeleteFlag     = cbDeleteFlag.SeletedValue;

            // Set value
            response.Details = new List <OutputDetailsModel>()
            {
                details
            };

            // Return value
            return(response);
        }
Beispiel #4
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);
        }
Beispiel #5
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 <OutputUserModel> listUsers     = null;
            MCodeCom        mCodeCom = null;
            OutputUserModel user     = null;

            // Variable initialize
            responseModel = new InitResponseModel();
            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
            var cbCity = MCodeCom.ToComboItems(resultObject.ListCity, null);

            responseModel.ListCity = cbCity.ListItems;
            responseModel.CityCd   = cbCity.SeletedValue;
            var cbDeleteFlag = MCodeCom.ToComboItems(resultObject.ListDeleteFlag, null);

            responseModel.ListDeleteFlag = cbDeleteFlag.ListItems;
            responseModel.DeleteFlag     = cbDeleteFlag.SeletedValue;
            var cbGroup = MCodeCom.ToComboItems(resultObject.ListGroup, null);

            responseModel.ListGroup = cbGroup.ListItems;
            responseModel.GroupCd   = cbGroup.SeletedValue;
            responseModel.ListUsers = listUsers;

            // Return value
            return(responseModel);
        }
Beispiel #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;
                    }
                }
            }
        }
Beispiel #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);
        }
Beispiel #8
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();
        }
Beispiel #9
0
        /// <summary>
        /// Execute convert ouput.
        /// </summary>
        /// <param name="resultObject">DataModel</param>
        /// <returns>ResponseModel</returns>
        private InitResponseModel Convert(InitDataModel resultObject)
        {
            // Local variable declaration
            InitResponseModel  response = null;
            OutputDetailsModel details  = null;

            // Variable initialize
            response = new InitResponseModel();
            details  = new OutputDetailsModel();

            // Get value
            var user = resultObject.User;

            details.Password   = DataHelper.ToString(Logics.PASSWORD_DEFAULT);
            details.Status     = DataHelper.ToString(_status);
            details.UserCd     = DataHelper.ToString(user.UserCd);
            details.Email      = DataHelper.ToString(user.Email);
            details.FullName   = DataHelper.ToString(user.FullName);
            details.Address    = DataHelper.ToString(user.Address);
            details.CityCd     = DataHelper.ToString(user.CityCd);
            details.Phone1     = DataHelper.ToString(user.Phone1);
            details.Phone2     = DataHelper.ToString(user.Phone2);
            details.DeleteFlag = DataHelper.ToString(user.DeleteFlag);
            if (user.UserGroups.Count > decimal.Zero)
            {
                details.GroupCd = DataHelper.ToString(user.UserGroups[0].GroupCd);
            }

            var cbCity = MCodeCom.ToComboItems(resultObject.ListCity, details.CityCd);

            details.ListCity = cbCity.ListItems;
            details.CityCd   = cbCity.SeletedValue;
            var cbDeleteFlag = MCodeCom.ToComboItems(resultObject.ListDeleteFlag, details.DeleteFlag);

            details.ListDeleteFlag = cbDeleteFlag.ListItems;
            details.DeleteFlag     = cbDeleteFlag.SeletedValue;
            var cbGroup = MCodeCom.ToComboItems(resultObject.ListGroup, details.GroupCd);

            details.ListGroup = cbGroup.ListItems;
            details.GroupCd   = cbGroup.SeletedValue;

            // Set value
            response.Details = new List <OutputDetailsModel>()
            {
                details
            };

            // Return value
            return(response);
        }
Beispiel #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 <OutputGiftModel> listGifts     = null;
            MCodeCom        mCodeCom = null;
            OutputGiftModel gift     = null;

            // Variable initialize
            responseModel = new InitResponseModel();
            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
            cbGiftStatus = MCodeCom.ToComboItems(resultObject.ListGiftStatus, null);
            responseModel.ListGiftStatus = cbGiftStatus.ListItems;
            responseModel.GiftStatus     = cbGiftStatus.SeletedValue;
            var cbDeleteFlag = MCodeCom.ToComboItems(resultObject.ListDeleteFlag, null);

            responseModel.ListDeleteFlag = cbDeleteFlag.ListItems;
            responseModel.DeleteFlag     = cbDeleteFlag.SeletedValue;
            responseModel.ListGifts      = listGifts;

            // Return value
            return(responseModel);
        }
Beispiel #11
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);
        }
Beispiel #12
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 <OutputCategoryModel> listCategories = null;
            OutputCategoryModel         category       = null;

            // Variable initialize
            responseModel  = new InitResponseModel();
            listCategories = new List <OutputCategoryModel>();

            // Get value
            var cbCategoryDiv = new ComboModel();
            var cbDeleteFlag  = new ComboModel();

            foreach (var obj in resultObject.ListCategories)
            {
                category                    = new OutputCategoryModel();
                category.CategoryCd         = DataHelper.ToString(obj.CategoryCd);
                category.CategoryName       = DataHelper.ToString(obj.CategoryName);
                category.CategorySearchName = DataHelper.ToString(obj.CategorySearchName);
                category.CategoryDiv        = DataHelper.ToString(obj.CategoryDiv);
                category.SortKey            = DataHelper.ToString(Formats.NUMBER, obj.SortKey);
                category.DeleteFlag         = DataHelper.ToString(obj.DeleteFlag);
                category.UpdateDate         = DataHelper.ToString(Formats.UPDATE_DATE, obj.UpdateDate);

                cbCategoryDiv            = MCodeCom.ToComboItems(resultObject.ListCategoryDiv, category.CategoryDiv);
                category.ListCategoryDiv = cbCategoryDiv.ListItems;
                category.CategoryDiv     = cbCategoryDiv.SeletedValue;
                cbDeleteFlag             = MCodeCom.ToComboItems(resultObject.ListDeleteFlag, category.DeleteFlag);
                category.ListDeleteFlag  = cbDeleteFlag.ListItems;
                category.DeleteFlag      = cbDeleteFlag.SeletedValue;

                listCategories.Add(category);
            }

            // Set value
            responseModel.ListCategories = listCategories;

            // Return value
            return(responseModel);
        }
Beispiel #13
0
        /// <summary>
        /// Execute convert ouput.
        /// </summary>
        /// <param name="resultObject">DataModel</param>
        /// <returns>ResponseModel</returns>
        private InitResponseModel Convert(InitDataModel resultObject)
        {
            // Local variable declaration
            InitResponseModel  response = null;
            OutputDetailsModel details  = null;

            // Variable initialize
            response = new InitResponseModel();
            details  = new OutputDetailsModel();

            // Get value
            var banner = resultObject.Banner;

            details.Status = DataHelper.ToString(_status);

            details.BannerCd     = DataHelper.ToString(banner.BannerCd);
            details.BannerName   = DataHelper.ToString(banner.BannerName);
            details.OfferGroupCd = DataHelper.ToString(banner.OfferGroupCd);
            details.SortKey      = DataHelper.ToString(banner.SortKey);
            details.FileId       = DataHelper.ToString(banner.FileId);
            details.DeleteFlag   = DataHelper.ToString(banner.DeleteFlag);

            var cbDeleteFlag = MCodeCom.ToComboItems(resultObject.ListDeleteFlag, details.DeleteFlag);

            details.ListDeleteFlag = cbDeleteFlag.ListItems;
            details.DeleteFlag     = cbDeleteFlag.SeletedValue;

            var cbOfferGroup = MCodeCom.ToComboItems(resultObject.ListOfferGroup, details.OfferGroupCd);

            details.ListOfferGroup = cbOfferGroup.ListItems;
            details.OfferGroupCd   = cbOfferGroup.SeletedValue;

            // Set value
            response.Details = new List <OutputDetailsModel>()
            {
                details
            };

            // Return value
            return(response);
        }
Beispiel #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 <OutputOfferItemModel> listOfferItems = null;
            OutputOfferItemModel         offerItem      = null;

            // Variable initialize
            responseModel  = new InitResponseModel();
            listOfferItems = new List <OutputOfferItemModel>();

            // Get value
            var cbDeleteFlag = new ComboModel();

            foreach (var obj in resultObject.ListOfferItems)
            {
                offerItem               = new OutputOfferItemModel();
                offerItem.OfferCd       = DataHelper.ToString(obj.OfferCd);
                offerItem.DetailNo      = DataHelper.ToString(obj.DetailNo);
                offerItem.OfferItemCd   = DataHelper.ToString(obj.OfferItemCd);
                offerItem.OfferItemQtty = DataHelper.ToString(Formats.NUMBER, obj.OfferItemQtty);
                offerItem.DeleteFlag    = DataHelper.ToString(obj.DeleteFlag);
                offerItem.UpdateDate    = DataHelper.ToString(Formats.UPDATE_DATE, obj.UpdateDate);

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

                listOfferItems.Add(offerItem);
            }

            // Set value
            responseModel.OfferCd        = resultObject.OfferCd;
            responseModel.ListOfferItems = listOfferItems;

            // Return value
            return(responseModel);
        }
Beispiel #15
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 <OutputGroupRoleModel> listGroupRoles = null;
            OutputGroupRoleModel         groupRole      = null;

            // Variable initialize
            responseModel  = new InitResponseModel();
            listGroupRoles = new List <OutputGroupRoleModel>();

            // Get value
            var cbDeleteFlag = new ComboModel();

            foreach (var obj in resultObject.ListGroupRoles)
            {
                groupRole            = new OutputGroupRoleModel();
                groupRole.GroupCd    = DataHelper.ToString(obj.GroupCd);
                groupRole.GroupName  = DataHelper.ToString(obj.Group.GroupName);
                groupRole.RoleCd     = DataHelper.ToString(obj.RoleCd);
                groupRole.RoleName   = DataHelper.ToString(obj.Role.RoleName);
                groupRole.DeleteFlag = DataHelper.ToString(obj.DeleteFlag);
                groupRole.UpdateDate = DataHelper.ToString(Formats.UPDATE_DATE, obj.UpdateDate);

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

                listGroupRoles.Add(groupRole);
            }

            // Set value
            responseModel.GroupCd        = resultObject.GroupCd;
            responseModel.ListGroupRoles = listGroupRoles;

            // Return value
            return(responseModel);
        }
        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;
        }
Beispiel #17
0
        /// <summary>
        /// Execute convert ouput.
        /// </summary>
        /// <param name="resultObject">DataModel</param>
        /// <returns>ResponseModel</returns>
        private InitResponseModel Convert(InitDataModel resultObject)
        {
            // Local variable declaration
            InitResponseModel  response = null;
            OutputDetailsModel details  = null;

            // Variable initialize
            response = new InitResponseModel();
            details  = new OutputDetailsModel();

            // Get value
            var item = resultObject.Item;

            details.Status         = DataHelper.ToString(_status);
            details.ItemCd         = DataHelper.ToString(item.ItemCd);
            details.ItemName       = DataHelper.ToString(item.ItemName);
            details.ItemSearchName = DataHelper.ToString(item.ItemSearchName);
            details.CategoryCd     = DataHelper.ToString(item.CategoryCd);
            details.AgeCd          = DataHelper.ToString(item.AgeCd);
            details.GenderCd       = DataHelper.ToString(item.GenderCd);
            details.BrandCd        = DataHelper.ToString(item.BrandCd);
            details.CountryCd      = DataHelper.ToString(item.CountryCd);
            details.UnitCd         = DataHelper.ToString(item.UnitCd);
            details.ItemDiv        = DataHelper.ToString(item.ItemDiv);
            details.SalesPrice     = DataHelper.ToString(Formats.NUMBER, item.SalesPrice);
            details.BuyingPrice    = DataHelper.ToString(Formats.NUMBER, item.BuyingPrice);
            details.LinkVideo      = DataHelper.ToString(item.LinkVideo);
            details.Material       = DataHelper.ToString(item.Material);
            details.SummaryNotes   = DataHelper.ToString(item.SummaryNotes);
            details.Notes          = DataHelper.ToString(item.Notes);
            details.SortKey        = DataHelper.ToString(item.SortKey);
            details.DeleteFlag     = DataHelper.ToString(item.DeleteFlag);
            details.FileId         = DataHelper.ToString(item.FileId);

            var cbCategory = MCodeCom.ToComboItems(resultObject.ListCategory, details.CategoryCd);

            details.ListCategory = cbCategory.ListItems;
            details.CategoryCd   = cbCategory.SeletedValue;
            var cbAge = MCodeCom.ToComboItems(resultObject.ListAge, details.AgeCd);

            details.ListAge = cbAge.ListItems;
            details.AgeCd   = cbAge.SeletedValue;
            var cbGender = MCodeCom.ToComboItems(resultObject.ListGender, details.GenderCd);

            details.ListGender = cbGender.ListItems;
            details.GenderCd   = cbGender.SeletedValue;
            var cbBrand = MCodeCom.ToComboItems(resultObject.ListBrand, details.BrandCd);

            details.ListBrand = cbBrand.ListItems;
            details.BrandCd   = cbBrand.SeletedValue;
            var cbCountry = MCodeCom.ToComboItems(resultObject.ListCountry, details.CountryCd);

            details.ListCountry = cbCountry.ListItems;
            details.CountryCd   = cbCountry.SeletedValue;
            var cbUnit = MCodeCom.ToComboItems(resultObject.ListUnit, details.UnitCd);

            details.ListUnit = cbUnit.ListItems;
            details.UnitCd   = cbUnit.SeletedValue;
            var cbItemDiv = MCodeCom.ToComboItems(resultObject.ListItemDiv, details.ItemDiv);

            details.ListItemDiv = cbItemDiv.ListItems;
            details.ItemDiv     = cbItemDiv.SeletedValue;
            var cbDeleteFlag = MCodeCom.ToComboItems(resultObject.ListDeleteFlag, details.DeleteFlag);

            details.ListDeleteFlag = cbDeleteFlag.ListItems;
            details.DeleteFlag     = cbDeleteFlag.SeletedValue;

            // Set value
            response.Details = new List <OutputDetailsModel>()
            {
                details
            };

            // Return value
            return(response);
        }
Beispiel #18
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);
        }