public NewUnitRadForm(RadForm parent, StateForm state) { InitializeComponent(); this.parentForm = parent; this.stateForm = state; this._serviceUnitBL = new UnitBL(); }
private void ProcessState(StateForm state) { switch (state) { case StateForm.NEW: SetUpFormName("Nueva Categoria", "Registrar"); break; case StateForm.EDIT: this.RegisterRadButton.Image = KoontabiTelerikWinFormsApp.Properties.Resources.Update; SetUpFormName("Editar Categoria", "Actualizar"); GetAndLoadCategoryFromDB(); break; case StateForm.SEE_MORE: GetAndLoadCategoryFromDB(); CodeCategoryRadTextBox.Enabled = false; CategoryRadTextBox.Enabled = false; DescriptionRadRichTextEditor.Enabled = false; SetUpFormName("Ver Categoria", "Aceptar", "Cerrar"); break; } }
public NewInvoiceRadForm(InvoiceRadForm parentForm, Invoice currentInvoiceToEdit, StateForm stateForm) { this._stateForm = stateForm; InitForm(); this._currentParentForm = parentForm; this._currentInvoiceToEdit = currentInvoiceToEdit; }
private void ProcessState(StateForm state) { switch (state) { case StateForm.NEW: SetUpFormName("Nueva Unidad de Medida", "Registrar"); break; case StateForm.EDIT: GetAndLoadUnitFromDB(); this.RegisterRadButton.Image = KoontabiTelerikWinFormsApp.Properties.Resources.Update; SetUpFormName("Editar Unidad de Medida", "Actualizar"); break; case StateForm.SEE_MORE: GetAndLoadUnitFromDB(); UnitDescriptionRadTextBox.Enabled = false; AbbreviationRadTextBox.Enabled = false; SetUpFormName("Ver Unidad de Medida", "Aceptar", "Cerrar"); break; } }
/// <summary> /// 通过反射,加载对应的页面 /// </summary> /// <param name="assemblyName">DLL文件</param> /// <param name="funcClassName">类名</param> /// <param name="funcName">打开的窗体名</param> /// <returns>True成功</returns> private bool OpenFormFunc(string assemblyName, string funcClassName, string funcName, string moduleCode) { StateForm stateForm = new StateForm(); stateForm.ShowMessage(); try { Assembly assembly = Assembly.LoadFrom(Application.StartupPath + "\\" + assemblyName); Type typeToLoad = assembly.GetType(funcClassName); FineEx.Control.Forms.BaseForm frm = (FineEx.Control.Forms.BaseForm)Activator.CreateInstance(typeToLoad); frm.ModuleCode = moduleCode; if (frm.DockType != DockContainerType.Document) { frm.DockType = DockContainerType.Document; } bool flag = MainForm.ShowCenter(frm, funcName); if (!flag) { return(MainForm.ShowCenter(frm, funcName)); } return(true); } catch (Exception ex) { MessageBox.Show(ex.Message, @"错误", MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } finally { stateForm.Close(); } }
public NewCategoryRadForm(RadForm form, StateForm state) { InitializeComponent(); this.state = state; this._serviceCategoryBL = new CategoryBL(); this._currentParentForm = form; }
public void ControlReadOnly(StateForm stateForm) { switch (stateForm) { case StateForm.Editing: SetReadOnly(true); break; case StateForm.Inserting: SetReadOnly(true); break; case StateForm.Viewing: SetReadOnly(false); break; case StateForm.Waiting: SetReadOnly(false); break; case StateForm.NoConfirmed: SetReadOnly(true); break; } }
private void menuItem_PatchPSXSaveState_Click(object sender, EventArgs e) { SaveFormData(); if (StateForm.InitDialog(_dataHelper, _entryData, GetSelectedIndexResult(), StateForm.Mode.Patch) == DialogResult.OK) { //PatcherLib.MyMessageBox.Show(this, "Complete!", "Complete!", MessageBoxButtons.OK); } }
private void menuItem_LoadPSXSaveState_Click(object sender, EventArgs e) { SaveFormData(); if (StateForm.InitDialog(_dataHelper, _entryData, GetSelectedIndexResult(), StateForm.Mode.Load) == DialogResult.OK) { PopulateTabs(); } }
private void barButtonState_ItemClick(object sender, ItemClickEventArgs e) { StateForm xform1 = new StateForm(_FlexSys) { MdiParent = this }; xform1.Show(); }
private void mnuManageExit_Click(object sender, EventArgs e) { this.Hide(); UserForm = null; AddressForm = null; CountryForm = null; StateForm = null; reLogin.Call(); this.Close(); }
private void dataGridView1_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e) { int index = e.RowIndex; phong.Map = this.dataGridView1[0, index].Value.ToString(); phong.TenP = this.dataGridView1[1, index].Value.ToString(); phong.DiaChiP = this.dataGridView1[2, index].Value.ToString(); phong.SDT = this.dataGridView1[3, index].Value.ToString(); bind.setObject(phong); state = StateForm.Edit; }
public ControlForm setState(StateForm state) { if (state == StateForm.None) { this.State_None(); } if (state == StateForm.Show) { this.State_Show(); } this.state = state; return(this); }
private void btn_them_Click(object sender, EventArgs e) { list_bt.ForEach(item => { item.Enabled = true; }); this.btn_add.Enabled = false; this.btn_cancel.Enabled = true; this.btn_save.Enabled = true; this.btn_edit.Enabled = false; this.btn_del.Enabled = false; ActionClick.action(StateForm.None); state = StateForm.New; }
private void mnuManageState_Click(object sender, EventArgs e) { if (objstateForm == null) { objstateForm = new StateForm(); objstateForm.Show(); objstateForm.MdiParent = this; objstateForm.FormClosing += ObjstateForm_FormClosing; } else { objUserDetail.Activate(); } }
private void mnuManageState_Click(object sender, EventArgs e) { if (StateForm == null) { StateForm = new StateForm(); StateForm.Show(); StateForm.MdiParent = this; StateForm.FormClosing += StateForm_FormClosing; } else { StateForm.Activate(); } }
private void btn_sua_Click(object sender, EventArgs e) { list_bt.ForEach(item => { if (key != item) { item.Enabled = true; } }); this.btn_add.Enabled = false; this.btn_cancel.Enabled = true; this.btn_save.Enabled = true; this.btn_edit.Enabled = false; this.btn_del.Enabled = false; state = StateForm.Edit; }
private void Started(StartedEventArgs e) { if (!(Form is null)) { DisposeForm(); } MenuItem.Checked = false; // 独自のフォーム(ウィンドウ)を表示可能 Form = new StateForm(); Form.FormClosing += FormClosing; Form.WindowState = FormWindowState.Normal; MenuItem.Checked = true; BveHacker.MainForm.Focus(); }
public bool action(StateForm state) { if (state == StateForm.None) { this.quyetdinh = new QuyetDinh { ngayQD = DateTime.Now }; form.setObject(quyetdinh); return(true); } if (state == StateForm.New || state == StateForm.Edit) { quyetdinh.MaNV = (new handerNhanVien()).GetValue(cb_manv).ToString(); if (form.isValidation()) { if (state == StateForm.New) { _data.add(quyetdinh); } if (state == StateForm.Edit) { _data.update(quyetdinh); } } else { MessageBox.Show(form.getErrors()[0]); return(false); } } if (state == StateForm.Del) { _data.delete(quyetdinh); } this.quyetDinhBindingSource.DataSource = _data.getList(); this.Refresh(); return(true); }
public bool action(StateForm state) { if (state == StateForm.None) { this.nhanvien = new NhanVien { NamSinh = DateTime.Now, GioiTinh = "nam" }; this.cb_gt.Checked = true; form.setObject(nhanvien); return(true); } if (state == StateForm.New || state == StateForm.Edit) { if (form.isValidation()) { if (state == StateForm.New) { _data.add(nhanvien); } if (state == StateForm.Edit) { _data.update(nhanvien); } } else { MessageBox.Show(form.getErrors()[0]); return(false); } } if (state == StateForm.Del) { _data.delete(nhanvien); } this.nhanVienBindingSource.DataSource = _data.getList(); this.Refresh(); return(true); }
public bool action(StateForm state) { if (state == StateForm.None) { this.hopdong = new HopDong { ngayHD = DateTime.Now, ngayKT = DateTime.Now }; form.setObject(hopdong); return(true); } if (state == StateForm.New || state == StateForm.Edit) { hopdong.MaNV = (new handerNhanVien()).GetValue(cb_mavn).ToString(); if (form.isValidation()) { if (state == StateForm.New) { _data.add(hopdong); } if (state == StateForm.Edit) { _data.update(hopdong); } } else { MessageBox.Show(form.getErrors()[0]); return(false); } } if (state == StateForm.Del) { _data.delete(hopdong); } this.hopDongBindingSource.DataSource = _data.getList(); this.Refresh(); return(true); }
public NewProductRadForm(ProductRadForm currentParentForm, StateForm stateForm) { InitializeComponent(); this._stateForm = stateForm; this._serviceProductBL = new ProductBL(); this._serviceCategoryBL = new CategoryBL(); this._serviceUnitBL = new UnitBL(); this._serviceTaxBL = new TaxBL(); this._currentParentForm = currentParentForm; this.CategoryIDComboBox.DataSource = this._serviceCategoryBL.GetCategories(); this.CategoryIDComboBox.DisplayMember = "CategoryName"; this.CategoryIDComboBox.ValueMember = "CategoryID"; this.UnitIDComboBox.DataSource = this._serviceUnitBL.Sp_GetUnits(); this.UnitIDComboBox.DisplayMember = "UnitDescription"; this.UnitIDComboBox.ValueMember = "UnitID"; this.TaxIDComboBox.DataSource = this._serviceTaxBL.Sp_Taxes(); this.TaxIDComboBox.DisplayMember = "TaxDescription"; this.TaxIDComboBox.ValueMember = "TaxID"; }
private void btn_luu_Click(object sender, EventArgs e) { if (ActionClick != null) { if (!ActionClick.action(state)) { return; } ; } list_bt.ForEach(item => { item.Enabled = false; }); this.btn_add.Enabled = true; this.btn_cancel.Enabled = false; this.btn_save.Enabled = false; this.btn_edit.Enabled = false; this.btn_del.Enabled = false; ActionClick.action(StateForm.None); state = StateForm.None; }
public bool action(StateForm state) { if (state == StateForm.None) { this.phong = new Phong(); form.setObject(phong); return(true); } if (state == StateForm.New || state == StateForm.Edit) { if (form.isValidation()) { if (state == StateForm.New) { _data.add(phong); } if (state == StateForm.Edit) { _data.update(phong); } } else { MessageBox.Show(form.getErrors()[0]); return(false); } } if (state == StateForm.Del) { _data.delete(phong); } this.phongBindingSource.DataSource = _data.getList(); this.Refresh(); return(true); }
private ArrayList FormPersonList(StateForm state) { ArrayList People = new ArrayList(); Person Pers; Posts Post; var Dvor = Strana.Dvor; var Gov = Strana.Government; if (state == StateForm.counsil) { // FormListForCounsil for (int i = 0; i < Gov.GetSize(); i++) { Post = Gov.GetPost(i); if (Post.isCounsillor && Post.GetHolder() != null) { People.Add(Post.GetHolder()); } } } else if (state == StateForm.audience) { // FormListForAudience for (int i = 0; i < Dvor.CourtSize; i++) { Pers = Dvor.GetPerson(i); if (Pers.isInvited) { People.Add(Pers); } } } else if (state == StateForm.stranger) { // FormListForStrangers // ... } return(People); }
public NewCustomerRadForm(CustomerRadForm _currentForm, StateForm stateForm) { InitComponentAndData(); this._currentParentForm = _currentForm; this._stateForm = stateForm; }
private void FillCounsilForm(StateForm state) { Button Knop; Image Img; Sprite Sprite1; Person Pers; // это просто названия кнопок, переводить не надо // string[] objectname = {""}; ArrayList PList; string PersList = "", comma = "; "; int PCount; bool activate; if (state == StateForm.init) { CounsilFaceView.gameObject.SetActive(false); StartCons.gameObject.SetActive(false); //PList = FormPersonList (state); PCount = GetWaitingNumber(); TextvOkno(ConsText, CounsilStrings[0] + PCount + CounsilStrings[1]); } else if (state == StateForm.clear) { FindAndDestroyAllFaceButtons(); } else { StateFlag = state; CounsilFaceView.gameObject.SetActive(true); PList = FormPersonList(state); FindAndDestroyAllFaceButtons(); for (int i = 0; i < PList.Count; i++) { // в цикле создаем кнопки, прикрепляем к ним лица и пихаем в полосу Knop = Instantiate(prefabB); Knop.gameObject.name = "FaceButton" + i; Img = Knop.gameObject.GetComponent <Image>(); if ((Pers = (Person)PList[i]) != null && (Sprite1 = Parent.GetSprite(Pers)) != null) { Img.sprite = Sprite1; Img.transform.localScale = new Vector3(.5f, .5f, .5f); // resize // вставляем в полосу скролвью, объекты сами подгоняются под нее Knop.gameObject.transform.SetParent(CounsilContent.gameObject.transform); } if (i >= PList.Count - 1) { comma = ". "; } PersList += Pers.Name + comma; } if (PList.Count == 0) { PersList = CounsilStrings[3]; activate = false; } else { PersList += CounsilStrings[4]; activate = true; } if (state == StateForm.counsil) { PersList += CounsilStrings[5]; } TextvOkno(ConsText, CounsilStrings[2] + PersList); StartCons.gameObject.SetActive(activate); } }
private void ObjstateForm_FormClosing(object sender, FormClosingEventArgs e) { objstateForm = null; }
private void btnThem_Click(object sender, EventArgs e) { state = StateForm.New; phong = new Phong(); bind.setObject(phong); }
private void treeView1_DoubleClick(object sender, EventArgs e) //从光标所在的位置得到该位置上的节点 { TreeNode node = this.treeView1.GetNodeAt(pi); if (pi.X < node.Bounds.Left || pi.X > node.Bounds.Right) { //不触发事件; } else if (node.Parent != null) { int parent = int.Parse(node.Parent.Name); //传感器 if (node.Index == (int.Parse(AGV.Sensor.Key) - 1)) { try { sensorForm[parent].WindowState = FormWindowState.Normal; sensorForm[parent].Show(); //弹出这个窗口 sensorForm[parent].Activate(); //激活显示 } catch (Exception) { sensorForm[parent] = new SensorForm(int.Parse(node.Parent.Name)); sensorForm[parent].Show();//弹出这个窗口 } } //运行状态 else if (node.Index == (int.Parse(AGV.State.Key) - 1)) { try { stateForm[parent].WindowState = FormWindowState.Normal; stateForm[parent].Show(); //弹出这个窗口 stateForm[parent].Activate(); //激活显示 } catch (Exception) { stateForm[parent] = new StateForm(int.Parse(node.Parent.Name)); stateForm[parent].Show();//弹出这个窗口 } } //远程操作 else if (node.Index == (int.Parse(AGV.Control.Key) - 1)) { try { controlForm[parent].WindowState = FormWindowState.Normal; controlForm[parent].Show(); //弹出这个窗口 controlForm[parent].Activate(); //激活显示 } catch (Exception) { controlForm[parent] = new ControlForm(int.Parse(node.Parent.Name)); controlForm[parent].Show();//弹出这个窗口 } } //参数设置 else if (node.Index == (int.Parse(AGV.Set.Key) - 1)) { try { setForm[parent].WindowState = FormWindowState.Normal; setForm[parent].Show(); //弹出这个窗口 setForm[parent].Activate(); //激活显示 } catch (Exception) { setForm[parent] = new SetForm(int.Parse(node.Parent.Name)); setForm[parent].Show();//弹出这个窗口 } } //寄存器 else if (node.Index == (int.Parse(AGV.Register.Key) - 1)) { try { registerForm[parent].WindowState = FormWindowState.Normal; registerForm[parent].Show(); //弹出这个窗口 registerForm[parent].Activate(); //激活显示 } catch (Exception) { registerForm[parent] = new RegisterForm(int.Parse(node.Parent.Name)); registerForm[parent].Show();//弹出这个窗口 } } } }