public string ReturnSaveIfNew() { if (rddlLocations.SelectedIndex == -1 || rddlLocations.Text != rddlLocations.Items [rddlLocations.SelectedIndex].Text) { if (ItemsPublic.AllNationality.Rows.Cast <DataRow>().Any(item => item ["Nationality_Name"].ToString().Trim() == rddlLocations.Text.Trim())) { rddlLocations.Items.Add(rddlLocations.Text.Trim()); return(rddlLocations.Text.Trim()); } var objManager2 = new Manager(); var Result = objManager2.ClsLocations_Nationality_insert(rddlLocations.Text); if (!Result.success) { ItemsPublic.Exeptor(Result.Message); } //indexSelectLocation = ( int ) Result.ResultTable.Rows [0] ["Nationality_Id"]; //rddlLocations.Items.Add ( ( string ) Result.ResultTable.Rows [0] ["Nationality_Name"] ); ItemsPublic.AllNationality.Rows.Add(Result.ResultTable.Rows [0] ["Nationality_Id"], Result.ResultTable.Rows [0] ["Nationality_Name"]); } string temp = rddlLocations.Text.Trim(); //SetAllLocations (); // this.rddlLocations.SelectedIndex = setItem(temp); return(temp); }
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(); } }
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(); } }
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 static void copyGridBack01(GridViewSelectedRowsCollection CopyFrom, RadGridView ToCopy) { foreach (GridViewRowInfo itemRow in CopyFrom) { // ToCopy.CurrentRow = null; // ToCopy.AllowAddNewRow = true; ToCopy.Rows.AddNew(); foreach (GridViewDataColumn col in ToCopy.Columns) { try { // ToCopy.Rows[ToCopy.Rows.Count - 1] = itemRow; // GridViewCellInfo col in itemRow.Cells for (int i = 0; i < itemRow.Cells.Count; i++) { if (itemRow.Cells[i].ColumnInfo.FieldName == col.FieldName) { ToCopy.Rows[ToCopy.Rows.Count - 1].Cells[col.FieldName].Value = itemRow.Cells[col.FieldName].Value; break; } } } catch (Exception ex) { try { if (col.FieldName == "Person_Picture") { var ms = new System.IO.MemoryStream(); var Picture = ((Bitmap)itemRow.Cells[col.FieldName].Value); Picture.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); ToCopy.Rows[ToCopy.Rows.Count - 1].Cells[col.FieldName].Value = ms.ToArray(); } else { ItemsPublic.Exeptor(col.Name + "\r\n" + ex.Message); } } catch (Exception ex2) { ItemsPublic.Exeptor(col.Name + "\r\n" + ex.Message + "\r\n" + ex2.Message); } } ToCopy.Rows[ToCopy.Rows.Count - 1].Cells["GatePass_State"].Value = true; ToCopy.Rows[ToCopy.Rows.Count - 1].Cells["GatePass_IsExpired"].Value = false; ToCopy.Rows[ToCopy.Rows.Count - 1].Cells["Gatepass_ID"].Value = null; } } }
public frm_EsiInputBox() { try { InitializeComponent(); } catch (Exception ex) { ItemsPublic.ShowMessage(ex.Message); this.Close(); } }
public frm_GlobalSetting() { try { InitializeComponent(); } catch (Exception ex) { ItemsPublic.ShowMessage(ex.Message); this.Close(); } }
//private int? indexSelectLocation //{ // get // { // return rddlLocations.SelectedIndex > -1 // ? (int?) ItemsPublic.AllNationality.Rows[rddlLocations.SelectedIndex]["Nationality_Id"] // : null; // } // set { rddlLocations.SelectedIndex = value != null ? SetrddlLocation((int) value) : -1; } //} // private OutputDatas Result = new OutputDatas(); private int SetrddlLocation(int inLocId) { for (int i = 0; i < ItemsPublic.AllNationality.Rows.Count; i++) { if ((int)ItemsPublic.AllNationality.Rows[i]["Nationality_Id"] == inLocId) { return(i); } } ItemsPublic.Exeptor("کشور مورد نظر یافت نشد"); return(-1); }
private int SetrddlType(int type) { for (int i = 0; i < types.ResultTable.Rows.Count; i++) { if (( int )types.ResultTable.Rows [i] ["BLReason_ID"] == type) { return(i); } } ItemsPublic.Exeptor("دلیل لیست سیاه یافت نشد"); return(-1); }
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(); } }
public static void copyGrid2(RadGridView CopyFrom, RadGridView ToCopy) { if (ToCopy.Rows.Count > 0) { while (ToCopy.Rows.Count > 0) { ToCopy.Rows.RemoveAt(0); } } foreach (GridViewDataRowInfo itemRow in CopyFrom.Rows) { ToCopy.Rows.AddNew(); foreach (GridViewDataColumn col in CopyFrom.Columns) { try { ToCopy.Rows[ToCopy.Rows.Count - 1].Cells[col.Name].Value = itemRow.Cells[col.Name].Value; } catch (Exception ex) { try { if (col.Name == "Person_Picture") { var ms = new System.IO.MemoryStream(); var Picture = ((Bitmap)itemRow.Cells[col.Name].Value); Picture.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); ToCopy.Rows[ToCopy.Rows.Count - 1].Cells[col.Name].Value = ms.ToArray(); } else { ItemsPublic.Exeptor(col.Name + "\r\n" + ex.Message); } } catch (Exception ex2) { ItemsPublic.Exeptor(col.Name + "\r\n" + ex.Message + "\r\n" + ex2.Message); } } ToCopy.Rows[ToCopy.Rows.Count - 1].Cells["GatePass_State"].Value = false; ToCopy.Rows[ToCopy.Rows.Count - 1].Cells["GatePass_IsExpired"].Value = false; ToCopy.Rows[ToCopy.Rows.Count - 1].Cells["Gatepass_ID"].Value = null; } } }
private int SetrddlType(int type) { // VehicleType_ID VehicleType_Name for (int i = 0; i < DtModels.Rows.Count; i++) { if ((int)DtModels.Rows[i]["VehicleType_ID"] == type) { return(i); } } ItemsPublic.Exeptor("نوع خودرو یافت نشد"); return(-1); }
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 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(); } }
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(); } }
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 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(); } }
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 { 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); } }
public static void SetAllLocations() { Manager objManager2 = new Manager(); OutputDatas Result = new OutputDatas(); //DtModels = null; //DtModels = new DataTable (); //DtModels.Columns.Add ( "VehicleType_ID" , typeof ( decimal ) ); //DtModels.Columns.Add ( "VehicleType_Name" , typeof ( string ) ); //DtModels.Columns.Add ( "VehicleType_Desc" , typeof ( string ) ); //DtModels.Columns.Add ( "VehicleType_Hidden" , typeof ( bool ) ); Result = objManager2.View_Nationalities(); AllNationality = new DataTable(); AllNationality.Columns.Add("Nationality_Id", typeof(int)); AllNationality.Columns.Add("Nationality_Name", typeof(string)); AllCity = new DataTable(); AllCity.Columns.Add("City_Id", typeof(int)); AllCity.Columns.Add("City_Name", typeof(string)); if (!Result.success) { ItemsPublic.Exeptor(Result.Message); } foreach (DataRow item in Result.ResultTable.Rows) { AllNationality.Rows.Add(item["Nationality_Id"], item["Nationality_Name"]); } Result = objManager2.View_Cities(); if (!Result.success) { ItemsPublic.Exeptor(Result.Message); } foreach (DataRow item in Result.ResultTable.Rows) { AllCity.Rows.Add(item["City_Id"], item["City_Name"]); } }
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); } }
public void SetAllTypeBLReasons() { Manager objManager2 = new Manager(); //DtModels = null; //DtModels = new DataTable (); //DtModels.Columns.Add ( "VehicleType_ID" , typeof ( decimal ) ); //DtModels.Columns.Add ( "VehicleType_Name" , typeof ( string ) ); //DtModels.Columns.Add ( "VehicleType_Desc" , typeof ( string ) ); //DtModels.Columns.Add ( "VehicleType_Hidden" , typeof ( bool ) ); types = objManager2.View_bLreasons(null); if (!types.success) { ItemsPublic.Exeptor("خطا در بازآوری اطلاعات دلایل مسدود سازی"); } // DtModels = types.ResultTable.Copy (); //foreach (var row in Models.ResultTable.Rows) //rddlBLReasonType.Items.AddRange ( new string [] { types.ResultTable.} ); for (int index = 0; index < types.ResultTable.Rows.Count; index++) { rddlBLReasonType.Items.Add((string)types.ResultTable.Rows[index]["BLReason_Type"]); } }
public string ReturnSaveIfNew() { int indexCurrent = rddlLocations.SelectedIndex; if (!string.IsNullOrEmpty(rddlLocations.Text.Trim())) { if (rddlLocations.SelectedIndex == -1 || rddlLocations.Text != rddlLocations.Items [rddlLocations.SelectedIndex].Text) { if (ItemsPublic.AllCity.Rows.Cast <DataRow>().Any(item => item ["City_Name"].ToString().Trim() == rddlLocations.Text.Trim())) { rddlLocations.Items.Add(rddlLocations.Text.Trim()); return(rddlLocations.Text.Trim()); } var objManager2 = new Manager(); var result = objManager2.ClsLocations_City_insert(rddlLocations.Text.Trim()); if (!result.success) { ItemsPublic.Exeptor(result.Message); } if (result.ResultTable != null) { //indexSelectLocation = (int) result.ResultTable.Rows[0]["City_Id"]; //rddlLocations.Items.Add((string) result.ResultTable.Rows[0]["City_Name"]); ItemsPublic.AllCity.Rows.Add(result.ResultTable.Rows [0] ["City_Id"], result.ResultTable.Rows [0] ["City_Name"]); } } } string temp = rddlLocations.Text.Trim(); //SetAllLocations (); setItem(temp); return(temp); }
public void SetModelsCar() { Manager objManager2 = new Manager(); var Models = new OutputDatas(); DtModels = null; DtModels = new DataTable(); DtModels.Columns.Add("VehicleType_ID", typeof(decimal)); DtModels.Columns.Add("VehicleType_Name", typeof(string)); DtModels.Columns.Add("VehicleType_Desc", typeof(string)); DtModels.Columns.Add("VehicleType_Hidden", typeof(bool)); Models = objManager2.View_vehiclesType(null, null); if (!Models.success) { ItemsPublic.Exeptor("خطا در بازآوری اطلاعات انواع خودرو"); } DtModels = Models.ResultTable.Copy(); //foreach (var row in Models.ResultTable.Rows) for (int index = 0; index < DtModels.Rows.Count; index++) { rddlType.Items.Add((string)Models.ResultTable.Rows[index]["VehicleType_Name"]); } // UC_vehicleDetails21.rddlType.DataSource = Models.ResultTable.Columns["VehicleType_Name"]; }
private void rmeIdentifyCode_KeyDown(object sender, KeyEventArgs e) { ItemsPublic.checkText(sender, e, rmeIdentifyCode.Text, 10); }
private void rmebLicenseDriveCode_KeyDown(object sender, KeyEventArgs e) { ItemsPublic.checkText(sender, e, rmebLicenseDriveCode.Text, 10); }
private void rtbRegisterCode_KeyDown(object sender, KeyEventArgs e) { ItemsPublic.checkText(sender, e, rtbRegisterCode.Text, 10); }