Esempio n. 1
0
 private void checkout_Load(object sender, System.EventArgs e)
 {
     CustomerDS.Customer cust = StoreControllerHostedControl.GetCustomerByLogon(logon.UserName);
     nameText.Text       = cust.FullName;
     addressText.Text    = cust.EmailAddress;
     creditCardText.Text = "1111-1111-1111-1111";
 }
Esempio n. 2
0
        public override void Initialize(TaskArgumentsHolder args, ViewSettings settings)
        {
            ProductDS products = StoreControllerHostedControl.GetCatalogProducts();

            catalogGrid.DataSource = products;
            catalogGrid.DataMember = "product";
            DataGridTableStyle style = new DataGridTableStyle();

            style.ReadOnly    = true;
            style.MappingName = "product";

            PropertyDescriptorCollection descriptors = this.BindingContext[products, "product"].GetItemProperties();

            DataGridColumnStyle productId = new DataGridTextBoxColumn(descriptors["ProductID"]);

            productId.MappingName = "ProductID";
            productId.HeaderText  = "Product ID";
            productId.ReadOnly    = true;
            style.GridColumnStyles.Add(productId);

            DataGridColumnStyle categoryID = new DataGridTextBoxColumn(descriptors["CategoryID"]);

            categoryID.MappingName = "CategoryID";
            categoryID.HeaderText  = "Category ID";
            categoryID.ReadOnly    = true;
            style.GridColumnStyles.Add(categoryID);

            DataGridColumnStyle modelNumber = new DataGridTextBoxColumn(descriptors["ModelNumber"]);

            modelNumber.MappingName = "ModelNumber";
            modelNumber.HeaderText  = "Model Number";
            modelNumber.ReadOnly    = true;
            style.GridColumnStyles.Add(modelNumber);

            DataGridColumnStyle modelName = new DataGridTextBoxColumn(descriptors["ModelName"]);

            modelName.MappingName = "ModelName";
            modelName.HeaderText  = "Model Name";
            modelName.ReadOnly    = true;
            style.GridColumnStyles.Add(modelName);

            DataGridColumnStyle unitCost = new DataGridTextBoxColumn(descriptors["UnitCost"], "c");

            unitCost.MappingName = "UnitCost";
            unitCost.HeaderText  = "Unit Cost";
            unitCost.ReadOnly    = true;
            style.GridColumnStyles.Add(unitCost);

            DataGridColumnStyle description = new DataGridTextBoxColumn(descriptors["Description"]);

            description.MappingName = "Description";
            description.HeaderText  = "Description";
            description.ReadOnly    = true;
            style.GridColumnStyles.Add(description);

            catalogGrid.TableStyles.Add(style);
        }
Esempio n. 3
0
        private void error_Load(object sender, System.EventArgs e)
        {
            string errMessage = "";

            for (Exception tempException = StoreControllerHostedControl.GetLastError(); tempException != null; tempException = tempException.InnerException)
            {
                errMessage += tempException.Message + Environment.NewLine + Environment.NewLine;
            }
            msgLabel.Text = errMessage + Environment.NewLine + "You should be sure UIP database scripts was executed over the sql server";
        }
Esempio n. 4
0
        private void okButton_Click(object sender, System.EventArgs e)
        {
            //Ask controller if user is valid
            if (StoreControllerHostedControl.IsUserValid(emailText.Text, passwordText.Text))
            {
                //  Logon was valid.
                User          = emailText.Text;
                _startingTask = new CartTask(emailText.Text);
                // Start task with the previous task id
                UIPManager.StartUserControlsTask("Shop", _startingTask);

                //This view can be hidden because it started the task and its lifetime isn´t controlled
                //by the UIPManager class
                this.Visible = false;
            }
            else
            {
                MessageBox.Show("The user or password are incorrect");
            }
        }
Esempio n. 5
0
 private void lnkShowHelp_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
 {
     StoreControllerHostedControl.ShowStoreHelp();
 }
Esempio n. 6
0
 private void continueButton_Click(object sender, System.EventArgs e)
 {
     StoreControllerHostedControl.StopShopping();
     Application.Exit();
 }
Esempio n. 7
0
 private void checkoutButton_Click(object sender, System.EventArgs e)
 {
     StoreControllerHostedControl.CheckoutOrder();
 }
Esempio n. 8
0
 private void browseCatalogButton_Click(object sender, System.EventArgs e)
 {
     StoreControllerHostedControl.ResumeShopping();
 }
Esempio n. 9
0
 private void finishButton_Click(object sender, System.EventArgs e)
 {
     StoreControllerHostedControl.CompleteCheckout(nameText.Text, addressText.Text, creditCardText.Text);
 }
Esempio n. 10
0
 private void addButton_Click(object sender, System.EventArgs e)
 {
     StoreControllerHostedControl.AddToCart((int)catalogGrid[catalogGrid.CurrentRowIndex, 0], 1);
 }
Esempio n. 11
0
 private void returnButton_Click(object sender, System.EventArgs e)
 {
     StoreControllerHostedControl.ClearError();
 }