Пример #1
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;

                    }

                }

            }
        }
Пример #2
0
        /// <summary>
        /// Execute processing.
        /// </summary>
        /// <param name="request">RequestModel</param>
        /// <returns>ResponseModel</returns>
        private LoginResponseModel Execute(LoginRequestModel request)
        {
            // Local variable declaration
            LoginResponseModel responseModel = null;
            InitDataModel inputObject = null;
            InitDataModel resultObject = new InitDataModel();
            // Variable initialize
            responseModel = new LoginResponseModel();

            // Execute convert input.
            inputObject = Convert(request);

            // Get infomation
            UserComDao userCom = new UserComDao();
            User result = userCom.GetSingle(inputObject.UserName, DataHelper.GetMd5Hash(inputObject.Password));

            if (result != null)
            {
                resultObject.StatusFlag = true;
                resultObject.UserName = result.Email;
                resultObject.UserCd = result.UserCd.ToString();
            }
            else
            {
                resultObject.StatusFlag = false;
                throw new ExecuteException("E_MSG_00008");

            }

            // Execute convert ouput.
            responseModel = Convert(resultObject);

            return responseModel;
        }