public Form_SelectOrder() { InitializeComponent(); OrderSummery_Client = (OrderSummeryClient)ClientFactory.GetClient(ClientType.Type.OrderSummery); GetCar_Client = (GetCarClient)ClientFactory.GetClient(ClientType.Type.GetCar); ShopID = GlobalParams.ShopID; if (ShopID < 0) { MessageBox.Show("您不属于任何店铺,请联系系统管理员分配您的店铺所属!", "错误!", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1); this.Close(); } List_Order = OrderSummery_Client.SelectOrderSummerys_ShopID(ShopID, null, null).ToList(); }
public Form_CatchCar(int count, int OrderID, int Type) { InitializeComponent(); this.count = count; this.OrderID = OrderID; this.Type = Type; Label LB_CarNumberTemp = new Label(); LB_CarNumberTemp.Text = "车牌号"; Label LB_ValidationTemp = new Label(); LB_ValidationTemp.Text = "驾照号码"; TextBox TB_CarNumberTemp = new TextBox(); TextBox TB_ValidationTemp = new TextBox(); LB_CarNumberTemp.Location = new Point(5, 30); LB_ValidationTemp.Location = new Point(5, 30); TB_CarNumberTemp.Location = new Point(30, 30); TB_ValidationTemp.Location = new Point(30, 30); GetCar_Client = (GetCarClient)ClientFactory.GetClient(ClientType.Type.GetCar); if (Type == 1) { this.BT_Submit.Click += new System.EventHandler(this.BT_Submit_Click); } else { List_GetCar = GetCar_Client.SelectAllCarGets().Where(P => P.GetCar_Order == OrderID).ToList(); BT_Submit.Text = "退出"; BT_Submit.Click += new System.EventHandler(BT_Back_Click); } for (int i = 0; i < count; i++) { Label LB_CarNumber = new Label(); LB_CarNumber.Text = LB_CarNumberTemp.Text + (i + 1) + ":"; LB_CarNumber.Width = 55; Label LB_Validation = new Label(); LB_Validation.Text = LB_ValidationTemp.Text + (i + 1) + ":"; LB_Validation.Width = 55; if (Type == 1) { TextBox TB_CarNumber = new TextBox(); TextBox TB_Validation = new TextBox(); TB_CarNumber.Width = 200; TB_Validation.Width = 200; TB_CarNumber.Location = new Point(65, TB_CarNumberTemp.Location.Y + 30 * i); TB_Validation.Location = new Point(65, TB_ValidationTemp.Location.Y + 30 * i); GB_Car.Controls.Add(TB_CarNumber); GB_Validation.Controls.Add(TB_Validation); } else { Label LB_CarN = new Label(); Label LB_Vali = new Label(); LB_CarN.Text = List_GetCar[i].GetCar_CarNumber; LB_Vali.Text = List_GetCar[i].GetCar_UserValidation; LB_CarN.Width = 200; LB_Vali.Width = 200; LB_CarN.Location = new Point(65, TB_CarNumberTemp.Location.Y + 30 * i); LB_Vali.Location = new Point(65, TB_ValidationTemp.Location.Y + 30 * i); GB_Car.Controls.Add(LB_CarN); GB_Validation.Controls.Add(LB_Vali); } LB_CarNumber.Location = new Point(LB_CarNumberTemp.Location.X, LB_CarNumberTemp.Location.Y + 30 * i); LB_Validation.Location = new Point(LB_ValidationTemp.Location.X, LB_ValidationTemp.Location.Y + 30 * i); GB_Car.Controls.Add(LB_CarNumber); GB_Validation.Controls.Add(LB_Validation); } GB_Car.Height = 50 + 30 * count; GB_Validation.Height = 50 + 30 * count; this.Height = 130 + 30 * count; BT_Submit.Location = new Point(BT_Submit.Location.X, GB_Validation.Height + 20); }
/// <summary> /// 客户端服务实例产生器 /// </summary> /// <param name="type">产生的服务类型</param> /// <returns></returns> private static object build(ClientType.Type type) { switch (type) { case ClientType.Type.Account: { AccountClient temp = new AccountClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <AccountClient>(type, temp); return(temp); } case ClientType.Type.Action: { ActionClient temp = new ActionClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <ActionClient>(type, temp); return(temp); } case ClientType.Type.Brand: { BrandClient temp = new BrandClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <BrandClient>(type, temp); return(temp); } case ClientType.Type.CarSummery: { CarSummeryClient temp = new CarSummeryClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <CarSummeryClient>(type, temp); return(temp); } case ClientType.Type.Checkout: { CheckoutClient temp = new CheckoutClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <CheckoutClient>(type, temp); return(temp); } case ClientType.Type.City: { CityClient temp = new CityClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <CityClient>(type, temp); return(temp); } case ClientType.Type.Order: { OrderClient temp = new OrderClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <OrderClient>(type, temp); return(temp); } case ClientType.Type.OrderSummery: { OrderSummeryClient temp = new OrderSummeryClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <OrderSummeryClient>(type, temp); return(temp); } case ClientType.Type.Province: { ProvinceClient temp = new ProvinceClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <ProvinceClient>(type, temp); return(temp); } case ClientType.Type.RAP: { RAPClient temp = new RAPClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <RAPClient>(type, temp); return(temp); } case ClientType.Type.Salary: { SalaryClient temp = new SalaryClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <SalaryClient>(type, temp); return(temp); } case ClientType.Type.SalaryAppend: { SalaryAppendClient temp = new SalaryAppendClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <SalaryAppendClient>(type, temp); return(temp); } case ClientType.Type.SalaryInfoSummery: { SalaryInfoSummeryClient temp = new SalaryInfoSummeryClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <SalaryInfoSummeryClient>(type, temp); return(temp); } case ClientType.Type.SalaryLog: { SalaryLogClient temp = new SalaryLogClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <SalaryLogClient>(type, temp); return(temp); } case ClientType.Type.Shop: { ShopClient temp = new ShopClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <ShopClient>(type, temp); return(temp); } case ClientType.Type.Type: { TypeClient temp = new TypeClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <TypeClient>(type, temp); return(temp); } case ClientType.Type.Version: { VersionClient temp = new VersionClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <VersionClient>(type, temp); return(temp); } case ClientType.Type.WorkRAP: { WorkRAPClient temp = new WorkRAPClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <WorkRAPClient>(type, temp); return(temp); } case ClientType.Type.UserManager: { UserManagerClient temp = new UserManagerClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <UserManagerClient>(type, temp); return(temp); } case ClientType.Type.UserSummery: { UserSummeryClient temp = new UserSummeryClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <UserSummeryClient>(type, temp); return(temp); } case ClientType.Type.GetCar: { GetCarClient temp = new GetCarClient(); UserNamePasswordClientCredential UNPCC = temp.ClientCredentials.UserName; UNPCC.UserName = GlobalParams.UserName; UNPCC.Password = GlobalParams.Password; AddClient <GetCarClient>(type, temp); return(temp); } } ; return(null); }