protected void GroupingControlsView(Control collect) { try { foreach (Control cntrl in collect.Controls) { GroupingControlsView(cntrl); if (cntrl.Tag != null && cntrl.Tag.ToString() != "") { if (cntrl.Tag.ToString().Any(c => c == 'a')) { myAll.Add(cntrl); } else { throw new Exception("Ananymous caracter in All mode"); } } } } catch (Exception ex) { ItemsPublic.ShowMessage(ex.Message + "\n" + setErrMessage(ex)); //ItemsPublic.ShowMessage(ex.Message); // this.Close(); } }
public mainForm() { try { InitializeComponent(); objManager = new Manager(); myNew = new List <object>(); myEdit = new List <object>(); mySearch = new List <object>(); myDelete = new List <object>(); myView = new List <object>(); myAll = new List <object>(); objManager.InActiveTheme = office2010BlackTheme1; objManager.RBE = radLabelElementStatus; objManager.NewActive = myNew; objManager.EditActive = myEdit; objManager.SearchActive = mySearch; objManager.DeleteActive = myDelete; objManager.ViewActive = myView; objManager.EveryItems = myAll; } catch (Exception ex) { ItemsPublic.ShowMessage(ex.Message + "\n" + setErrMessage(ex)); // ItemsPublic.ShowMessage(ex.Message); this.Close(); } }
protected void SetProperties(DelegateRadGridSelectionChanged showMyProperties) { try { if (!ItemsPublic.IsnewRowAdded) { // MessageBox.Show(MainRadGridView.CurrentRow.Cells[0].Value.ToString()); if (MainRadGridView.SelectedRows.Count == 1) { showMyProperties(); } else { if (!copyingMode) { objManager.EmptyControls(myAll); } } } } catch (Exception ex) { //ItemsPublic.ShowMessage(ex.Message); ItemsPublic.IsnewRowAdded = false; ItemsPublic.ShowMessage(ex.Message + "\n" + setErrMessage(ex)); // this.Close(); } }
private void rbtnSearch_Click(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(rtbSearch.Text)) { return; } CursorWait(); rlblHint.Visible = false; var objManager = new Manager(); if (rrbPackId.IsChecked) { result = objManager.View_packages(false, null, null, null, null, null, null , null, null, null, null, null, ConvertNumbers.Base36ToInt64(rtbSearch.Text.Trim().ToUpper()).ToString(), null, null, null, 3); } else if (rrbGatePassId.IsChecked) { result = objManager.View_packages(false, null, null, null, null, null, null , null, null, null, null, null, null, ConvertNumbers.Base36ToInt64(rtbSearch.Text.Trim().ToUpper()).ToString(), null, null, 3); } else if (rrbNationalCode.IsChecked) { result = objManager.View_packages(false, null, null, null, null, null, null , null, null, null, null, rtbSearch.Text.Trim(), null, null, null, null, 3); } if (result.success) { if (result.ResultTable.Rows.Count > 0) { eventEndSearch(); } else { rlblHint.Visible = true; } //MainRadGridView.DataSource = result.ResultTable; // MainRadGridView.Enabled = true; //ItemsPublic.MyStatus = ItemsPublic.IndexStatus.toView; } else { MessageBox.Show(result.Message); } inFocus(); CursorDefault(); //Person_NationalCode = uC_PacksSearch1.rmebNationalCode.Text.Trim (); //this.DialogResult = DialogResult.OK; //this.Close (); } catch (Exception ex) { inFocus(); CursorDefault(); ItemsPublic.ShowMessage(ex.Message); } }
public frm_GlobalSetting() { try { InitializeComponent(); } catch (Exception ex) { ItemsPublic.ShowMessage(ex.Message); this.Close(); } }
public frm_EsiInputBox() { try { InitializeComponent(); } catch (Exception ex) { ItemsPublic.ShowMessage(ex.Message); this.Close(); } }
private void radStatusStrip1_Resize(object sender, EventArgs e) { try { this.radLabelElementStatus.Bounds = new System.Drawing.Rectangle(0, 0, radStatusStrip1.Width, 18); } catch (Exception ex) { ItemsPublic.ShowMessage(ex.Message + "\n" + setErrMessage(ex)); //ItemsPublic.ShowMessage(ex.Message); // this.Close(); } }
protected void cbbCancel_Click(object sender, EventArgs e) { try { //cbbView_Click(sender,e); MainRadGridView.Enabled = true; MainRadGridView.CurrentRow = null; objManager.ChangeStatus(aorc.gatepass.ItemsPublic.IndexStatus.toView); //ItemsPublic.MyStatus = ItemsPublic.IndexStatus.toView; } catch (Exception ex) { ItemsPublic.ShowMessage(ex.Message + "\n" + setErrMessage(ex)); //ItemsPublic.ShowMessage(ex.Message); // this.Close(); } }
protected void cbbView_Click(object sender, EventArgs e) { try { eventStatusView(); MainRadGridView.Enabled = true; objManager.ChangeStatus(aorc.gatepass.ItemsPublic.IndexStatus.toView); //ItemsPublic.sta = ItemsPublic.IndexStatus.toView; cbbSave_Click(sender, e); } catch (Exception ex) { ItemsPublic.ShowMessage(ex.Message + "\n" + setErrMessage(ex)); //ItemsPublic.ShowMessage(ex.Message); // this.Close(); } }
protected void cbbSearch_Click(object sender, EventArgs e) { try { eventStatusSearch(); MainRadGridView.Enabled = false; MainRadGridView.CurrentRow = null; MainRadGridView.Enabled = false; objManager.ChangeStatus(aorc.gatepass.ItemsPublic.IndexStatus.toSearch); //ItemsPublic.MyStatus = ItemsPublic.IndexStatus.toSearch; } catch (Exception ex) { ItemsPublic.ShowMessage(ex.Message + "\n" + setErrMessage(ex)); //ItemsPublic.ShowMessage(ex.Message); // this.Close(); } }
private void cbbDelete_Click(object sender, EventArgs e) { try { eventStatusDelete(); MainRadGridView.Enabled = true; objManager.ChangeStatus(aorc.gatepass.ItemsPublic.IndexStatus.toDelete); //ItemsPublic.MyStatus = ItemsPublic.IndexStatus.toDelete; cbbSave_Click(sender, e); cbbCancel_Click(sender, e); } catch (Exception ex) { ItemsPublic.ShowMessage(ex.Message + "\n" + setErrMessage(ex)); //ItemsPublic.ShowMessage(ex.Message); // this.Close(); } }
private void frm_GlobalSetting_Load(object sender, EventArgs e) { try { result = objManager.ClsGlobalSetting_View(); if (result.success) { ShowProperties(); } else { ItemsPublic.ShowMessage(result.Message); } } catch (Exception ex) { ItemsPublic.ShowMessage(ex.Message); } }
protected void justViewGrouping(Control collect) { try { foreach (Control cntrl in collect.Controls) { if (cntrl.Tag.ToString().Any(c => c == 'l')) { GroupingControlsView(cntrl); continue; } } } catch (Exception ex) { ItemsPublic.ShowMessage(ex.Message + "\n" + setErrMessage(ex)); //MessageBox.Show(ex.Message); this.Close(); } }
protected void cbbEdit_Click(object sender, EventArgs e) { try { eventStatusEdit(); if (!CheckOneSelectedRow(MainRadGridView.SelectedRows.Count) || !QuestionSureToEdit()) { return; } MainRadGridView.Enabled = false; objManager.ChangeStatus(aorc.gatepass.ItemsPublic.IndexStatus.toEdit); //ItemsPublic.MyStatus = ItemsPublic.IndexStatus.toEdit; } catch (Exception ex) { ItemsPublic.ShowMessage(ex.Message + "\n" + setErrMessage(ex)); //ItemsPublic.ShowMessage(ex.Message); // this.Close(); } }
private void rbtnImage_Click(object sender, EventArgs e) { try { ui.person.webCam frm = new ui.person.webCam(); frm.ShowDialog(); if (frm.ms.Length > 0) { Image bmp = Image.FromStream(frm.ms); pbImage.Image = bmp; if (getPicThenSetPic) { eventUpdatePic(); } } } catch (Exception ex) { ItemsPublic.ShowMessage(ex.Message); } }
protected void cbbEdit_Click(object sender, EventArgs e) { try { eventStatusEdit(); //if (!QuestionSureToEdit()) //{ // return; //} MainRadGridView.Enabled = false; objManager.ChangeStatus(aorc.gatepass.ItemsPublic.IndexStatus.toEdit); cbbSave_Click(sender, e); // //ItemsPublic.MyStatus = ItemsPublic.IndexStatus.toEdit; } catch (Exception ex) { ItemsPublic.ShowMessage(ex.Message + "\n" + setErrMessage(ex)); //ItemsPublic.ShowMessage(ex.Message); // this.Close(); } }
private void rbtnImage_Click(object sender, EventArgs e) { try { apaco.webcam.lib.main frm = new apaco.webcam.lib.main(); if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { //result goes to SelectedImage Field pbImage.Image = frm.SelectedImage; if (getPicThenSetPic) { eventUpdatePic(); } // Convert Image To Binary Array } frm.Dispose(); } catch (Exception ex) { ItemsPublic.ShowMessage(ex.Message); } }
protected void GroupingControls(Control collect) { try { foreach (Control cntrl in collect.Controls) { if (cntrl.Tag == null || cntrl.Tag.ToString() == "") { GroupingControls(cntrl); } else if (cntrl.Tag.ToString().Any(c => c == 'l')) { GroupingControlsView(cntrl); continue; } if (cntrl.Tag != null && cntrl.Tag.ToString() != "") { if (cntrl.Tag.ToString().Any(c => c == 'a')) { } else { throw new Exception("control have not 'a' caracter"); } //if ( cntrl is RadDropDownList ) //{ // MessageBox.Show ( cntrl.Name ); //} foreach (char c in cntrl.Tag.ToString()) { // d ro vase disable kardan gharar midim // edit =e , new = n , search = s , = d, view =v switch (c) { case 'e': myEdit.Add(cntrl); break; case 'n': myNew.Add(cntrl); break; case 's': mySearch.Add(cntrl); break; case 'd': myDelete.Add(cntrl); break; case 'v': myView.Add(cntrl); break; case 'a': myAll.Add(cntrl); break; case 'L': break; default: throw new Exception("Ananymous Caracter"); } } } } } catch (Exception ex) { ItemsPublic.ShowMessage(ex.Message + "\n" + setErrMessage(ex)); //MessageBox.Show(ex.Message); this.Close(); } }
protected void cbbSave_Click(object sender, EventArgs e) { result = new OutputDatas(); try { // result.Dispose(); switch (objManager.TypeStatus) { case ItemsPublic.IndexStatus.toDelete: #region toDelete if (!CheckOneSelectedRow(MainRadGridView.SelectedRows.Count) || !QuestionSureToDel()) { return; } CursorWait(); eventSaveToDelete(); CursorDefault(); if (result.success) { InfoDeleted(); MainRadGridView.CurrentRow.Delete(); } else { MessageBox.Show(result.Message); } break; #endregion case ItemsPublic.IndexStatus.toEdit: #region toEdit if (!CheckOneSelectedRow(MainRadGridView.SelectedRows.Count) || !QuestionSureToEdit()) { return; } CursorWait(); eventSaveToEdit(); CursorDefault(); if (result.success) { InfoEdited(); // this.MainRadGridView.ReadOnly = false; // this.MainRadGridView.AllowEditRow = true; // this.MainRadGridView.Enabled = true; foreach (DataColumn col in result.ResultTable.Columns) { // MainRadGridView.CurrentRow.Cells[col.ColumnName].ReadOnly = false; // MainRadGridView.CurrentRow.Cells[col.ColumnName].BeginEdit(); MainRadGridView.CurrentRow.Cells[col.ColumnName].Value = result.ResultTable.Rows[0][col.ColumnName]; // MainRadGridView.CurrentRow.Cells[col.ColumnName].EndEdit(); } // this.MainRadGridView.ReadOnly = true; // this.MainRadGridView.AllowEditRow = false; cbbCancel_Click(sender, e); } else { MessageBox.Show(result.Message); } break; #endregion case ItemsPublic.IndexStatus.toNew: #region toNew CursorWait(); eventSaveToNew(); CursorDefault(); if (result.success) { // eventClearProperiesItems(); objManager.EmptyControls(myAll); InfoAdded(); ItemsPublic.IsnewRowAdded = true; MainRadGridView.Rows.AddNew(); foreach (DataColumn col in result.ResultTable.Columns) { MainRadGridView.CurrentRow.Cells[col.ColumnName].Value = result.ResultTable.Rows[0][col.ColumnName]; } MainRadGridView.CurrentRow = null; ItemsPublic.IsnewRowAdded = false; } else { MessageBox.Show(result.Message); } break; #endregion case ItemsPublic.IndexStatus.toSearch: #region toSearch CursorWait(); eventSaveToSearch(); CursorDefault(); if (result.success) { objManager.ChangeStatus(aorc.gatepass.ItemsPublic.IndexStatus.toView); copyingMode = true; MainRadGridView.DataSource = result.ResultTable; MainRadGridView.Enabled = true; copyingMode = false; /// MainRadGridView.CurrentRow = MainRadGridView.CurrentRow; //ItemsPublic.MyStatus = ItemsPublic.IndexStatus.toView; } else { MessageBox.Show(result.Message); } break; #endregion case ItemsPublic.IndexStatus.toView: #region toView CursorWait(); eventSaveToView(); CursorDefault(); if (result.success) { copyingMode = true; MainRadGridView.DataSource = result.ResultTable; copyingMode = false; MainRadGridView.Enabled = true; // MainRadGridView.CurrentRow = MainRadGridView.CurrentRow; } else { MessageBox.Show(result.Message); } break; #endregion } eventAfterSave(); } catch (Exception ex) { CursorDefault(); if (result == null) { ItemsPublic.ShowMessage(ItemsPublic._errConnection); } else { ItemsPublic.ShowMessage(ex.Message + "\n" + setErrMessage(ex)); } //ItemsPublic.ShowMessage(ex.Message); // this.Close(); } }
protected void cbbSave_Click(object sender, EventArgs e) { result = new OutputDatas(); try { // result.Dispose(); switch (objManager.TypeStatus) { case ItemsPublic.IndexStatus.toDelete: #region toDelete if (!CheckOneSelectedRow(MainRadGridView.SelectedRows.Count) || !QuestionSureToDel()) { return; } CursorWait(); eventSaveToDelete(); CursorDefault(); if (result.success) { InfoDeleted(); MainRadGridView.CurrentRow.Delete(); } else { MessageBox.Show(result.Message); } break; #endregion case ItemsPublic.IndexStatus.toEdit: #region toEdit if (!CheckOneSelectedRow(MainRadGridView.SelectedRows.Count)) { cbbCancel_Click(sender, e); return; } CursorWait(); eventSaveToEdit(); cbbCancel_Click(sender, e); // CursorWait(); // cbbView_Click(null, null); CursorDefault(); break; #endregion case ItemsPublic.IndexStatus.toNew: #region toNew CursorWait(); eventSaveToNew(); CursorDefault(); if (result != null) { if (result.success) { // eventClearProperiesItems(); objManager.EmptyControls(myAll); // InfoAdded(); //ItemsPublic.IsnewRowAdded = true; //MainRadGridView.Rows.AddNew(); //ItemsPublic.IsnewRowAdded = false; //foreach (DataColumn col in result.ResultTable.Columns) //{ // MainRadGridView.CurrentRow.Cells[col.ColumnName].Value = // result.ResultTable.Rows[0][col.ColumnName]; //} MainRadGridView.CurrentRow = null; // uc } else { MessageBox.Show(result.Message); } } cbbCancel_Click(sender, e); break; #endregion case ItemsPublic.IndexStatus.toSearch: #region toSearch CursorWait(); eventSaveToSearch(); CursorDefault(); break; #endregion case ItemsPublic.IndexStatus.toView: #region toView CursorWait(); eventSaveToView(); CursorDefault(); if (result.success) { MainRadGridView.DataSource = result.ResultTable; MainRadGridView.Columns["package_Id"].SortOrder = RadSortOrder.Descending; if (MainRadGridView.Rows.Count() > 0) { MainRadGridView.CurrentRow = MainRadGridView.Rows[MainRadGridView.Rows.Count() - 1]; } MainRadGridView.Enabled = true; } else { MessageBox.Show(result.Message); } break; #endregion } MainRadGridView.CurrentRow = null; eventAfterSave(); } catch (Exception ex) { CursorDefault(); if (result == null) { ItemsPublic.ShowMessage(ItemsPublic._errConnection); } else { ItemsPublic.ShowMessage(ex.Message + "\n" + setErrMessage(ex)); } //ItemsPublic.ShowMessage(ex.Message); // this.Close(); } }
protected void cbbNew_Click(object sender, EventArgs e) { try { // eventStatusNew(); //MainRadGridView.Enabled = false; // MainRadGridView.CurrentRow = null; // MainRadGridView.ClearSelection(); // objManager.ChangeStatus(aorc.gatepass.ItemsPublic.IndexStatus.toNew); //ItemsPublic.MyStatus = ItemsPublic.IndexStatus.toNew; var frmAddPersons = new gatepass.ui.package.frm_SelectOrAddPersons4(); //// frmAddPersons.pmStatus = ItemsPublic.IndexStatus.toEdit; // // frmAddPersons.IndexPack = (decimal?)MainRadGridView.CurrentRow.Cells["package_Id"].Value; // // frmAddPersons.setItemsPack(ref radGridViewPacks); //frmAddPersons.radGridViewSelected = MainRadGridView; frmAddPersons.ShowDialog(); if (frmAddPersons.State) { //MainRadGridView.DataSource=null; //MainRadGridView.SelectAll(); MainRadGridView.AllowAddNewRow = true; ItemsPublic.IsnewRowAdded = true; MainRadGridView.CurrentRow = null; while (MainRadGridView.Rows.Count > 0) { MainRadGridView.Rows[0].Delete(); } for (int count = 0; count < frmAddPersons.radGridViewSelected.Rows.Count; count++) { MainRadGridView.Rows.AddNew(); MainRadGridView.CurrentRow.Cells["Person_ID"].Value = frmAddPersons.radGridViewSelected.Rows[count].Cells["Person_ID"].Value; MainRadGridView.CurrentRow.Cells["Person_NationalCode"].Value = frmAddPersons.radGridViewSelected.Rows[count].Cells["Person_NationalCode"].Value; MainRadGridView.CurrentRow.Cells["Person_isWoman"].Value = frmAddPersons.radGridViewSelected.Rows[count].Cells["Person_isWoman"].Value; MainRadGridView.CurrentRow.Cells["Person_IdentifyCode"].Value = frmAddPersons.radGridViewSelected.Rows[count].Cells["Person_IdentifyCode"].Value; MainRadGridView.CurrentRow.Cells["Person_LicenseDriverCode"].Value = frmAddPersons.radGridViewSelected.Rows[count].Cells["Person_LicenseDriverCode"].Value; MainRadGridView.CurrentRow.Cells["Person_Name"].Value = frmAddPersons.radGridViewSelected.Rows[count].Cells["Person_Name"].Value; MainRadGridView.CurrentRow.Cells["Person_Surname"].Value = frmAddPersons.radGridViewSelected.Rows[count].Cells["Person_Surname"].Value; MainRadGridView.CurrentRow.Cells["Person_FatherName"].Value = frmAddPersons.radGridViewSelected.Rows[count].Cells["Person_FatherName"].Value; MainRadGridView.CurrentRow.Cells["Person_BirthCity"].Value = frmAddPersons.radGridViewSelected.Rows[count].Cells["Person_BirthCity"].Value; MainRadGridView.CurrentRow.Cells["Person_RegisterCity"].Value = frmAddPersons.radGridViewSelected.Rows[count].Cells["Person_RegisterCity"].Value; MainRadGridView.CurrentRow.Cells["Person_Nationality"].Value = frmAddPersons.radGridViewSelected.Rows[count].Cells["Person_Nationality"].Value; MainRadGridView.CurrentRow.Cells["Person_BirthDate"].Value = frmAddPersons.radGridViewSelected.Rows[count].Cells["Person_BirthDate"].Value; MainRadGridView.CurrentRow.Cells["Person_Phone1"].Value = frmAddPersons.radGridViewSelected.Rows[count].Cells["Person_Phone1"].Value; MainRadGridView.CurrentRow.Cells["Person_Phone2"].Value = frmAddPersons.radGridViewSelected.Rows[count].Cells["Person_Phone2"].Value; MainRadGridView.CurrentRow.Cells["Person_Picture"].Value = frmAddPersons.radGridViewSelected.Rows[count].Cells["Person_Picture"].Value; MainRadGridView.CurrentRow.Cells["Person_HaveForm"].Value = frmAddPersons.radGridViewSelected.Rows[count].Cells["Person_HaveForm"].Value; MainRadGridView.CurrentRow.Cells["Person_RegisterCode"].Value = frmAddPersons.radGridViewSelected.Rows[count].Cells["Person_RegisterCode"].Value; MainRadGridView.CurrentRow.Cells["Person_LabelIsWoman"].Value = frmAddPersons.radGridViewSelected.Rows[count].Cells["Person_LabelIsWoman"].Value; MainRadGridView.CurrentRow.Cells["Gatepass_ID"].Value = -1; MainRadGridView.CurrentRow.Cells["GatePass_IntPrint"].Value = -1; MainRadGridView.CurrentRow.Cells["GatePass_IsDriver"].Value = false; MainRadGridView.CurrentRow.Cells["GatePass_TimeLock"].Value = -1; MainRadGridView.CurrentRow.Cells["GatePass_LockerId"].Value = -1; //MainRadGridView.CurrentRow.Cells["package_Id"].Value = } MainRadGridView.AllowAddNewRow = false; ItemsPublic.IsnewRowAdded = false; MainRadGridView.Refresh(); //radGridViewPackManage.Enabled = true; } frmAddPersons.Close(); frmAddPersons.Dispose(); } catch (Exception ex) { ItemsPublic.ShowMessage(ex.Message + "\n" + setErrMessage(ex)); //ItemsPublic.ShowMessage(ex.Message); // this.Close(); } }
protected void InfoAdded() { ItemsPublic.ShowMessage(ItemsPublic._infoNew); }
protected void InfoEdited() { ItemsPublic.ShowMessage(ItemsPublic._infoEdit); }
protected void InfoDeleted() { ItemsPublic.ShowMessage(ItemsPublic._infoDel); }
protected void GroupingRadObjects(RadItemCollection collect) { try { foreach (RadItem cntrl in collect) { //if (cntrl.Tag == null || cntrl.Tag.ToString() == "") //{ // GroupingRadObjects(cntrl); //} if (cntrl.Tag != null && cntrl.Tag.ToString() != "") { if (cntrl.Tag.ToString().Any(c => c == 'a')) { } else { throw new Exception("Radboject have not 'a' caracter"); } foreach (char c in cntrl.Tag.ToString()) { // d ro vase disable kardan gharar midim // edit =e , new = n , search = s , = d, view =v switch (c) { case 'e': myEdit.Add(cntrl); break; case 'n': myNew.Add(cntrl); break; case 's': mySearch.Add(cntrl); break; case 'd': myDelete.Add(cntrl); break; case 'v': myView.Add(cntrl); break; case 'a': myAll.Add(cntrl); break; case 'L': break; default: throw new Exception("Ananymous Caracter"); } } } } } catch (Exception ex) { ItemsPublic.ShowMessage(ex.Message + "\n" + setErrMessage(ex)); //ItemsPublic.ShowMessage(ex.Message); this.Close(); } }