private void Window_Loaded(object sender, RoutedEventArgs e)
        {

            try
            {
                //commandRepositoryViewSource.View.CurrentChanging += new System.ComponentModel.CurrentChangingEventHandler(View_CurrentChanging);

                this.Topmost = false;
                commandRepositoryViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("commandRepositoryViewSource")));
                // Load data by setting the CollectionViewSource.Source property:
                commandRepositoryViewSource.Source = RepositoryLibrary.Repositorys;
                commandRepositoryViewSource.View.CurrentChanged += new EventHandler(View_CurrentChanged);
                runCommandViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("runCommandViewSource")));
                // Load data by setting the CollectionViewSource.Source property:
                if (((CommandRepository)(((ListCollectionView)(commandRepositoryViewSource.View)).CurrentItem)) != null)
                    runCommandViewSource.Source = ((CommandRepository)(((ListCollectionView)(commandRepositoryViewSource.View)).CurrentItem)).Commands;

            }
            catch (Exception ex)
            {


                MyMessageBox b = new MyMessageBox();
                b.ShowMe(ex.Message, "Unhandled error");
                Application.Current.Shutdown();
            }


        }
Example #2
0
        private string VerificaCierreOpe()
        {
            string    cRpta       = "";
            string    msg         = "";
            DataTable tbvalcierre = new clsInicioCuadreOperaciones().ValidarCierreOpe(DateTime.Today, idUsuario, ref msg);

            if (msg == "OK")
            {
                if (tbvalcierre.Rows.Count > 0)
                {
                    for (int i = 0; i < tbvalcierre.Rows.Count; i++)
                    {
                        cRpta = cRpta + tbvalcierre.Rows[i]["cNombre"].ToString() + " ;";
                    }
                    cRpta = "FALTA QUE CIERREN CAJA: " + cRpta;
                    MyMessageBox.Show(cRpta, "Validar Cierre de Caja", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    cRpta = "OK";
                }
            }
            return(cRpta);
        }
Example #3
0
        private void ListarBilleteDolar(int nOpc)
        {
            string msge = "";

            if (nOpc == 1)
            {
                tbBillDol = new clsInicioCuadreOperaciones().ListarBillMon(2, 2, ref msge);
                if (msge == "OK")
                {
                    tbBillDol.AcceptChanges();
                    tbBillDol.Columns["nCantidad"].ReadOnly = false;
                    tbBillDol.Columns["nTotal"].ReadOnly    = false;
                    this.dtgBilletesDolares.DataSource      = tbBillDol;
                }
                else
                {
                    MyMessageBox.Show(msge, "Error al Extraer Billetes en Dólares", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                tbBillDol = new clsInicioCuadreOperaciones().ListarCorteFrac(DateTime.Today, idUsuario, 2, 2, ref msge);
                if (msge == "OK")
                {
                    tbBillDol.AcceptChanges();
                    tbBillDol.Columns["nCantidad"].ReadOnly = false;
                    tbBillDol.Columns["nTotal"].ReadOnly    = false;
                    this.dtgBilletesDolares.DataSource      = tbBillDol;
                    SumaBillDol();
                }
                else
                {
                    MyMessageBox.Show(msge, "Error al Extraer Billetes en Dólares", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
        /// <summary>
        /// Shows a dialog box. The return value is the index of the button clicked, or -1 if cancelled by clicking X.
        /// </summary>
        /// <param name="content"></param>
        /// <param name="title"></param>
        /// <param name="img"></param>
        /// <param name="buttons"></param>
        /// <param name="owner"></param>
        /// <returns></returns>
        public static int Show(object content, string title, ImageSource img, string[] buttons, int DefaultButton, Window owner)
        {
            MyMessageBox mbox = new MyMessageBox();
            mbox.Title = title;
            mbox.imgIcon.Source = img;
            mbox.Owner = owner;
            mbox.ButtonPanel.Children.Clear();

            // add buttons
            for (int i = buttons.Length - 1; i >= 0; i--)
            {
                Button b = new Button();
                b.Content = buttons[i];
                b.Margin = new Thickness(0,10,10,10);
                b.MinWidth = 80;
                b.MinHeight = 25;
                b.Tag = i;
                b.IsDefault = (i == DefaultButton);
                b.Click += new RoutedEventHandler(mbox.Button_Click);
                DockPanel.SetDock(b, Dock.Right);

                mbox.ButtonPanel.Children.Add(b);
            }

            // add content
            if (content is string)
            {
                TextBlock tb = new TextBlock() { MaxWidth = 400, Margin = new Thickness(20), TextWrapping = TextWrapping.Wrap };
                tb.Inlines.Add(content as string);
                content = tb;
            }
            mbox.TheContent.Content = content;

            mbox.ShowDialog();
            return mbox.result;
        }
Example #5
0
        /// <summary>
        /// 编辑按钮
        ///  <auth>张业兴</auth>
        /// <date>2012-12-12</date>
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnEdit_Click(object sender, EventArgs e)
        {
            try
            {
                if (gvPicSign.FocusedRowHandle < 0)
                {
                    MessageBox.Show("请选择一条记录");
                    return;
                }
                DataRow foucesRow = gvPicSign.GetDataRow(gvPicSign.FocusedRowHandle);
                if (foucesRow == null)
                {
                    MessageBox.Show("请选择一条记录");
                    return;
                }
                PicSignForm picSignForm = new PicSignForm(m_App, foucesRow);

                picSignForm.ShowDialog();
            }
            catch (Exception ex)
            {
                MyMessageBox.Show(1, ex);
            }
        }
Example #6
0
 /// <summary>
 /// 生成SQL语句事件
 /// xlb 2013-01-15
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnToSql_Click(object sender, EventArgs e)
 {
     try
     {
         string tableName      = textEditConditionTable.Text;
         string columnName     = textEditConditionColumn.Text;
         string columnValue    = textEditColumnValue.Text;
         string timeColumnName = textEditTimeColumn.Text;
         int    times          = TimesToSeconds(textEditTimeRange.Text);
         string timeRange      = Convert.ToString(times / 60 / 60 / 24);
         if (timeColumnName != "" && timeRange != "" && timeRange != "0")
         {
             textEditSql.Text = string.Format("select * from {0} where {1} {2} and {3}> sysdate-{4}", tableName, columnName, columnValue, timeColumnName, timeRange);
         }
         else
         {
             textEditSql.Text = string.Format("select * from {0} where {1} {2}", tableName, columnName, columnValue);
         }
     }
     catch (Exception ex)
     {
         MyMessageBox.Show(1, ex);
     }
 }
Example #7
0
        //BTN CADASTRAR
        private void BtnAdd_Click(object sender, EventArgs e)
        {
            if (Preeche() == true)
            {
                try
                {
                    cliente.Nome     = txtNome.Text;
                    cliente.Cpf      = txtCPF.Text.Replace(".", "").Replace("-", "");
                    cliente.Endereco = txtEndereco.Text;
                    cliente.Cep      = txtCEP.Text.Replace("-", "");
                    cliente.Numero   = txtNum.Text;
                    cliente.Cidade   = txtCidade.Text;
                    cliente.Telefone = txtTel.Text.Replace("(", "").Replace(")", "").Replace("-", "");
                    cliente.Email    = txtEmail.Text;

                    clienteBo.Cadastrar(cliente);
                    MyMessageBox.Show(this, "O cliente foi cadastrado com sucesso!.", "Cadastro efetuado!");
                }
                catch
                {
                    MyMessageBox.Show(this, "Não foi possível cadastrar o cliente!.", "Cadastro NÃO efetuado!");
                }
            }
        }
Example #8
0
        /// <summary>
        /// Analyzes user folders and creates model based on filed emails.
        /// </summary>
        /// <param name="bgWorker">Reports progress</param>
        /// <param name="label">Label to display progress</param>
        /// <param name="stores">Stores selected for analyze</param>
        /// <param name="selectedLearner">Selected learner index</param>
        /// <param name="includeEmailText">If email body should be analyzed too</param>
        public static void AnalyzeAsync(BackgroundWorker bgWorker, Label label, List <Store> stores)
        {
            try
            {
                _finishedLoading = false;
                bgWorker.ReportProgress(0);
                _analyzedStoresIds = new List <string>();
                _storeModels       = new Dictionary <string, StoreModel>();
                var value        = 100 / stores.Count;
                var currentValue = value;
                foreach (var store in stores)
                {
                    label.Invoke(new Action(() => label.Text = Resources.Analyzing + " " + store.DisplayName));
                    var storeModel = new StoreModel(store);
                    if (storeModel.CreateStoreModel())
                    {
                        _storeModels.Add(store.StoreID, storeModel);
                        _analyzedStoresIds.Add(store.StoreID);
                    }
                    bgWorker.ReportProgress(currentValue);
                    currentValue += value;
                }
                _finishedLoading = true;
                SelectionChanged(SelectedItem);
                label.Invoke(new Action(() => label.Text = Resources.SavingData));
                SaveData();
                bgWorker.ReportProgress(100);
                label.Invoke(new Action(() => label.Text = Resources.Finished));

                Globals.Ribbons.MainRibbon.labelInfo.Label = " ";
            }
            catch (System.Exception ex)
            {
                MyMessageBox.Show("Error when analyzing stores. Error: " + ex);
            }
        }
        void Client_GetGambleStoneRoundInfoCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <GambleStoneRoundInfo> e)
        {
            try
            {
                App.BusyToken.CloseBusyWindow();
                if (e.Error != null)
                {
                    LogHelper.Instance.AddErrorLog("获取疯狂猜石轮信息,服务器返回失败。", e.Error);
                    this.CurrentRoundInfo.ParentObject = null;
                    return;
                }

                this.CurrentRoundInfo.ParentObject = e.Result;
                if (this.GambleStoneGetRoundInfoEvent != null)
                {
                    this.GambleStoneGetRoundInfoEvent(e.Result);
                }
            }
            catch (Exception exc)
            {
                MyMessageBox.ShowInfo("获取疯狂猜石信息失败。");
                LogHelper.Instance.AddErrorLog("获取疯狂猜石轮信息失败。", exc);
            }
        }
Example #10
0
    private bool Apply()
    {
        try
        {
            if (m_studentList.Count == 0)
            {
                throw new ApplicationException(Resource1.ListStudentsEmpty);
            }
            if (m_groupSelector.GroupInfo == null)
            {
                throw new ApplicationException(Resource1.GroupNotSelected);
            }
            CheckStudentsData();
            AddStudentToDB();

            return(true);
        }
        catch (ApplicationException exc)
        {
            MyMessageBox.ShowError(exc.Message);

            return(false);
        }
    }
Example #11
0
        /// <summary>
        /// 确定事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_OK_Click(object sender, EventArgs e)
        {
            try
            {
                //设置当前病人(修复m_App病人丢失问题)
                if (null == m_App || null == m_App.CurrentPatientInfo || m_App.CurrentPatientInfo.NoOfFirstPage.ToString() != m_IemInfo.IemBasicInfo.NoOfInpat)
                {
                    CurrentInpatient = YD_SqlService.GetPatientInfo(m_IemInfo.IemBasicInfo.NoOfInpat);
                }
                else
                {
                    CurrentInpatient = m_App.CurrentPatientInfo;
                }

                //edit by 2012-12-20 张业兴 关闭弹出框只关闭提示框
                //((ShowUC)this.Parent).Close(true, m_IemInfo);
                //点击确认按钮就将数据更新到数据库
                //CurrentInpatient = m_App.CurrentPatientInfo;
                if (null != CurrentInpatient)
                {
                    CurrentInpatient.ReInitializeAllProperties();
                }
                IemMainPageManger manger = new IemMainPageManger(m_App, CurrentInpatient);
                manger.SaveData(m_IemInfo);

                //add by cyq 2012-12-05 病案室人员编辑后状态改为已归档
                if (editFlag)
                {
                    YD_BaseService.SetRecordsRebacked(int.Parse(CurrentInpatient.NoOfFirstPage.ToString().Trim()));
                }
            }
            catch (Exception ex)
            {
                MyMessageBox.Show(1, ex);
            }
        }
Example #12
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            if (!cheknullabalbel())
            {
                return;
            }
            using (TransactionScope ts = new TransactionScope())
            {
                try
                {
                    ProductPrice pc = new ProductPrice();
                    pc.ProductPricePurch = Convert.ToInt64(txtbuy.Text.Trim());
                    pc.ProductPriceSell  = Convert.ToInt64(txtsell.Text.Trim());
                    pc.ProductPriceDate  = lbl_date.Content.ToString();
                    pc.ProductPricedesc  = textBox_Copy1.Text;
                    pc.ProductID         = this.ProductID;
                    pc.UserID            = PublicVariable.GUserID;
                    database.ProductPrices.Add(pc);
                    database.SaveChanges();
                    MyMessageBox.ShowMessageSuccess();


                    database.sp_lastfe_Product(this.ProductID, Convert.ToInt64(txtsell.Text.Trim()), Convert.ToInt64(txtbuy.Text.Trim()));
                    database.SaveChanges();
                    ts.Complete();
                }
                catch
                {
                    MessageBox.Show("در ارتباط با دیتا بیس مشکلی به وجود آمده است لطفا دئباره تلاش کنید");
                }
                finally
                {
                    this.Close();
                }
            }
        }
        void Client_GetSumLastDayValidStoneStackCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <int> e)
        {
            try
            {
                App.BusyToken.CloseBusyWindow();
                if (e.Error != null)
                {
                    MyMessageBox.ShowInfo("获取工厂昨日总有数矿石机数失败。原因为:" + e.Error.Message);
                    return;
                }

                _syn.Post(o =>
                {
                    StoneFactorySetYesterdayProfitWindow win = new StoneFactorySetYesterdayProfitWindow(Convert.ToInt32(o));
                    win.ShowDialog();

                    App.StoneFactoryVMObject.AsyncGetStoneFactorySystemDailyProfitList(GlobalData.PageItemsCount, 1);
                }, e.Result);
            }
            catch (Exception exc)
            {
                MyMessageBox.ShowInfo("获取工厂昨日总有数矿石机数返回处理异常1。原因为:" + exc.Message);
            }
        }
Example #14
0
        /// <summary>
        /// 通过事件
        /// edit by Yanqiao.Cai 2012-11-12
        /// add try ... catch
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void barLargeButtonItemPass_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(CurrentReprotCard.m_Noofinpat))
                {
                    MyMessageBox.Show("请选择一条传染病上报记录或补录传染病报告信息");
                    return;
                }

                if (CurrentReprotCard.Approv())
                {
                    m_UserRole.RefreshValue(CurrentReprotCard.ReportID);
                    SetButtonEnable();
                    RefreshGridControl(ReportState.Approv, CurrentReprotCard.ReportID);
                    CurrentReprotCard.ClearPage();
                }
                Search();
            }
            catch (Exception ex)
            {
                MyMessageBox.Show(1, ex);
            }
        }
Example #15
0
        private void menuItem_ExportEntireFile_Click(object sender, EventArgs e)
        {
            saveFileDialog.FileName = string.Empty;
            string origFilename = allOtherImagesEditor1.GetCurrentOriginalFilename();
            int    startIndex   = origFilename.LastIndexOf(".") + 1;
            string extension    = origFilename.Substring(startIndex, origFilename.Length - startIndex).ToUpper();

            saveFileDialog.Filter = origFilename + "|" + origFilename + "|" + extension + " files|" + "*." + extension + "|All files|*.*";

            AbstractImage image = allOtherImagesEditor1.GetImageFromComboBoxItem();

            if (image.Filesize == 0)
            {
                MyMessageBox.Show(this, "Exporting entire file is not implemented for this image.", "Not Implemented", MessageBoxButtons.OK);
            }
            else if (saveFileDialog.ShowDialog(this) == DialogResult.OK)
            {
                bool didExport = allOtherImagesEditor1.ExportEntireFile(saveFileDialog.FileName);
                if (!didExport)
                {
                    MyMessageBox.Show(this, "Exporting entire file is not implemented for this image.", "Not Implemented", MessageBoxButtons.OK);
                }
            }
        }
Example #16
0
 /// <summary>
 /// 时间切换事件
 /// Add by xlb 2013-04-08
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void rdgDate_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         if (rdgDate.SelectedIndex == 0)
         {
             dateEditBegin.Properties.ReadOnly = true;
             dateEditEnd.Properties.ReadOnly   = true;
             dateEditBegin.Text = string.Empty;
             dateEditEnd.Text   = string.Empty;
         }
         else
         {
             dateEditBegin.Properties.ReadOnly = false;
             dateEditEnd.Properties.ReadOnly   = false;
             dateEditBegin.Text = DateTime.Now.AddDays(double.Parse(config[2])).ToString("yyyy-MM-dd");
             dateEditEnd.Text   = DateTime.Now.ToString("yyyy-MM-dd");
         }
     }
     catch (Exception ex)
     {
         MyMessageBox.Show(1, ex);
     }
 }
Example #17
0
        /// <summary>
        /// 新增事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAddOperation_Click(object sender, EventArgs e)
        {
            try
            {
                m_OperInfoFrom = new IemNewOperInfo(m_App, "new", null);
                m_OperInfoFrom.ShowDialog();
                if (m_OperInfoFrom.DialogResult == DialogResult.OK)
                {
                    m_OperInfoFrom.IemOperInfo = null;
                    DataTable dataTable = m_OperInfoFrom.DataOper;

                    DataTable dataTableOper = new DataTable();
                    if (this.gridControl1.DataSource != null)
                    {
                        dataTableOper = this.gridControl1.DataSource as DataTable;
                    }
                    if (dataTableOper.Rows.Count == 0)
                    {
                        dataTableOper = dataTable.Clone();
                    }
                    foreach (DataRow row in dataTable.Rows)
                    {
                        dataTableOper.ImportRow(row);
                    }
                    gridControl1.BeginUpdate();
                    this.gridControl1.DataSource = dataTableOper;

                    gridControl1.EndUpdate();
                    m_App.PublicMethod.ConvertGridDataSourceUpper(gridViewOper);
                }
            }
            catch (Exception ex)
            {
                MyMessageBox.Show(1, ex);
            }
        }
Example #18
0
        public override void uruchomPolaczenie(object sender, MouseButtonEventArgs e)
        {
            try
            {
                string        rdpDirectory = Properties.Settings.Default.sciezkaInstalacji + "rdp\\";
                DirectoryInfo dir          = null;

                if (!Directory.Exists(rdpDirectory))
                {
                    dir = createRdpFolder(rdpDirectory);
                }
                else
                {
                    dir = new DirectoryInfo(rdpDirectory);
                }

                stworzRdp(rdpDirectory, base.nazwa, this.adresRDP, this.login, base.haslo);
                Process.Start(rdpDirectory + nazwa + ".rdp");
            }
            catch (Exception ex)
            {
                MyMessageBox.Show(ex.Message);
            }
        }
Example #19
0
 /// <summary>
 /// 在院状态切换事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void radio_HosState_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         if (radio_HosState.SelectedIndex == 1)
         {
             date_OutHosBegin.Enabled = false;
             date_OutHosEnd.Enabled   = false;
             //date_OutHosBegin.Text = string.Empty;
             //date_OutHosEnd.Text = string.Empty;
         }
         else
         {
             date_OutHosBegin.Enabled = true;
             date_OutHosEnd.Enabled   = true;
             //date_OutHosBegin.DateTime = DateTime.Now.AddMonths(-1);
             //date_OutHosEnd.DateTime = DateTime.Now;
         }
     }
     catch (Exception ex)
     {
         MyMessageBox.Show(1, ex);
     }
 }
Example #20
0
 /// <summary>
 /// 补写申请界面加载事件
 /// Modify by xlb 2013-03-28
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void MedicalRecordApply_Load(object sender, EventArgs e)
 {
     try
     {
         InitializeImageList();
         selection = new CGridCheckMarksSelection(this.dbGridView); //把多选框绑定到你指定的grid
         selection.CheckMarkColumn.VisibleIndex = 0;                //使多选框排第一列
         dbGridView.Columns[0].Width            = 50;
         dbGridView.Columns[1].Width            = 50;
         dbGridView.Columns[2].Width            = 40;
         dbGridView.Columns[3].Width            = 40;
         dbGridView.Columns[4].Width            = 150;
         dbGridView.Columns[5].Width            = 260;
         dbGridView.Columns[6].Width            = 150;
         DrectSoft.Common.DS_Common.CancelMenu(this.panelHead, contextMenuStrip1);
         DrectSoft.Common.DS_Common.CancelMenu(this.panelSubBottom, contextMenuStrip1);
         lookUpEditorDepartment.CodeValue = DS_Common.currentUser.CurrentDeptId;
         //Add by xlb 2013-03-28
     }
     catch (Exception ex)
     {
         MyMessageBox.Show(1, ex);
     }
 }
Example #21
0
        private void txtTien_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                try
                {
                    if (string.IsNullOrEmpty(txtTien.Text))
                    {
                        MyMessageBox.ShowMessage("Vui lòng nhập số tiền!", "",
                                                 MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    int        Tien = int.Parse(txtTien.Text);
                    List <Mon> mons = Algorithms.Instance.FlashOrder(AllMon, Tien);
                    _listMonFO = mons;
                    pnMons.Controls.Clear();
                    for (int i = 0; i < mons.Count; i++)
                    {
                        UC_MonFO mon = new UC_MonFO();
                        mon.GiaTien = mons[i].GiaTien;
                        mon.TenMon  = mons[i].TenMon;
                        mon.SLGoi   = mons[i].SoLanGoiMon;
                        Image anh = Image.FromStream(BusinessLogicLayer.Instance.GetByteValuesOfAnh(mons[i].IdAnh));
                        mon.AnhMinhHoa = anh;

                        mon.Tag = mons[i]; // UC_mon đang chứa 1 đối tượng món
                        pnMons.Controls.Add(mon);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
                txtTien.Text = "";
            }
        }
Example #22
0
        /// <summary>
        /// 查询事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnQuery_Click(object sender, EventArgs e)
        {
            try
            {
                if (CheckDate())
                {
                    m_WaitDialog = new DevExpress.Utils.WaitDialogForm("正在查询数据...", "请稍等");
                    GetInitDB(true);
                    MyControlEventArgs retvals = new MyControlEventArgs(true, this.User_Table.Rows.Count.ToString(), this);
                    if (OnButtonClick != null)
                    {
                        OnButtonClick(this, retvals);
                    }
                    m_WaitDialog.Hide();

                    m_WaitDialog.Close();
                }
            }
            catch (Exception ex)
            {
                m_WaitDialog.Close();
                MyMessageBox.Show(1, ex);
            }
        }
Example #23
0
        private void frmSalidaCaja_Load(object sender, EventArgs e)
        {
            string cRpta = ValidarInicioOpeCaj();
            bool   Rpta  = false;

            switch (cRpta) // Si Estado es: F--> Falta Iniciar, A--> Caja Abierta, C--> Caja Cerrada
            {
            case "F":
                MyMessageBox.Show("El Usuario NO inició operaciones", "Validar Inicio de Operaciones", MessageBoxButtons.OK, MessageBoxIcon.Information);
                Rpta = true;
                return;

            case "A":
                //   MyMessageBox.Show("El Usuario ya Inicio sus Operaciones", "Validar Inicio de Operaciones", MessageBoxButtons.OK, MessageBoxIcon.Information);
                // this.Dispose();
                //   return;
                break;

            case "C":
                MyMessageBox.Show("El Usuario ya Cerro sus Operaciones", "Validar Cierre de Operaciones", MessageBoxButtons.OK, MessageBoxIcon.Information);
                Rpta = true;
                return;

            default:
                MyMessageBox.Show(cRpta, "Error al Validar Estado de Operaciones", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Rpta = true;
                return;
            }
            if (Rpta)
            {
                this.Close();
            }

            LimpiaControles();
            HabilitaControles(true);
        }
        void Client_GetFinishedGoldCoinRechargeRecordListCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <MetaData.GoldCoinRechargeRecord[]> e)
        {
            try
            {
                App.BusyToken.CloseBusyWindow();
                if (e.Error != null)
                {
                    MyMessageBox.ShowInfo("查询金币充值记录失败。" + e.Error.Message);
                    return;
                }

                if (e.Result != null)
                {
                    foreach (var item in e.Result)
                    {
                        this.ListGoldCoinRechargeRecords.Add(new GoldCoinRechargeRecordUIModel(item));
                    }
                }
            }
            catch (Exception exc)
            {
                MyMessageBox.ShowInfo("查询金币充值记录回调处理异常。" + exc.Message);
            }
        }
        void Client_GetAllAlipayRechargeRecordsCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <AlipayRechargeRecord[]> e)
        {
            try
            {
                App.BusyToken.CloseBusyWindow();
                if (e.Error != null)
                {
                    MyMessageBox.ShowInfo("查询支付宝付款记录失败。" + e.Error);
                    return;
                }

                if (e.Result != null)
                {
                    foreach (var item in e.Result)
                    {
                        ListAllAlipayRecords.Add(new AlipayRechargeRecordUIModel(item));
                    }
                }
            }
            catch (Exception exc)
            {
                MyMessageBox.ShowInfo("处理支付宝订单回调异常。" + exc.Message);
            }
        }
Example #26
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (txtName.Text == "" || txtAddress1.Text == "" || txtContactNo.Text == "" || txtGender.Text == "" || txtOccupation.Text == "" || txtAreaName.Text == "")
     {
         MyMessageBox.ShowBox("Please Enter All the Mandatory Fields", "Customer Information");
     }
     else
     {
         CustomerDTO info = new CustomerDTO();
         info.CustomerID   = _customerID;
         info.Name         = txtName.Text;
         info.Address1     = txtAddress1.Text;
         info.Address2     = txtAddress2.Text;
         info.Email        = txtEmail.Text;
         info.ContactNo    = txtContactNo.Text;
         info.DOB          = dtDOB.Value;
         info.Age          = Convert.ToInt32(txtAge.Text);
         info.Gender       = txtGender.Text;
         info.Occupation   = txtOccupation.Text;
         info.AreaName     = txtAreaName.Text;
         info.CreatedBy    = GlobalSetup.Userid;
         info.CreatedDate  = DateTime.Now;
         info.ModifiedDate = DateTime.Now;
         CustomerBL cBL  = new CustomerBL();
         var        flag = cBL.SaveCustomer(info, _mode);
         if (flag)
         {
             MyMessageBox.ShowBox("Customer Information Saved", "Customer Information");
             Clear();
         }
         else
         {
             MyMessageBox.ShowBox("Customer Information Failed to Save", "Customer Information");
         }
     }
 }
        private void DownLoadThreadRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            Thread.Sleep(100);

            if (e.Cancelled == true)
            {
                MyMessageBox.MessageBoxOK("UpdateProgramCancelled");
            }
            else if (e.Error != null)
            {
                MyMessageBox.MessageBoxOK("UpdateProgramError");
            }
            else if (isCompletedDownLoad == true)
            {
                progressBar.Value = 100;
                MyMessageBox.MessageBoxOK("UpdateProgramFinished");
            }
            else
            {
                MyMessageBox.MessageBoxOK("UpdateProgramError");
            }

            progressBar.Value = 0;
        }
        void Client_GetWithdrawRMBRecordListCompleted(object sender, Wcf.Clients.WebInvokeEventArgs <WithdrawRMBRecord[]> e)
        {
            try
            {
                App.BusyToken.CloseBusyWindow();
                if (e.Error != null)
                {
                    MyMessageBox.ShowInfo("查询灵币提现记录失败。" + e.Error.Message);
                    return;
                }

                if (e.Result != null)
                {
                    foreach (var item in e.Result)
                    {
                        this.ListHistoryWithdrawRecords.Add(new WithdrawRMBRecordUIModel(item));
                    }
                }
            }
            catch (Exception exc)
            {
                MyMessageBox.ShowInfo("查询灵币提现记录回调处理异常。" + exc.Message);
            }
        }
Example #29
0
        private void btnSearchCustomer_Click(object sender, EventArgs e)
        {
            CustomerInfo frm = new CustomerInfo("SELECT");

            frm.ShowDialog();
            txtCustomerId.Text   = frm.Controls["lblCustomerId"].Text;
            txtCustomerName.Text = frm.Controls["lblCustomerName"].Text;
            CustomerBL obj = new CustomerBL();

            if (txtCustomerId.Text != "" && txtCustomerId.Text != "lblCustomerId")
            {
                var lst = obj.GetCustomerEnquiryforCustomerId(Convert.ToInt32(txtCustomerId.Text));
                if (lst.Count > 1)
                {
                    MyMessageBox.ShowBox("Two Enquiries cannot be created for same customer!!!", "Error in Enquiry");
                }
                else if (lst.Count == 1)
                {
                    var enquirydto = lst[0];
                    _vehicleEnquiryId = enquirydto.CustomerEnquiryID;
                    PopulateEnquiry(enquirydto);
                }
            }
        }
Example #30
0
        //BTN EDITAR CLIENTE
        private void BtnEditar_Click(object sender, EventArgs e)
        {
            if (MyMessageBox.Show(this, "", "Deseja mesmo editar?", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                try
                {
                    cliente.Codigo   = Convert.ToInt32(dtGridCli.CurrentRow.Cells["codigo"].Value);
                    cliente.Nome     = dtGridCli.CurrentRow.Cells["nome"].Value.ToString();
                    cliente.Cpf      = dtGridCli.CurrentRow.Cells["cpf"].Value.ToString();
                    cliente.Cep      = dtGridCli.CurrentRow.Cells["cep"].Value.ToString();
                    cliente.Endereco = dtGridCli.CurrentRow.Cells["endereco"].Value.ToString();
                    cliente.Cidade   = dtGridCli.CurrentRow.Cells["cidade"].Value.ToString();
                    cliente.Numero   = dtGridCli.CurrentRow.Cells["numero"].Value.ToString();
                    cliente.Telefone = dtGridCli.CurrentRow.Cells["telefone"].Value.ToString();
                    cliente.Email    = dtGridCli.CurrentRow.Cells["email"].Value.ToString();

                    clienteBo.Editar(cliente);
                }
                catch
                {
                    MyMessageBox.Show(this, "Verifique os campos e complete-os corretamente!.", "Cliente NÃO editado!");
                }
            }
        }
Example #31
0
        private void btnSell_Click(object sender, RoutedEventArgs e)
        {
            int handCount = (int)this.numSellStoneHandsCount.Value;

            if (handCount <= 0)
            {
                MyMessageBox.ShowInfo("需填写出售矿石量(手)");
                return;
            }
            int sellStoneCount = (int)GetAllStonesCount();

            int expenseStonesCount = (int)GetExpense(sellStoneCount);

            if (GlobalData.CurrentUser.SellableStones < sellStoneCount + expenseStonesCount)
            {
                MyMessageBox.ShowInfo("没有足够的矿石出售");
                return;
            }

            decimal price = Math.Round((decimal)this.sliderPrice.Value, 2);

            App.BusyToken.ShowBusyWindow("正在提交服务器...");
            GlobalData.Client.DelegateSellStone(handCount, price, null);
        }
Example #32
0
        /// <summary>
        ///     Drop MongoDB
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DelMongoDBToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var strTitle   = "Drop Database";
            var strMessage = "Are you really want to Drop current Database?";

            if (!GuiConfig.IsUseDefaultLanguage)
            {
                strTitle   = GuiConfig.GetText(TextType.DropDataBase);
                strMessage =
                    GuiConfig.GetText(TextType.DropDataBaseConfirm);
            }
            if (!MyMessageBox.ShowConfirm(strTitle, strMessage))
            {
                return;
            }
            var strTagPrefix = TagInfo.GetTagPath(ConstMgr.CollectionTag + ":" + RuntimeMongoDbContext.SelectTagData);
            var strDbName    = strTagPrefix.Split("/".ToCharArray())[(int)EnumMgr.PathLevel.Database];

            if (trvsrvlst.SelectedNode == null)
            {
                trvsrvlst.SelectedNode = null;
            }
            var rtnResult = Operater.DataBaseOpration(RuntimeMongoDbContext.SelectObjectTag, strDbName,
                                                      Operater.Oprcode.Drop);

            if (string.IsNullOrEmpty(rtnResult))
            {
                RefreshToolStripMenuItem_Click(sender, e);
                //关闭所有的相关视图
                MultiTabManger.SelectObjectTagPrefixDeleted(strTagPrefix);
            }
            else
            {
                MyMessageBox.ShowMessage("Error", "Error", rtnResult, true);
            }
        }
        private void View_CurrentChanged(object sender, EventArgs e)
        {
            try
            {
                if ((CommandRepository)(((ListCollectionView)(commandRepositoryViewSource.View)).CurrentItem) != null)
                {
                    runCommandViewSource.Source = ((CommandRepository)(((ListCollectionView)(commandRepositoryViewSource.View)).CurrentItem)).Commands;
                }
                else
                {
                    runCommandViewSource.Source = null;
                }
            }
            catch (Exception ex)
            {

                MyMessageBox b = new MyMessageBox();
                b.ShowMe(ex.Message, "Unhandled error");
                Application.Current.Shutdown();
            }
        }
Example #34
0
 private void Button_Click_2(object sender, RoutedEventArgs e)
 {
     MyMessageBox myMessageBox = new MyMessageBox();
     myMessageBox.Show();
 }
        private void typeColumn_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ClickCount == 2)
            {
                if (string.IsNullOrWhiteSpace((runCommandViewSource.View.CurrentItem as RunCommand).Arguments))
                {
                    switch (((Control)sender).Tag.ToString())
                    {
                        case "type":
                            {

                                if ((runCommandViewSource.View.CurrentItem as RunCommand).Type == CommandType.CMDExecutedCommand)
                                    (runCommandViewSource.View.CurrentItem as RunCommand).Type = CommandType.SimpleRunCommand;
                                else if ((runCommandViewSource.View.CurrentItem as RunCommand).Type == CommandType.SimpleRunCommand)
                                    (runCommandViewSource.View.CurrentItem as RunCommand).Type = CommandType.AutoCadCommand;
                                else if ((runCommandViewSource.View.CurrentItem as RunCommand).Type == CommandType.AutoCadCommand)
                                    (runCommandViewSource.View.CurrentItem as RunCommand).Type = CommandType.CMDExecutedCommand;
                                break;
                            }

                    }

                }
                else
                {

                    MyMessageBox b = new MyMessageBox();
                    b.ShowMe("If you have used arguments, you must use CMDExecutedCommand type!", "Toggle error");
                    e.Handled = true;
                    b = null;
                }

            }
        }