public ActionResult Edit(CustomerUI customer)
 {
     try
     {
         return(RedirectToAction(nameof(Index)));
     }
     catch
     {
         return(View());
     }
 }
示例#2
0
文件: TicketUI.cs 项目: warisrana/ATA
 private void ButtonForCustmerRegister_Click(object sender, EventArgs e)
 {
     try
     {
         CustomerUI c = new CustomerUI();
         c.ShowDialog();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#3
0
 private void TileInCuctomerAddNew_Click(object sender, EventArgs e)
 {
     try
     {
         CustomerUI c = new CustomerUI();
         c.Show();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#4
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         CustomerUI bk = new CustomerUI(long.Parse(Custmer_Or_Agent_ID_Txt.Text));
         bk.ShowDialog();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#5
0
        internal void Cellcliick()
        {
            var value         = WarGrid1.SelectedCells[0].Value.ToString();
            var referencetype = Convert.ToInt32(WarGrid1.Rows[WarGrid1.SelectedCells[0].RowIndex].Cells[1].Value.ToString());

            if (WarGrid1.SelectedCells[0].ColumnIndex == 0)
            {
                BookingInfoUI bk = new BookingInfoUI(long.Parse(value));
                bk.ShowDialog();
            }
            else if (WarGrid1.SelectedCells[0].ColumnIndex == 1)
            {
            }
            else if (WarGrid1.SelectedCells[0].ColumnIndex == 2)
            {
                if (referencetype == 1)
                {
                    CustomerUI bk = new CustomerUI(long.Parse(value));
                    bk.ShowDialog();
                }
                else if (referencetype == 2)
                {
                    AgentUI bk = new AgentUI(long.Parse(value));
                    bk.ShowDialog();
                }


                //BookingInfoUI b = new BookingInfoUI(long.Parse(value));
                //b.ShowDialog();
            }
            else if (WarGrid1.SelectedCells[0].ColumnIndex == 3)
            {
            }
            else if (WarGrid1.SelectedCells[0].ColumnIndex == 4)
            {
                PackageUI bk = new PackageUI(long.Parse(value));
                bk.ShowDialog();
            }
            else if (WarGrid1.SelectedCells[0].ColumnIndex == 5)
            {
            }
            else if (WarGrid1.SelectedCells[0].ColumnIndex == 6)
            {
                // long bookingidrec = long.Parse(  WarGrid1.SelectedRows[0].Cells[0].Value.ToString());
                var bookingidrec = long.Parse(WarGrid1.Rows[WarGrid1.SelectedCells[0].RowIndex].Cells[6].Value.ToString());

                PrintUI bk = new PrintUI(bookingidrec);
                bk.ShowDialog();
            }
            else if (WarGrid1.SelectedCells[0].ColumnIndex == 7)
            {
            }
        }
示例#6
0
        internal void Cellcliick()
        {
            var value = WarGrid1.SelectedCells[0].Value.ToString();

            // var referencetype = Convert.ToInt32(WarGrid1.SelectedRows[0].Cells[1].Value.ToString());

            if (WarGrid1.SelectedCells[0].ColumnIndex == 0)
            {
                if (SearchFor == 1)
                {
                    CustomerUI bk = new CustomerUI(long.Parse(value));
                    bk.ShowDialog();
                }
                else if (SearchFor == 2)
                {
                    AgentUI bk = new AgentUI(long.Parse(value));
                    bk.ShowDialog();
                }
            }
            else if (WarGrid1.SelectedCells[0].ColumnIndex == 1)
            {
            }
            else if (WarGrid1.SelectedCells[0].ColumnIndex == 2)
            {
                //BookingInfoUI b = new BookingInfoUI(long.Parse(value));
                //b.ShowDialog();
            }
            else if (WarGrid1.SelectedCells[0].ColumnIndex == 3)
            {
            }
            else if (WarGrid1.SelectedCells[0].ColumnIndex == 4)
            {
            }
            else if (WarGrid1.SelectedCells[0].ColumnIndex == 5)
            {
            }
            else if (WarGrid1.SelectedCells[0].ColumnIndex == 6)
            {
            }
            else if (WarGrid1.SelectedCells[0].ColumnIndex == 7)
            {
            }
            else if (WarGrid1.SelectedCells[0].ColumnIndex == 10)
            {
                long v = long.Parse(value);
                if (v > 50000)
                {
                    AgentUI bk = new AgentUI(long.Parse(value));
                    bk.ShowDialog();
                }
            }
        }
示例#7
0
        protected void BindList(CustomerUI c)
        {
            List <CustomerUI> coll = new List <CustomerUI>();

            coll.Add(c);
            dgCustomers.DataSource = coll;
            dgCustomers.DataBind();
            if (customerType == CustomerType.Temp)
            {
                dgCustomers.Columns[5].Visible = false;
                dgCustomers.Columns[6].Visible = false;
            }
            Master.DisableViewState(dgCustomers);
        }
示例#8
0
        protected void LoadItems()
        {
            phHasItems.Visible   = true;
            phHasNoItems.Visible = false;
            if (dgCustomers.PageSize * dgCustomers.CurrentPageIndex > dgCustomers.VirtualItemCount)
            {
                dgCustomers.CurrentPageIndex         = 0;
                hfCurrentPageIndex_dgCustomers.Value = dgCustomers.CurrentPageIndex.ToString();
            }
            CustomerUI customer = BidController.GetCustomerData(CustomerId, customerType);

            Master.PageTitle = customerType == CustomerType.AppUser ? BidString.GetText(@"CustomersPageTitle") + customer.CustomerName : BidString.GetText(@"CustomersTempPageTitle");
            BindList(customer);
        }
示例#9
0
        public void CustomerRepository_CreateCustomer_ShouldDisplayDetailsForPotentialCustomer()
        {
            //Arrange
            var mockConsole = new MockConsole(new string[]
                                              { "1", "3", "Jane", "Doe", "123 Main Street", "Indianapolis", "IN", "46208", "2" });
            var customerUI = new CustomerUI(mockConsole);

            //Act
            customerUI.Run();

            //Assert
            var outputText = mockConsole.Output;

            StringAssert.Contains(outputText, "Doe, Jane - Potential");
        }
示例#10
0
        public void CustomerRepository_CreateCustomer_ShouldDisplayDetailsForPastCustomer()
        {
            //Arrange
            var mockConsole = new MockConsole(new string[]
                                              { "1", "2", "John", "Smith", "456 S. Central Street", "Indianapolis", "IN", "46208", "2" });
            var customerUI = new CustomerUI(mockConsole);

            //Act
            customerUI.Run();

            //Assert
            var outputText = mockConsole.Output;

            StringAssert.Contains(outputText, "Smith, John - Past");
        }
示例#11
0
        public void CustomerRepository_Search_ShouldReturnDetailsForCustomerByLastName()
        {
            //Arrange
            var mockConsole = new MockConsole(new string[]
                                              { "1", "1", "Amy", "Pond", "52 N. Police Box Lane", "Chicago", "IL", "60630", "3", "Pond" });
            var customerUI = new CustomerUI(mockConsole);

            //Act
            customerUI.Run();

            //Assert
            var customerRepository = customerUI.CustomerRepository;
            var outputText         = mockConsole.Output;

            StringAssert.Contains(outputText, "52 N. Police Box Lane");
        }
示例#12
0
        public void CustomerRepository_CreateCustomer_ShouldDisplayDetailsForCurrentCustomer()
        {
            //Arrange
            var mockConsole = new MockConsole(new string[]
                                              { "1", "1", "Amy", "Pond", "52 N. Police Box Lane", "Chicago", "IL", "60630", "2" });
            var customerUI = new CustomerUI(mockConsole);

            //Act
            customerUI.Run();

            //Assert
            var customerRepository = customerUI.CustomerRepository;
            var outputText         = mockConsole.Output;

            StringAssert.Contains(outputText, "Pond, Amy - Current");
        }
示例#13
0
    public void Setup(Vector3 targetPoint, Vector3 endPoint, Product[] i, int index, float time, CustomerManager manager, CustomerUI ui)
    {
        target      = targetPoint;
        finalTarget = endPoint;
        targetIndex = index;
        isMoving    = true;

        items = i;

        timeToLeaveMax = time;
        timeLeft       = time;

        customerManager = manager;
        customerUI      = ui;
        customerUI.SetupUI(customerName, items, targetIndex);
    }
示例#14
0
        public void CustomerRepository_Search_ShouldReturnNoCustomerMessageIfNoMatch()
        {
            //Arrange
            var mockConsole = new MockConsole(new string[]
                                              { "1", "1", "Amy", "Pond", "52 N. Police Box Lane", "Chicago", "IL", "60630", "3", "Smith" });
            var customerUI = new CustomerUI(mockConsole);

            //Act
            customerUI.Run();

            //Assert
            var customerRepository = customerUI.CustomerRepository;
            var outputText         = mockConsole.Output;

            StringAssert.Contains(outputText, "There are no customers with that last name.");
        }
示例#15
0
        internal void Cellcliick()
        {
            var value = WarGrid1.SelectedCells[0].Value.ToString();

            if (WarGrid1.SelectedCells[0].ColumnIndex == 1)
            {
                CustomerUI bk = new CustomerUI(long.Parse(value));
                bk.ShowDialog();
            }

            else
            {
                string           pnr = WarGrid1.Rows[WarGrid1.SelectedCells[0].RowIndex].Cells[2].Value.ToString();
                SaudiVisaStampUI bk  = new SaudiVisaStampUI(pnr);
                bk.ShowDialog();
            }
        }
示例#16
0
        internal void Cellcliick()
        {
            var value = WarGrid1.SelectedCells[0].Value.ToString();

            if (WarGrid1.SelectedCells[0].ColumnIndex == 1)
            {
                CustomerUI bk = new CustomerUI(long.Parse(value));
                bk.ShowDialog();
            }

            else
            {
                long        ss = long.Parse(WarGrid1.Rows[WarGrid1.SelectedCells[0].RowIndex].Cells[0].Value.ToString());
                ProtectorUI bk = new ProtectorUI(ss);
                bk.ShowDialog();
            }
        }
        public ActionResult Create(CustomerUI customer)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(View(customer));
                }

                Repo.AddCustomer(Mapper.Map(customer));

                return(RedirectToAction(nameof(Index)));
            }
            catch
            {
                return(View(customer));
            }
        }
示例#18
0
        public ActionResult Create(CustomerUI customer)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(View(customer));
                }
                Repo.AddCustomer(Mapper.Map(customer));
                return(RedirectToAction(nameof(PlaceOrder)));
            }
            catch (Exception)
            {
                return(View(customer));

                throw;
            }
        }
示例#19
0
 private void BookedBy_ReferenceCode_Link_Click(object sender, EventArgs e)
 {
     try
     {
         if (referencetypeVar == 1)
         {
             CustomerUI c = new CustomerUI(long.Parse(BookedBy_ReferenceCode_Link.Text));
             c.ShowDialog();
         }
         else if (referencetypeVar == 2)
         {
             AgentUI a = new AgentUI(long.Parse(BookedBy_ReferenceCode_Link.Text));
             a.ShowDialog();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
示例#20
0
        public ActionResult PlaceOrder()
        {
            CustomerClass User = Repo.LoadCustomerByUsername((string)TempData["user"]);

            User.PreviousOrders = (List <OrderClass>)Repo.LoadOrdersByCustomer(User);
            CustomerUI customer = Mapper.Map(User);

            if (customer.SuggestedOrder == null)
            {
                OrderUI order = new OrderUI();
                order.Customer    = customer;
                TempData["order"] = order;
                return(View(order));
            }
            List <int> RecentStoreZips = User.PreviousOrders.Where(po => po.DatePlaced.Subtract(DateTime.Now) < TimeSpan.FromHours(2)).Select(po => po.Store.Address.Zip).ToList();

            customer.SuggestedOrder.PossibleAddresses = customer.Addresses.Where(a => !RecentStoreZips.Contains(a.Zip)).ToList();
            TempData["order"] = customer.SuggestedOrder;
            return(View(customer.SuggestedOrder));
        }
示例#21
0
        static void Main(string[] args)
        {
            // carManager is from business layer
            // UI sends data access layer reference to carManager
            // carManager uses DAL methods fo manipulate data

            //CarManager carManager = new CarManager(new InMemoryCarDal());
            MainUI     mainUI     = new MainUI();
            BrandUI    brandUI    = new BrandUI();
            CarUI      carUI      = new CarUI();
            UserUI     userUI     = new UserUI();
            CustomerUI customerUI = new CustomerUI();
            RentalUI   rentalUI   = new RentalUI();


            List <IUserInterface> userInterfaces = new List <IUserInterface> {
                brandUI, carUI, userUI, customerUI, rentalUI
            };

            mainUI.Show(userInterfaces);
        }
示例#22
0
文件: TicketUI.cs 项目: warisrana/ATA
        private void ImageR_Click(object sender, EventArgs e)
        {
            try
            {
                if (orignalCustomerid > 80001)
                {
                    CustomerUI bk = new CustomerUI(orignalCustomerid);
                    if (bk != null)
                    {
                        bk.ShowDialog();
                    }
                }

                else
                {
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
 private void btn_print_Click(object sender, EventArgs e)
 {
     try
     {
         using (IDbConnection db = new SqlConnection(ConfigurationManager.ConnectionStrings["cn"].ConnectionString))
         {
             if (db.State == ConnectionState.Closed)
             {
                 db.Open();
                 string sql = $"Select CT.cusID,Ct.FirstName,CT.LastName,CT.ContactNum,CT.cus_address,CT.regDate,FOH.quantity,FOH.totAmt,FOH.OrderedTimes_Flag From Customer_Table CT Inner Join Food_Order_Header FOH on CT.cusID=FOH.cus_No where regDate BETWEEN '{dtp_FromDate.Value.ToString().Substring(0, 9)}' AND '{dtp_ToDate.Value.ToString().Substring(0, 9)}'";
                 List <CustomerDetails> list = db.Query <CustomerDetails>(sql, commandType: CommandType.Text).ToList();
                 using (CustomerUI obj = new CustomerUI(list))
                 {
                     obj.ShowDialog();
                 }
             }
         }
     }
     catch
     {
         throw;
     }
 }
示例#24
0
        private void BindPageUI()
        {
            try
            {
                if (Session["CustomerUI"] != null)
                {
                    CustomerUI customerUI = (CustomerUI)Session["CustomerUI"];
                    lblSideBar.Text = customerUI.SideBarMessage.Replace("\n", "<br />");

                    if (customerUI.SideBarBGColor != string.Empty)
                    {
                        tblSideBar.Style["background-color"] = "#" + customerUI.SideBarBGColor;
                    }
                    if (customerUI.SideBarFontName != string.Empty)
                    {
                        tblSideBar.Style["font-family"] = customerUI.SideBarFontName;
                        //lblSideBar.Font.Name = customerUI.SideBarFontName;
                    }
                    if (customerUI.SideBarFontSize != string.Empty)
                    {
                        tblSideBar.Style["font-size"] = customerUI.SideBarFontSize;
                        //lblSideBar.Font.Size = FontUnit.Parse(customerUI.SideBarFontSize);
                    }
                    if (customerUI.SideBarForeColor != string.Empty)
                    {
                        tblSideBar.Style["color"] = "#" + customerUI.SideBarForeColor;
                        //lblSideBar.ForeColor = Color.FromArgb(int.Parse(customerUI.SideBarForeColor, System.Globalization.NumberStyles.HexNumber));
                    }
                }
            }
            catch (Exception ex)
            {
                string strErrCode = ERROR_DISPLAY_MESSAGE + "," + (new Error_Log()).LogErrorIntoDB(ex, "BindPageUI");
                lblErr.Text = strErrCode;
            }
        }
示例#25
0
        private void buttonShowUsers_Click(object sender, EventArgs e)
        {
            CustomerUI c = new CustomerUI();

            c.Show();
        }
示例#26
0
        protected void Page_PreRender(object sender, EventArgs e)
        {
            if (!AllBids)
            {
                CustomerUI customer = BidController.GetCustomerData(CustomerId, customerType);
                if (bidType == BidType.BidActive)
                {
                    Master.PageTitle    = customerType == CustomerType.AppUser ? BidString.GetText(@"MyActiveBidsPageTitle") + " " + customer.CustomerName : BidString.GetText(@"CustomersTempPageTitle");
                    BidsCountLabel.Text = BidString.GetText(@"SumActiveBids");
                }
                if (bidType == BidType.BidCount)
                {
                    Master.PageTitle    = customerType == CustomerType.AppUser ? BidString.GetText(@"MyCountBidsPageTitle") + " " + customer.CustomerName : BidString.GetText(@"CustomersTempPageTitle");
                    BidsCountLabel.Text = BidString.GetText(@"SumCountBids");
                }
                if (bidType == BidType.BidAbandoned)
                {
                    Master.PageTitle    = customerType == CustomerType.AppUser ? BidString.GetText(@"MyBidsAbandonedPageTitle") + " " + customer.CustomerName : BidString.GetText(@"CustomersTempPageTitle");
                    BidsCountLabel.Text = BidString.GetText(@"SumAbandonedBids");
                }
                if (bidType == BidType.BidPurchase)
                {
                    Master.PageTitle    = customerType == CustomerType.AppUser ? BidString.GetText(@"MyBidsPurchasePageTitle") + " " + customer.CustomerName : BidString.GetText(@"CustomersTempPageTitle");
                    BidsCountLabel.Text = BidString.GetText(@"SumPurchaseBids");
                }
            }
            else
            {
                if (bidType == BidType.BidActive)
                {
                    Master.PageTitle    = customerType == CustomerType.AppUser ? BidString.GetText(@"DetailsMyActiveBidsPageTitle") : BidString.GetText(@"CustomersTempPageTitle");
                    BidsCountLabel.Text = BidString.GetText(@"SumActiveBids");
                }
                if (bidType == BidType.BidCount)
                {
                    Master.PageTitle    = customerType == CustomerType.AppUser ? BidString.GetText(@"DetailsMyCountBidsPageTitle") : BidString.GetText(@"CustomersTempPageTitle");
                    BidsCountLabel.Text = BidString.GetText(@"SumCountBids");
                }
                if (bidType == BidType.BidAbandoned)
                {
                    if (BidLeave)
                    {
                        Master.PageTitle    = customerType == CustomerType.AppUser ? BidString.GetText(@"DetailsMyWithNotOffersPageTitle") : BidString.GetText(@"CustomersTempPageTitle");
                        BidsCountLabel.Text = BidString.GetText(@"SumAbandonedBids");
                    }
                    else
                    {
                        Master.PageTitle    = customerType == CustomerType.AppUser ? BidString.GetText(@"DetailsMyBidsAbandonedPageTitle") : BidString.GetText(@"CustomersTempPageTitle");
                        BidsCountLabel.Text = BidString.GetText(@"SumAbandonedBids");
                    }
                }
                if (bidType == BidType.BidPurchase)
                {
                    Master.PageTitle    = customerType == CustomerType.AppUser ? BidString.GetText(@"DetailsMyBidsPurchasePageTitle") : BidString.GetText(@"CustomersTempPageTitle");
                    BidsCountLabel.Text = BidString.GetText(@"SumPurchaseBids");
                }
            }
            Master.ActiveMenu = "MyBids";

            Master.AddClientScriptInclude(@"dgDateManager.js");
        }
        // GET: Customer/Edit/5
        public ActionResult Edit(string username)
        {
            CustomerUI customer = Mapper.Map(Repo.LoadCustomerByUsername(username));

            return(View());
        }
示例#28
0
        private void BindPageUI()
        {
            if (Session["CustomerUI"] != null)
            {
                CustomerUI customerUI = (CustomerUI)Session["CustomerUI"];
                if (customerUI != null)
                {
                    lblHeader.Text = customerUI.HeaderMessage;
                    lblFooter.Text = customerUI.FooterMessage;

                    if (customerUI.HeaderBGColor != string.Empty)
                    {
                        trHeader.BgColor = customerUI.HeaderBGColor;
                    }
                    if (customerUI.HeaderFontName != string.Empty)
                    {
                        lblHeader.Font.Name      = customerUI.HeaderFontName;
                        lblwelcomeUser.Font.Name = customerUI.HeaderFontName;
                        lblcurrentDate.Font.Name = customerUI.HeaderFontName;
                        lkbtnSignOut.Font.Name   = customerUI.HeaderFontName;
                    }
                    if (customerUI.HeaderFontSize != string.Empty)
                    {
                        lblHeader.Font.Size      = FontUnit.Parse(customerUI.HeaderFontSize);
                        lblwelcomeUser.Font.Size = FontUnit.Parse(customerUI.HeaderFontSize);
                        lblcurrentDate.Font.Size = FontUnit.Parse(customerUI.HeaderFontSize);
                        lkbtnSignOut.Font.Size   = FontUnit.Parse(customerUI.HeaderFontSize);
                    }
                    if (customerUI.HeaderForeColor != string.Empty)
                    {
                        lblHeader.ForeColor      = Color.FromArgb(int.Parse(customerUI.HeaderForeColor, System.Globalization.NumberStyles.HexNumber));
                        lblwelcomeUser.ForeColor = Color.FromArgb(int.Parse(customerUI.HeaderForeColor, System.Globalization.NumberStyles.HexNumber));
                        lblcurrentDate.ForeColor = Color.FromArgb(int.Parse(customerUI.HeaderForeColor, System.Globalization.NumberStyles.HexNumber));
                        lkbtnSignOut.ForeColor   = Color.FromArgb(int.Parse(customerUI.HeaderForeColor, System.Globalization.NumberStyles.HexNumber));
                    }
                    if (customerUI.FooterBGColor != string.Empty)
                    {
                        trFooter.BgColor = customerUI.FooterBGColor;
                    }
                    if (customerUI.FooterFontName != string.Empty)
                    {
                        lblFooter.Font.Name = customerUI.FooterFontName;
                    }
                    if (customerUI.FooterFontSize != string.Empty)
                    {
                        lblFooter.Font.Size = FontUnit.Parse(customerUI.FooterFontSize);
                    }
                    if (customerUI.FooterForeColor != string.Empty)
                    {
                        lblFooter.ForeColor = Color.FromArgb(int.Parse(customerUI.FooterForeColor, System.Globalization.NumberStyles.HexNumber));
                    }

                    if (Convert.ToBoolean(customerUI.HasHeaderImage) == true)
                    {
                        imgHeader.ImageUrl = "~/ShowImage.ashx?Type=Header";
                    }
                    else
                    {
                        imgHeader.Visible = false;
                    }

                    if (Convert.ToBoolean(customerUI.HasFooterImage) == true)
                    {
                        imgFooter.ImageUrl = "~/ShowImage.ashx?Type=Footer";
                    }
                    else
                    {
                        imgFooter.Visible = false;
                    }
                }
            }
            else
            {
                //BindPage();
            }
        }
示例#29
0
文件: Form1.cs 项目: warisrana/ATA
        private void button1_Click(object sender, EventArgs e)
        {
            CustomerUI c = new CustomerUI(int.Parse(WarTextBox1.Text));

            c.Show();
        }