private async void EditingModelForm_Load(object sender, EventArgs e) { await Loading?.Invoke(); TB_Name.Focus(); TB_Name.SelectionStart = TB_Name.TextLength; }
private void LimpiarDatos() { TB_ISBN.Clear(); CB_Editorial.Text = ""; TB_Name.Clear(); TB_CantLibros.Clear(); }
private void BTN_BatchAdd_Click(object sender, EventArgs e) { if (TB_Name.Text != "") { bool canadd = true; XmlDocument doc = CreateXMLDoc(TB_Name.Text); XmlNodeList inbatch = batch.SelectNodes("//Batch//Script[@Name='" + TB_Name.Text + "']"); if (inbatch.Count > 0) { if (inbatch[0].InnerText != doc.SelectSingleNode("Script").InnerText) { canadd = false; if (MessageBox.Show("Step with the same name but different content already in list. Press Yes to replace current step or No to cancel.\r\nTo add as a separate step, provide a unique name.", "Duplicate Step", MessageBoxButtons.YesNo) == DialogResult.Yes) { XmlNode xn = batch.ImportNode(doc.SelectSingleNode("Script"), true); XmlNode oldnode = batch.SelectSingleNode("//Batch//Script[@Name='" + TB_Name.Text + "']"); oldnode.ParentNode.ReplaceChild(xn, oldnode); } } } if (canadd) { LB_Batch.Items.Add(TB_Name.Text); XmlNode newscript = batch.ImportNode(doc.SelectSingleNode("Script"), true); batch.SelectSingleNode("Batch").AppendChild(newscript); BTN_BatchRun.Enabled = true; BTN_SaveBatch.Enabled = true; } } else { MessageBox.Show("Batch step requires a name."); TB_Name.Focus(); } }
private void BT_AddVersion_Click(object sender, EventArgs e) { if (List_VersionInfo.Where(P => P.Version_Name == TB_Name.Text && P.Shop_ID == ShopID).Count() != 0) { MessageBox.Show("已经存在此种车型!"); return; } //判断选择框都不为空 if (TB_BaseKM.IsEmpty() && TB_Count.IsEmpty() && TB_Name.IsEmpty() && TB_Person.IsEmpty() && TB_PriceOver.IsEmpty() && TB_PriceMemberCatch.IsEmpty() && TB_PriceMemberRental.IsEmpty() && TB_PriceNormalCatch.IsEmpty() && TB_PriceNormalRental.IsEmpty() && TB_PriceOverRiding.IsEmpty() && TB_PriceRiding.IsEmpty() && TB_PriceDeposit.IsEmpty() && CB_Brand.SelectedIndex > 0 && CB_Type.SelectedIndex > 0 ) { if (Version_Client.AddVersion(new VersionService.Car_Version() { Version_Shop = ShopID, Version_BaseKM = Convert.ToInt32(TB_BaseKM.Text), Version_Brand = List_Brand.Where(P => P.Brand_Name == CB_Brand.SelectedItem.ToString()).Single().Brand_ID, Version_Count = Convert.ToInt32(TB_Count.Text), Version_IMG = imgString, Version_Info = TB_Info.Text, Version_Name = TB_Name.Text, Version_Type = List_Type.Where(P => P.Type_Name == CB_Type.SelectedItem.ToString()).Single().Type_ID, Version_Person = Convert.ToInt32(TB_Person.Text), Version_Price_Deposit = Convert.ToDecimal(TB_PriceDeposit.Text), Version_Price_Member_Catch = Convert.ToDecimal(TB_PriceMemberCatch.Text), Version_Price_Member_Rental = Convert.ToDecimal(TB_PriceMemberRental.Text), Version_Price_Normal_Catch = Convert.ToDecimal(TB_PriceNormalCatch.Text), Version_Price_Normal_Rental = Convert.ToDecimal(TB_PriceNormalRental.Text), Version_Price_Over = Convert.ToDecimal(TB_PriceOver.Text), Version_Price_Over_Riding = Convert.ToDecimal(TB_PriceOverRiding.Text), Version_Price_Riding = Convert.ToDecimal(TB_PriceRiding.Text), } )) { MessageBox.Show("添加车型成功!"); List_VersionInfo = CarSummery_Client.SelectAllCar().ToList(); LB_VersionBind(); } else { MessageBox.Show("添加车型失败,请检查拼写,如错误依旧,请联系管理员!", "错误!", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); } } }
private void MainForm_Load(object sender, EventArgs e) { if (TC_Main.TabPages.Count >= 1) { TC_Main.TabPages.Remove(TP_Monitor); TC_Main.TabPages.Remove(TP_Product); TC_Main.TabPages.Remove(TP_Recipe); } TB_Name.Focus(); }
public MainForm() { InitializeComponent(); TB_ipSetting.Text = PublicData.Ip; // TP_Monitor.en // TP_Monitor. TC_Main.TabPages.Remove(TP_Monitor); TC_Main.TabPages.Remove(TP_Product); TC_Main.TabPages.Remove(TP_Recipe); TB_Name.Focus(); }
private void TB_Name_TextChanged(object sender, EventArgs e) { var regx = new Regex("[^a-zA-Z0-9 _]"); if (regx.IsMatch(TB_Name.Text)) { TB_Name.Text = name.Replace(" ", "_"); } else { name = TB_Name.Text; } TB_Name.Focus(); TB_Name.SelectionStart = TB_Name.Text.Length; }
public void getDefault(string line) { TB_Name.Clear(); TB_Name.Text = line; }
private void MainForm_Load(object sender, EventArgs e) { TB_Name.Focus(); }
private void BT_UpdateVersion_Click(object sender, EventArgs e) { if (LB_Version.SelectedIndex < 0) { MessageBox.Show("您想要修改神马!!"); } if (TB_BaseKM.IsEmpty() && TB_Count.IsEmpty() && TB_Name.IsEmpty() && TB_Person.IsEmpty() && TB_PriceOver.IsEmpty() && TB_PriceMemberCatch.IsEmpty() && TB_PriceMemberRental.IsEmpty() && TB_PriceNormalCatch.IsEmpty() && TB_PriceNormalRental.IsEmpty() && TB_PriceOverRiding.IsEmpty() && TB_PriceRiding.IsEmpty() && TB_PriceDeposit.IsEmpty() && CB_Brand.SelectedIndex > 0 && CB_Type.SelectedIndex > 0 ) { List <Car_ViewModel> List_Temp = List_VersionInfo.Where( P => P.Province_Name == CB_Province.SelectedItem.ToString() && P.City_Name == CB_City.SelectedItem.ToString() && P.Shop_Name == CB_Shop.SelectedItem.ToString() ).ToList(); List <WFpart.ShopService.Car_Shop> Temp = List_Shop.Where( P => P.Shop_City == List_City.Where( T => T.City_Name == CB_City.SelectedItem.ToString() && T.City_Province == List_Car_Province.Where( K => K.Province_Name == CB_Province.SelectedItem.ToString()).Single().Province_ID).Single().City_ID ).ToList(); if (Version_Client.UpdateVersion(new VersionService.Car_Version() { Version_ID = List_Temp.Where(P => P.Version_Name == LB_Version.SelectedItem.ToString()).Single().Version_ID, Version_Shop = Temp.Where(P => P.Shop_Name == CB_Shop.SelectedItem.ToString()).Single().Shop_ID, Version_BaseKM = Convert.ToInt32(TB_BaseKM.Text), Version_Brand = List_Brand.Where(P => P.Brand_Name == CB_Brand.SelectedItem.ToString()).Single().Brand_ID, Version_Count = Convert.ToInt32(TB_Count.Text), Version_IMG = imgString, Version_Info = TB_Info.Text, Version_Name = TB_Name.Text, Version_Type = List_Type.Where(P => P.Type_Name == CB_Type.SelectedItem.ToString()).Single().Type_ID, Version_Person = Convert.ToInt32(TB_Person.Text), Version_Price_Deposit = Convert.ToDecimal(TB_PriceDeposit.Text), Version_Price_Member_Catch = Convert.ToDecimal(TB_PriceMemberCatch.Text), Version_Price_Member_Rental = Convert.ToDecimal(TB_PriceMemberRental.Text), Version_Price_Normal_Catch = Convert.ToDecimal(TB_PriceNormalCatch.Text), Version_Price_Normal_Rental = Convert.ToDecimal(TB_PriceNormalRental.Text), Version_Price_Over = Convert.ToDecimal(TB_PriceOver.Text), Version_Price_Over_Riding = Convert.ToDecimal(TB_PriceOverRiding.Text), Version_Price_Riding = Convert.ToDecimal(TB_PriceRiding.Text) })) { MessageBox.Show("修改车型成功!"); List_VersionInfo = CarSummery_Client.SelectAllCar().ToList(); LB_VersionBind(); } else { MessageBox.Show("修改车型失败,请检查拼写,如错误依旧,请联系管理员!", "错误!", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); } } }
private void TB_Name_DoubleClick(object sender, EventArgs e) { TB_Name.Clear(); }