public TBLAddAssetComponentDlg(int ID, bool New) { InitializeComponent(); LSMSCDComponents.QueryableSource = from q in dsLinq.CDComponents select q; try { if (New) { Datasource.dsData.TBLAddAssetComponentRow row = dsData.TBLAddAssetComponent.NewTBLAddAssetComponentRow(); row.AddComponentezn = (int)adp.NewId(); row.AssetsID = ID; row.ComponentId = 0; row.AddQuantity = 0; row.PriceOne = 0; row.Adddate = Classes.Managers.DataManager.GetServerDatetime; row.AddReson = string.Empty; row.UserIn = Classes.Managers.UserManager.defaultInstance.User.UserId; row.dateIn = Classes.Managers.DataManager.GetServerDatetime; dsData.TBLAddAssetComponent.AddTBLAddAssetComponentRow(row); } else { adp.FillByAddComponentezn(dsData.TBLAddAssetComponent, ID); } } catch (Exception ex) { MsgDlg.Show(ex.Message, MsgDlg.MessageType.Error, ex); Logger.Error(ex.Message, ex); } }
private void btnLoginInfo_Click(object sender, EventArgs e) { if (!dxvpLoginInfoChange.Validate()) { return; } if (!Classes.Managers.UserManager.defaultInstance.CheckCurrentPassword(tbCurentpassword.EditValue.ToString())) { MsgDlg.Show("خطاء في كلمة المرور الحالية", MsgDlg.MessageType.Error); return; } if (tbNewpassword1.EditValue.ToString() != tbNewpassword2.EditValue.ToString()) { MsgDlg.Show("خطاء في كلمة المرور الجديدة", MsgDlg.MessageType.Error); return; } if (MsgDlg.Show("هل انت متأكد ؟", MsgDlg.MessageType.Question) == DialogResult.No) { return; } if (Classes.Managers.UserManager.defaultInstance.ChangeLogininfo(tbUsername.EditValue.ToString(), tbNewpassword1.EditValue.ToString())) { MsgDlg.Show("تم تغير بيانات المستخدم بنجاح", MsgDlg.MessageType.Success); } else { MsgDlg.Show(Properties.Settings.Default.msg_SavingFailed, MsgDlg.MessageType.Error); } }
private void btnSave_Click(object sender, EventArgs e) { if (dxValidationProviderMain.Validate()) { try { Datasource.dsQry.AssetComponentQuantityRow qun = dsQry.AssetComponentQuantity.FindByComponentId(dsData.TBLDeleteAssetComponent[0].ComponentId); if (qun != null) { if (qun.Quantity - dsData.TBLDeleteAssetComponent[0].DelQuantity < 0) { MsgDlg.Show("الكمية المدخله اكبر من الكمية المتاحه", MsgDlg.MessageType.Error); return; } } else { MsgDlg.Show("المكون غير مدرج", MsgDlg.MessageType.Error); return; } dsData.TBLDeleteAssetComponent[0].UserIn = Classes.Managers.UserManager.defaultInstance.User.UserId; dsData.TBLDeleteAssetComponent[0].dateIn = Classes.Managers.DataManager.GetServerDatetime; DialogResult = System.Windows.Forms.DialogResult.OK; dsData.TBLDeleteAssetComponent[0].EndEdit(); adp.Update(dsData.TBLDeleteAssetComponent[0]); Close(); } catch (Exception ex) { MsgDlg.Show(ex.Message, MsgDlg.MessageType.Error, ex); Logger.Error(ex.Message, ex); } } }
private void BtnUpdate_Click(object sender, EventArgs e) { if (TxtEditPass1.Text.Trim().Length == 0 || TxtEditPass1.Text.Trim() != TxtEditPass2.Text.Trim()) { MsgDlg.Show("من فضلك ادخل كلمة المرور ..", MsgDlg.MessageType.Info); return; } using (SqlConnection Con = new SqlConnection(FXFW.SqlDB.SqlConStr)) { SqlCommand Cmd = new SqlCommand(String.Format(@"UPDATE Users SET UserName = N'{0}', UserPass = N'{1}', IsActive = N'{2}' WHERE (UserID = {3})", TxtEditItem.Text.Trim(), TxtEditPass1.Text.Trim(), CEEditActive.Checked.ToString(), LUEItems.EditValue), Con); try { Con.Open(); Cmd.ExecuteNonQuery(); LoadData(); MsgDlg.ShowAlert("تم التعديل ..", MsgDlg.MessageType.Success, this); Logger.Info("تم التعديل .."); } catch (Exception ex) { MsgDlg.ShowAlert(ex.Message, MsgDlg.MessageType.Success, this); Logger.Info(ex.Message, ex); } } }
private void bbiSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (MsgDlg.Show("هل انت متأكد ؟", MsgDlg.MessageType.Question) == DialogResult.No) { return; } DevExpress.Xpo.AsyncCommitCallback CommitCallBack = (o) => { SplashScreenManager.CloseForm(); if (o == null) { MsgDlg.ShowAlert(Properties.Settings.Default.msg_SaveSuccess, MsgDlg.MessageType.Success, (Form)Parent.Parent.Parent); Logger.Info(Properties.Settings.Default.msg_SaveSuccess); } else { MsgDlg.ShowAlert(String.Format("{0}, {1}, {2}", Properties.Settings.Default.msg_SavingFailed, Environment.NewLine, o.Message), MsgDlg.MessageType.Error, (Form)Parent.Parent.Parent); Classes.Core.LogException(Logger, o.InnerException, Classes.Core.ExceptionLevelEnum.General, Classes.Managers.UserManager.defaultInstance.User.UserId); } }; SplashScreenManager.ShowForm(typeof(FixedAssets.Views.Main.WaitWindowFrm)); SplashScreenManager.Default.SetWaitFormDescription(Properties.Settings.Default.msg_SavingInProgress); UOW.CommitTransactionAsync(CommitCallBack); }
private void btnEditTBLAssetOhda_Click(object sender, EventArgs e) { try { DataRowView drv = (DataRowView)gridViewTBLAssetOhda.GetRow(gridViewTBLAssetOhda.FocusedRowHandle); if (drv == null) { return; } Datasource.dsData.TBLAssetOhdaRow row = (Datasource.dsData.TBLAssetOhdaRow)(drv).Row; if (row == null) { return; } TBLAssetOhdaDlg frm = new TBLAssetOhdaDlg(row.AssetOhdaId, false); if (frm.ShowDialog() == DialogResult.OK) { gridViewTBLAssetOhda.ShowLoadingPanel(); tBLAssetOhdaTableAdapter.FillByAssetsID(dsData.TBLAssetOhda, row.AssetsID); gridViewTBLAssetOhda.RefreshData(); gridViewTBLAssetOhda.HideLoadingPanel(); } } catch (Exception ex) { MsgDlg.Show(ex.Message, MsgDlg.MessageType.Error, ex); } }
private void btnResertLayout_Click(object sender, EventArgs e) { if (MsgDlg.Show("Are You Sure ?", MsgDlg.MessageType.Question) == DialogResult.No) { return; } try { string FileName = Program.TilesLayoutFile + Classes.Managers.UserManager.defaultInstance.User.UserId; if (File.Exists(FileName)) { File.Delete(FileName); } MainForm MainForm = (MainForm)ParentForm; MainForm.windowsUIView.OptionsLayout.Reset(); if (MsgDlg.Show("لكي يتم تفعيل الخيارات جيب اعادة تشغيل البرنامج", MsgDlg.MessageType.Question) == DialogResult.Yes) { Application.Restart(); } } catch (Exception ex) { Classes.Core.LogException(Logger, ex, Classes.Core.ExceptionLevelEnum.General, Classes.Managers.UserManager.defaultInstance.User.UserId); } }
private void btnImport_Click(object sender, EventArgs e) { if (lbcFilePath.ItemCount == 0) { MsgDlg.Show("من فضلك اضف ملف", MsgDlg.MessageType.Info, null); return; } if (FXFW.SqlDB.IsNullOrEmpty(lueGeha.EditValue)) { MsgDlg.Show("من فضلك اختر جهة", MsgDlg.MessageType.Info, null); return; } layoutControlGroupCommand.Enabled = false; try { BackgroundWorker ImportWorker = new BackgroundWorker(); ImportWorker.DoWork += ImportWorker_DoWork; ImportWorker.RunWorkerCompleted += ImportWorker_RunWorkerCompleted; ImportWorker.RunWorkerAsync(); } catch (Exception ex) { MsgDlg.Show("لم نتمكن من الاستيراد. - " + ex.Message, MsgDlg.MessageType.Error, ex); } }
private void btnAddTBLAssetOhda_Click(object sender, EventArgs e) { try { XPDataTableObject row = (XPDataTableObject)gridViewAsset.GetRow(gridViewAsset.FocusedRowHandle); if (row == null) { return; } if (row == null) { return; } TBLAssetOhdaDlg frm = new TBLAssetOhdaDlg(Convert.ToInt32(row.GetMemberValue("AssetsID")), true); if (frm.ShowDialog() == DialogResult.OK) { gridViewTBLAssetOhda.ShowLoadingPanel(); tBLAssetOhdaTableAdapter.FillByAssetsID(dsData.TBLAssetOhda, Convert.ToInt32(row.GetMemberValue("AssetsID"))); gridViewTBLAssetOhda.RefreshData(); gridViewTBLAssetOhda.HideLoadingPanel(); } } catch (Exception ex) { MsgDlg.Show(ex.Message, MsgDlg.MessageType.Error, ex); } }
private void btnSaveDetails_Click(object sender, EventArgs e) { if (MsgDlg.Show("هل انت متأكد ؟", MsgDlg.MessageType.Question) == DialogResult.No) { return; } for (int i = 0; i < dsData.TBLEznSarfDetails.Count; i++) { if (dsData.TBLEznSarfDetails[i].RowState == DataRowState.Modified) { dsData.TBLEznSarfDetails[i].UserIn = Classes.Managers.UserManager.defaultInstance.User.UserId; dsData.TBLEznSarfDetails[i].dateIn = Classes.Managers.DataManager.GetServerDatetime; } if (dsData.TBLEznSarfDetails[i].RowState == DataRowState.Modified || dsData.TBLEznSarfDetails[i].RowState == DataRowState.Unchanged) { double?remaining = adpQry.SanfRemainingQuentity(dsData.TBLEznSarfDetails[i].SanfID, dsData.TBLEznSarfDetails[i].EznSarfId); string SanfName = adpQry.GetSanfName(dsData.TBLEznSarfDetails[i].SanfID); //check if Sanf quentity not exists if (remaining == null || remaining < dsData.TBLEznSarfDetails[i].sarfquntity) { MsgDlg.Show("الكمية الموجودة بالمخزن غير كافية" + Environment.NewLine + "اسم الصنف: " + SanfName, MsgDlg.MessageType.Error); return; } double?ReOrder = adpQry.GetSanfReOrder(dsData.TBLEznSarfDetails[i].SanfID); //check if Sanf Reorder reached if (ReOrder == null || remaining >= dsData.TBLEznSarfDetails[i].sarfquntity) { MsgDlg.Show("تم الوطول لحد الطلب" + Environment.NewLine + "اسم الصنف: " + SanfName, MsgDlg.MessageType.Warn); } } } tBLEznSarfDetailsBindingSource.EndEdit(); tBLEznSarfDetailsTableAdapter.Update(dsData.TBLEznSarfDetails); MsgDlg.Show("تم الحفـــظ", MsgDlg.MessageType.Success); }
private void BtnAdd_Click(object sender, EventArgs e) { if (TxtAddPass1.Text.Trim().Length == 0 || TxtAddPass1.Text.Trim() != TxtAddPass2.Text.Trim()) { MsgDlg.Show("من فضلك ادخل كلمة المرور ..", MsgDlg.MessageType.Info); return; } using (SqlConnection Con = new SqlConnection(FXFW.SqlDB.SqlConStr)) { SqlCommand Cmd = new SqlCommand(String.Format(@"INSERT INTO Users (UserID, UserName, UserPass, IsActive) VALUES ({0}, N'{1}', N'{2}', N'{3}')", FXFW.SqlDB.GetNewID("Users", "UserID"), TxtAddItem.Text.Trim(), TxtAddPass1.Text.Trim(), CEAddActive.Checked.ToString()), Con); try { Con.Open(); Cmd.ExecuteNonQuery(); LoadData(); MsgDlg.ShowAlert("تم الاضافه ..", MsgDlg.MessageType.Success, this); Logger.Info("تم الاضافه .."); } catch (Exception ex) { MsgDlg.ShowAlert(ex.Message, MsgDlg.MessageType.Success, this); Logger.Info(ex.Message, ex); } } }
private void BtnDelete_Click(object sender, EventArgs e) { if (MsgDlg.Show("هل انت متأكد؟", MsgDlg.MessageType.Question) == System.Windows.Forms.DialogResult.No) { return; } using (SqlConnection Con = new SqlConnection(FXFW.SqlDB.SqlConStr)) { SqlCommand Cmd = new SqlCommand(String.Format("DELETE FROM Users WHERE (UserID = {0})", LUEItems.EditValue), Con); try { Con.Open(); Cmd.ExecuteNonQuery(); LoadData(); LUEItems.ItemIndex = -1; MsgDlg.ShowAlert("تم الحذف ..", MsgDlg.MessageType.Success, this); Logger.Info("تم الحذف .."); } catch (Exception ex) { MsgDlg.ShowAlert(ex.Message, MsgDlg.MessageType.Success, this); Logger.Info(ex.Message, ex); } } }
private void bbiSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (FXFW.SqlDB.IsNullOrEmpty(bbiRule.EditValue)) { return; } int RuleID = Convert.ToInt32(bbiRule.EditValue); if (MsgDlg.Show("Are You Sure ?", MsgDlg.MessageType.Question) == DialogResult.No) { return; } SplashScreenManager.ShowForm(typeof(FixedAssets.Views.Main.WaitWindowFrm)); SplashScreenManager.Default.SetWaitFormDescription("Saving ..."); System.Threading.ThreadPool.QueueUserWorkItem((o) => { try { SaveUserData(RuleID); MsgDlg.ShowAlert("Data Saved ...", MsgDlg.MessageType.Success, (Form)Parent.Parent.Parent); Logger.Info("Data Saved ..."); } catch (System.Data.SqlClient.SqlException ex) { MsgDlg.ShowAlert(String.Format("Saving Failed ...{0}{1}", Environment.NewLine, ex.Message), MsgDlg.MessageType.Error, (Form)Parent.Parent.Parent); Classes.Core.LogException(Logger, ex, Classes.Core.ExceptionLevelEnum.General, Classes.Managers.UserManager.defaultInstance.User.UserId); } SplashScreenManager.CloseForm(); }); }
public TBLTwreedOrderDlg(int ID, bool New) { InitializeComponent(); LSMSSupplierId.QueryableSource = from q in dsLinq.TBLSuppliers select q; try { if (New) { //Load exist Quantity tblTwreedOrderTableAdapter.FillByTwreedOrderId(dsData.TBLTwreedOrder, -99); Datasource.dsData.TBLTwreedOrderRow row = dsData.TBLTwreedOrder.NewTBLTwreedOrderRow(); row.TwreedOrderId = _m_TwreedOrderId = (int)tblTwreedOrderTableAdapter.NewId(); row.TwreedOrderdate = ServerDatetime; row.SupplierId = -1; row.twreedplace = string.Empty; row.twreddate = ServerDatetime; row.Supplierofferno = 0; row.UserIn = Classes.Managers.UserManager.defaultInstance.User.UserId; row.dateIn = ServerDatetime; dsData.TBLTwreedOrder.AddTBLTwreedOrderRow(row); } else { tblTwreedOrderTableAdapter.FillByTwreedOrderId(dsData.TBLTwreedOrder, ID); } } catch (Exception ex) { MsgDlg.Show(ex.Message, MsgDlg.MessageType.Error, ex); Logger.Error(ex.Message, ex); } }
private void bbiDeleteNode_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (MsgDlg.Show("هل انت متأكد ؟", MsgDlg.MessageType.Question) == DialogResult.No) { return; } treeListMain.DeleteSelectedNodes(); }
private void bbiRefresh_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (MsgDlg.Show("هل انت متأكد ؟", MsgDlg.MessageType.Question) == DialogResult.No) { return; } userRuleTableAdapter.Fill(dsData.UserRoles); gridViewMain.RefreshData(); }
private void bbiRefresh_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (MsgDlg.Show("Are You Sure ?", MsgDlg.MessageType.Question) == DialogResult.No) { return; } LoadRulesList(); bbiRule_EditValueChanged(bbiRule, EventArgs.Empty); }
private void bbiRefresh_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (MsgDlg.Show("هل انت متأكد ؟", MsgDlg.MessageType.Question) == DialogResult.No) { return; } sessionCat.DropIdentityMap(); XPSCSCat.Reload(); treeListMain.RefreshDataSource(); }
void ImportWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (e.Result != null) { DateTime dt = (DateTime)e.Result; MsgDlg.Show(String.Format("تم الاستيراد {0} in {1} ثانية", Environment.NewLine, Convert.ToInt32(DateTime.Now.Subtract(dt).TotalSeconds)), MsgDlg.MessageType.Success); } ProgressBarMain.EditValue = 0; layoutControlGroupCommand.Enabled = true; }
private void gridViewAsset_RowCellClick(object sender, RowCellClickEventArgs e) { try { DevExpress.Xpo.Metadata.XPDataTableObject row = ((DevExpress.Xpo.Metadata.XPDataTableObject)gridViewAsset.GetRow(e.RowHandle)); if (row != null && row.GetMemberValue("AssetsID") != null) { //Load TBLAssetPropertiy Grid gridViewTBLAssetPropertiy.ShowLoadingPanel(); tBLAssetPropertiyTableAdapter.FillByAssetsID(dsData.TBLAssetPropertiy, Convert.ToInt32(row.GetMemberValue("AssetsID"))); gridViewTBLAssetPropertiy.RefreshData(); gridViewTBLAssetPropertiy.HideLoadingPanel(); //Load TBLReEvaluation Grid gridViewTBLReEvaluation.ShowLoadingPanel(); tBLReEvaluationTableAdapter.FillByAssetsID(dsData.TBLReEvaluation, Convert.ToInt32(row.GetMemberValue("AssetsID"))); gridViewTBLReEvaluation.RefreshData(); gridViewTBLReEvaluation.HideLoadingPanel(); //Load TBLAssetPlace Grid gridViewTBLAssetPlace.ShowLoadingPanel(); tBLAssetPlaceTableAdapter.FillByAssetsID(dsData.TBLAssetPlace, Convert.ToInt32(row.GetMemberValue("AssetsID"))); gridViewTBLAssetPlace.RefreshData(); gridViewTBLAssetPlace.HideLoadingPanel(); //Load TBLAssetComponent Grid gridViewTBLAssetComponent.ShowLoadingPanel(); tBLAssetComponentTableAdapter.FillByAssetsID(dsData.TBLAssetComponent, Convert.ToInt32(row.GetMemberValue("AssetsID"))); gridViewTBLAssetComponent.RefreshData(); gridViewTBLAssetComponent.HideLoadingPanel(); //Load TBLAddAssetComponent Grid gridViewTBLAddAssetComponent.ShowLoadingPanel(); tBLAddAssetComponentTableAdapter.FillByAssetsID(dsData.TBLAddAssetComponent, Convert.ToInt32(row.GetMemberValue("AssetsID"))); gridViewTBLAddAssetComponent.RefreshData(); gridViewTBLAddAssetComponent.HideLoadingPanel(); //Load TBLDeleteAssetComponent Grid gridViewTBLDeleteAssetComponent.ShowLoadingPanel(); tBLDeleteAssetComponentTableAdapter.FillByAssetsID(dsData.TBLDeleteAssetComponent, Convert.ToInt32(row.GetMemberValue("AssetsID"))); gridViewTBLDeleteAssetComponent.RefreshData(); gridViewTBLDeleteAssetComponent.HideLoadingPanel(); //Load TBLAssetOhda Grid gridViewTBLAssetOhda.ShowLoadingPanel(); tBLAssetOhdaTableAdapter.FillByAssetsID(dsData.TBLAssetOhda, Convert.ToInt32(row.GetMemberValue("AssetsID"))); gridViewTBLAssetOhda.RefreshData(); gridViewTBLAssetOhda.HideLoadingPanel(); } } catch (Exception ex) { MsgDlg.Show(ex.Message, MsgDlg.MessageType.Error, ex); } }
private void bbiSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (MsgDlg.Show("هل انت متأكد ؟", MsgDlg.MessageType.Question) == DialogResult.No) { return; } userRuleTableAdapter.Update(dsData.UserRoles); MsgDlg.ShowAlert("تم الحفظ ...", MsgDlg.MessageType.Success, (Form)Parent.Parent.Parent); Logger.Info("تم الحفظ ..."); }
private void mbExport_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { // Check whether the GridControl can be previewed. if (!gridControlMain.IsPrintingAvailable) { MsgDlg.Show("The 'DevExpress.XtraPrinting' library is not found", MsgDlg.MessageType.Warn); return; } // Open the Preview window. gridControlMain.ShowRibbonPrintPreview(); }
private void bbiRefresh_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (MsgDlg.Show("هل انت متأكد ؟", MsgDlg.MessageType.Question) == DialogResult.No) { return; } UOW.DropIdentityMap(); UOW.DropChanges(); XPSCS.Reload(); gridViewMain.RefreshData(); }
private void repositoryItemButtonEditPrint_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { XPDataTableObject row = ((XPDataTableObject)gridViewParent.GetRow(gridViewParent.FocusedRowHandle)); object id = row.GetMemberValue("TwreedOrderId"); if (id == null) { MsgDlg.Show("من فضلك احفظ قبل الطباعة", MsgDlg.MessageType.Error); return; } FixedAssets.XRep.xRep002 rep = new FixedAssets.XRep.xRep002(Convert.ToInt32(id)); Classes.Misc.ShowPrintPreview(rep); }
private void lueCardLayout_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { if (e.Button.Kind != DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph) { return; } if (FXFW.SqlDB.IsNullOrEmpty(lueTBLALLData.EditValue)) { MsgDlg.Show("يجب اختيار من القائمة", MsgDlg.MessageType.Error); return; } Datasource.dsQry.XRepCard1DataTable PrintTbl = new Datasource.dsQry.XRepCard1DataTable(); for (int i = 0; i < gridViewMain.SelectedRowsCount; i++) { PrintTbl.Rows.Add(gridViewMain.GetDataRow(gridViewMain.GetSelectedRows()[i]).ItemArray); } switch (lueCardLayout.SelectedIndex) { case 0: //Card 1 ECard.Forms.XRep.XRepCard1 FrmRep1 = new ECard.Forms.XRep.XRepCard1(PrintTbl); ECard.Classes.Misc.ShowPrintPreview(FrmRep1, true); break; case 1: //Card 2 ECard.Forms.XRep.XRepCard2 FrmRep2 = new ECard.Forms.XRep.XRepCard2(PrintTbl); ECard.Classes.Misc.ShowPrintPreview(FrmRep2, true); break; case 2: //Card 3 ECard.Forms.XRep.XRepCard3 FrmRep3 = new ECard.Forms.XRep.XRepCard3(PrintTbl); ECard.Classes.Misc.ShowPrintPreview(FrmRep3, true); break; case 3: //Card 4 ECard.Forms.XRep.XRepCard4 FrmRep4 = new ECard.Forms.XRep.XRepCard4(PrintTbl); ECard.Classes.Misc.ShowPrintPreview(FrmRep4, true); break; default: break; } //Saving Printing Order if (MsgDlg.Show("هل تريد حقظ الطباعة؟", MsgDlg.MessageType.Question) == DialogResult.Yes) { if (!Classes.Managers.DataManager.SavePrintOrder(PrintTbl)) { MsgDlg.Show("لم يتم الحفظ", MsgDlg.MessageType.Error); return; } } }
private void btnSave_Click(object sender, EventArgs e) { try { tBLCompanyBindingSource.EndEdit(); tBLCompanyTableAdapter.Update(dsData.TBLCompany); MsgDlg.ShowAlert("تم الحفظ", MsgDlg.MessageType.Success, new Form()); } catch (Exception ex) { MsgDlg.Show(ex.Message, MsgDlg.MessageType.Error, ex); Logger.Error(ex); } }
private void btnSaveLayout_Click(object sender, EventArgs e) { try { string FileName = Program.TilesLayoutFile + Classes.Managers.UserManager.defaultInstance.User.UserId; MainForm MainForm = (MainForm)ParentForm; FileStream fs = new FileStream(FileName, FileMode.OpenOrCreate); MainForm.windowsUIView.SaveLayoutToStream(fs); fs.Close(); MsgDlg.Show(Properties.Settings.Default.msg_SaveSuccess, MsgDlg.MessageType.Success); } catch (Exception ex) { Classes.Core.LogException(Logger, ex, Classes.Core.ExceptionLevelEnum.General, Classes.Managers.UserManager.defaultInstance.User.UserId); } }
private void btnDeleteEmp_Click(object sender, EventArgs e) { try { if (MsgDlg.Show("هل انت متأكد ؟", MsgDlg.MessageType.Question) == DialogResult.Yes) { gridViewEmp.DeleteSelectedRows(); tBLCheckEmpBindingSource.EndEdit(); tBLCheckEmpTableAdapter.Update(dsData.TBLCheckEmp); gridViewEmp.RefreshData(); } } catch (Exception ex) { MsgDlg.Show(ex.Message, MsgDlg.MessageType.Error, ex); } }
private void btnSaveTBLTBBuyorderdetails_Click(object sender, EventArgs e) { if (MsgDlg.Show("هل انت متأكد ؟", MsgDlg.MessageType.Question) == DialogResult.No) { return; } for (int i = 0; i < dsData.TBLTwreedOrderdetails.Count; i++) { if (dsData.TBLTwreedOrderdetails[i].RowState == DataRowState.Modified) { dsData.TBLTwreedOrderdetails[i].UserIn = Classes.Managers.UserManager.defaultInstance.User.UserId; dsData.TBLTwreedOrderdetails[i].dateIn = Classes.Managers.DataManager.GetServerDatetime; } } tBLTwreedOrderdetailsBindingSource.EndEdit(); tBLTwreedOrderdetailsTableAdapter.Update(dsData.TBLTwreedOrderdetails); }
private void btnDeleteTBLTBBuyorderdetails_Click(object sender, EventArgs e) { try { if (MsgDlg.Show("هل انت متأكد ؟", MsgDlg.MessageType.Question) == DialogResult.Yes) { gridViewDetails.DeleteSelectedRows(); tBLTwreedOrderdetailsBindingSource.EndEdit(); tBLTwreedOrderdetailsTableAdapter.Update(dsData.TBLTwreedOrderdetails); gridViewDetails.RefreshData(); } } catch (Exception ex) { MsgDlg.Show(ex.Message, MsgDlg.MessageType.Error, ex); } }