Exemplo n.º 1
0
        private void mbtnAdd_Click(object sender, EventArgs e)
        {
            var form = new frmCompanyYear();

            form.MyCaller = this;
            FormHelpers.ShowDialog(form);
        }
Exemplo n.º 2
0
        private void ShowEntryForm(FormState MyState)
        {
            try
            {
                FormHelpers.CursorWait(true);
                var frm = new frmComponent();
                switch (MyState)
                {
                case FormState.Add:
                    break;

                case FormState.Edit:
                case FormState.View:
                    var year = UserSettings.LogInYear;
                    var no   = mgridList.Rows[mgridList.SelectedCells[0].RowIndex].Cells["colPartNo"].Value.ToString();
                    frm.yearused = year;
                    frm.partno   = no;
                    break;
                }
                frm.MyState  = MyState;
                frm.MyCaller = this;
                FormHelpers.ShowForm(frm, (MetroForm)this.MdiParent);
            }
            catch (Exception ex)
            {
                MessageHelpers.ShowError(ex.Message);
            }
            finally
            {
                FormHelpers.CursorWait(false);
            }
        }
Exemplo n.º 3
0
        private void RegisterRegisterScriptHelper(HandlebarsDotNet.IHandlebars hbs, Page page, string sourceFolder)
        {
            hbs.RegisterHelper("registerscript", (writer, context, parameters) =>
            {
                if (parameters.Length == 1)
                {
                    string jsfilename = parameters[0].ToString();
                    DnnUtils.RegisterScript(page, sourceFolder, jsfilename, _jsOrder);
                    _jsOrder++;
                }
            });
            hbs.RegisterHelper("registerform", (writer, context, parameters) =>
            {
                string view = "bootstrap";
                if (parameters.Length == 1)
                {
                    view = parameters[0].ToString();
                }

                FormHelpers.RegisterForm(page, sourceFolder, view, ref _jsOrder);
            });

            hbs.RegisterHelper("registereditform", (writer, context, parameters) =>
            {
                string prefix = "";
                if (parameters.Length == 1)
                {
                    prefix = parameters[0].ToString();
                }
                FormHelpers.RegisterEditForm(page, sourceFolder, PortalSettings.Current.PortalId, prefix, ref _jsOrder);
            });
        }
Exemplo n.º 4
0
        private void ButtonSettings_Click(object sender, EventArgs e)
        {
            using (var settings = new Form_Settings())
            {
                SetChildFormCenter(settings);
                ApplicationStateManager.CurrentForm = ApplicationStateManager.CurrentFormState.Settings;
                settings.ShowDialog();
                ApplicationStateManager.CurrentForm = ApplicationStateManager.CurrentFormState.Main;

                if (settings.IsRestartNeeded)
                {
                    if (!settings.SetDefaults)
                    {
                        MessageBox.Show(
                            Tr("Settings change requires NiceHash Miner Legacy to restart."),
                            Tr("Restart Notice"),
                            MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    ApplicationStateManager.RestartProgram();
                    return;
                }
            }
            FormHelpers.TranslateFormControls(this);
            InitMainConfigGuiData();
            // TODO check this later
            IdleCheckManager.StartIdleCheck(ConfigManager.GeneralConfig.IdleCheckType, IdleCheck);
        }
Exemplo n.º 5
0
        private void ShowEntryForm(FormState Mystate)
        {
            try
            {
                FormHelpers.CursorWait(true);
                var frm = new frmMODRC();
                switch (Mystate)
                {
                case FormState.Add:
                    break;

                case FormState.Edit:
                case FormState.View:
                    var mrcode = mgridList.Rows[mgridList.SelectedCells[0].RowIndex].Cells["colSectionCode"].Value.ToString();
                    frm.mrcode = mrcode;
                    break;
                }
                frm.MyState  = Mystate;
                frm.MyCaller = this;
                FormHelpers.ShowForm(frm, (MetroForm)this.MdiParent);
            }
            catch (Exception ex)
            {
                MessageHelpers.ShowError(ex.Message);
            }
            finally
            {
                FormHelpers.CursorWait(false);
            }
        }
 private void PreviewComparison(string strRptName)
 {
     try
     {
         FormHelpers.CursorWait(true);
         frm_ReportViewer frv = new frm_ReportViewer();
         frv.report             = new ReportTable();
         frv.report.ReportName  = strRptName;
         frv.report.ReportPath  = ObjectFinder.ReportPath;
         frv.report.SourceTable = rptdetails.SP_GeneratePriceListComparison(Convert.ToInt32(mcbofrstYear.SelectedValue), Convert.ToInt32(mcboscndYear.SelectedValue), BPSUtilitiesV1.NZ(mcboCategory.SelectedValue, "").ToString());
         if (frv.report.SourceTable == null || frv.report.SourceTable.Rows.Count == 0)
         {
             throw new Exception("Report no Data");
         }
         frv.Text          = "Price List Comparison Report";
         frv.StartPosition = FormStartPosition.CenterScreen;
         frv.Show();
     }
     catch (Exception ex)
     {
         MessageHelpers.ShowError(ex.Message);
     }
     finally
     {
         FormHelpers.CursorWait(false);
     }
 }
Exemplo n.º 7
0
        public SignUpPage_Merchant()
        {
            InitializeComponent();
            NavigationPage.SetHasNavigationBar(this, false);

            FormHelpers.ChainEntries(BusinessNameEntry, CountryPicker, MobileNumberEntry, EmailEntry);
        }
        private void mbtnGenerate_Click(object sender, EventArgs e)
        {
            var msg_succ   = "Generating Successful!";
            var msg_failed = "No Data Generated!";

            try
            {
                FormHelpers.CursorWait(true);
                var checkdt = rptdetails.SP_GenerateVariance(mcboMonth.SelectedIndex + 1, Convert.ToInt16(mtxtYear.Text));
                if (checkdt == null || checkdt.Rows.Count == 0)
                {
                    throw new Exception(msg_failed);
                }
                else
                {
                    MessageHelpers.ShowInfo(msg_succ);
                }
            }
            catch (Exception ex)
            {
                MessageHelpers.ShowError(ex.Message);
            }
            finally
            {
                FormHelpers.CursorWait(false);
            }
        }
 private void Preview(string strRptName)
 {
     try
     {
         FormHelpers.CursorWait(true);
         frm_ReportViewer frv1 = new frm_ReportViewer();
         frv1.report             = new ReportTable();
         frv1.report.ReportName  = strRptName;
         frv1.report.ReportPath  = ObjectFinder.ReportPath;
         frv1.report.SourceTable = rptdetails.SP_GenerateVariance(mcboMonth.SelectedIndex + 1, Convert.ToInt16(mtxtYear.Text));
         if (frv1.report.SourceTable == null || frv1.report.SourceTable.Rows.Count == 0)
         {
             throw new Exception("Report no Data!");
         }
         frv1.Text          = "Variance Costing Report";
         frv1.StartPosition = FormStartPosition.CenterScreen;
         frv1.Show();
     }
     catch (Exception ex)
     {
         MessageHelpers.ShowError(ex.Message);
     }
     finally
     {
         FormHelpers.CursorWait(false);
     }
 }
Exemplo n.º 10
0
 public frmCategoryList()
 {
     InitializeComponent();
     Categorybal = new CategoryBAL();
     FormHelpers.FormatForm(this.Controls);
     RefreshGrid();
 }
Exemplo n.º 11
0
        private void ShowEntryForm(FormState Mystate)
        {
            try
            {
                FormHelpers.CursorWait(true);
                var frm = new frmCategory();
                switch (Mystate)
                {
                case FormState.Add:
                    break;

                case FormState.Edit:
                case FormState.View:
                    var ccode = mgridList.Rows[mgridList.SelectedCells[0].RowIndex].Cells["colCATCODE"].Value.ToString();
                    frm.CategoryCode = ccode;
                    var cyearused = UserSettings.LogInYear;
                    frm.YearUsed = Convert.ToInt32(cyearused);
                    break;
                }
                frm.MyState  = Mystate;
                frm.MyCaller = this;
                FormHelpers.ShowForm(frm, (MetroForm)this.MdiParent);
            }
            catch (Exception ex)
            {
                MessageHelpers.ShowError(ex.Message);
            }
            finally
            {
                FormHelpers.CursorWait(false);
            }
        }
Exemplo n.º 12
0
 private void metroButton2_Click(object sender, EventArgs e)
 {
     FormHelpers.CursorWait(true);
     try
     {
         if (mgridRights.SelectedRows.Count < 1)
         {
             throw new Exception("No selected User Rights!");
         }
         else
         {
             var usrgrpcode = BPSUtilitiesV1.NZ(mgridRights.SelectedRows[0].Cells["colUserGroupCode"].Value, "").ToString();
             var menuid = Convert.ToInt32(BPSUtilitiesV1.NZ(mgridRights.SelectedRows[0].Cells["colMenuID"].Value, 0));
             if (usrgrpcode != "" && menuid != 0)
             {
                 Removeright(usrgrpcode, menuid);
             }
         }
     }
     catch (Exception ex)
     {
         MessageHelpers.ShowError(ex.Message);
     }
     finally
     {
         FormHelpers.CursorWait(false);
     }
 }
Exemplo n.º 13
0
        private void ShowEntryForm(FormState MyState)
        {
            try
            {
                FormHelpers.CursorWait(true);
                var frmpi = new frmMT_PI();
                switch (MyState)
                {
                case FormState.Add:
                    break;

                case FormState.Edit:
                case FormState.View:
                    frmpi.yearused = UserSettings.LogInYear;
                    var mno = mgridListPI.Rows[mgridListPI.SelectedCells[0].RowIndex].Cells["colMoldNo"].Value.ToString();
                    frmpi.moldno = mno;
                    break;
                }
                frmpi.MyState  = MyState;
                frmpi.MyCaller = this;
                FormHelpers.ShowForm(frmpi, (MetroForm)this.MdiParent);
            }
            catch (Exception ex)
            {
                MessageHelpers.ShowError(ex.Message);
            }
            finally
            {
                FormHelpers.CursorWait(false);
            }
        }
        public StartupLoadingControl(string title = null)
        {
            InitializeComponent();
            if (!string.IsNullOrEmpty(title))
            {
                PrimaryTitle = title;
            }
            SecondaryVisible            = false;
            label_LoadingTitle.Location = new Point((Size.Width - label_LoadingTitle.Size.Width) / 2,
                                                    label_LoadingTitle.Location.Y);

            PrimaryProgress = new Progress <(string loadMessageText, int perc)>(p =>
            {
                Progress        = p.perc;
                LoadMessageText = p.loadMessageText;
            });

            SecondaryProgress = new Progress <(string loadMessageText, int perc)>(p =>
            {
                ProgressSecond        = p.perc;
                LoadMessageTextSecond = p.loadMessageText;
            });

            FormHelpers.TranslateFormControls(this);
        }
Exemplo n.º 15
0
        private void StokHareketleriDuzenle()
        {
            dtoStokHareket = new StokHareketleriDto()
            {
                AktifMi   = true,
                HareketId = viewStokHareket.HareketId
            };

            dtoStokHareket.FisNo          = txtFisNumarasi.Text;
            dtoStokHareket.Miktar         = FormHelpers.TextNullCheck(txtMiktar.Text) ? Convert.ToInt32(txtMiktar.Text) : -1;
            dtoStokHareket.HareketDurumId = Convert.ToInt32(lookUpDurum.EditValue) > 0 ? Convert.ToInt32(lookUpDurum.EditValue) : -1;
            dtoStokHareket.KayitTarihi    = dtpKayitTarihi.DateTime;
            dtoStokHareket.KullaniciId    = kullaniciId;
            dtoStokHareket.StokKartId     = Convert.ToInt32(lookUpUrun.EditValue) > 0 ? Convert.ToInt32(lookUpUrun.EditValue) : -1;

            StokHareketleriBll stokHareketleriBLL = new StokHareketleriBll();


            CudEnums enums = stokHareketleriBLL.StokHareketiGuncelle(dtoStokHareket);

            if (enums == CudEnums.IslemBasarili)
            {
                FormHelpers.ClearTextboxes(this.Controls);
                dtpKayitTarihi.DateTime = DateTime.Now;
            }

            FormHelpers.ShowMessage(enums);
        }
Exemplo n.º 16
0
 private void PreviewReportSummaryWDetails(string spname, string strRptName)
 {
     try
     {
         FormHelpers.CursorWait(true);
         frm_ReportViewer frv = new frm_ReportViewer();
         frv.report             = new ReportTable();
         frv.report.ReportName  = strRptName;
         frv.report.ReportPath  = ObjectFinder.ReportPath;
         frv.report.SourceTable = rptdetails.SP_GeneratePriceListWDetails(spname, UserSettings.LogInYear);
         if (frv.report.SourceTable == null || frv.report.SourceTable.Rows.Count == 0)
         {
             throw new Exception("Report no Data");
         }
         frv.Text          = "Price List Report with Details";
         frv.StartPosition = FormStartPosition.CenterScreen;
         frv.Show();
     }
     catch (Exception ex)
     {
         MessageHelpers.ShowError(ex.Message);
     }
     finally
     {
         FormHelpers.CursorWait(false);
     }
 }
Exemplo n.º 17
0
        private async Task <dynamic> PostWall(dynamic parameters, CancellationToken ct)
        {
            using (var dc = await DataConnection.CreateAsync())
            {
                var recipient = await dc.GetPersonByUsernameAsync(parameters.username);

                var sender = await dc.GetPersonByGuidAsync(CurrentUserGuid());

                var message = FormHelpers.GetString(Request.Form, "wallpost");
                if (string.IsNullOrWhiteSpace(message))
                {
                    ViewBag.Error = "Please type a message before submitting!";
                }
                else
                {
                    int test;
                    if (int.TryParse(FormHelpers.GetString(Request.Form, "graph"), out test))
                    {
                        var graph = await dc.GetGraphByIdAsync(test);


                        await dc.InsertWallPostAsync(new WallPost(0, sender, recipient, message, graph));

                        //insert doesnt touch the id and the object gets destroyed after, so we just use temp value. np.
                    }
                    else
                    {
                        await dc.InsertWallPostAsync(new WallPost(0, sender, recipient, message));
                    }
                }
            }

            return(Response.AsRedirect("."));
        }
Exemplo n.º 18
0
        private void mbtnGenerate_Click(object sender, EventArgs e)
        {
            var msg_succ   = "Generating Successful!";
            var msg_failed = "No Data Generated!";

            if (MessageHelpers.ShowQuestion("Generate Report?") == System.Windows.Forms.DialogResult.Yes)
            {
                try
                {
                    FormHelpers.CursorWait(true);
                    rptdetails.SP_GeneratePriceList(UserSettings.LogInYear, BPSolutionsTools.BPSUtilitiesV1.NZ(mcboCategory.SelectedValue, "").ToString());
                    tmp_SCsummlist = tmp_SCsummbal.GetAll();
                    if (tmp_SCsummlist.Count > 0)
                    {
                        MessageHelpers.ShowInfo(msg_succ);
                    }
                    else
                    {
                        throw new Exception(msg_failed);
                    }
                }
                catch (Exception ex)
                {
                    MessageHelpers.ShowError(ex.Message);
                }
                finally
                {
                    FormHelpers.CursorWait(false);
                }
            }
        }
        private void mbtnGenerate_Click(object sender, EventArgs e)
        {
            var msg_succ   = "Generating Successful!";
            var msg_failed = "No Data Generated!";

            if (MessageHelpers.ShowQuestion("Generate Report?") == System.Windows.Forms.DialogResult.Yes)
            {
                try
                {
                    FormHelpers.CursorWait(true);
                    if (rptdetails.SP_GeneratePriceListComparison(Convert.ToInt32(mcbofrstYear.SelectedValue), Convert.ToInt32(mcboscndYear.SelectedValue), BPSUtilitiesV1.NZ(mcboCategory.SelectedValue, "").ToString()).Rows.Count == 0)
                    {
                        throw new Exception(msg_failed);
                    }
                    else
                    {
                        MessageHelpers.ShowInfo(msg_succ);
                    }
                }
                catch (Exception ex)
                {
                    MessageHelpers.ShowError(ex.Message);
                }
                finally
                {
                    FormHelpers.CursorWait(false);
                }
            }
        }
Exemplo n.º 20
0
 private void PreviewReportSummary(string strRptName)
 {
     try
     {
         FormHelpers.CursorWait(true);
         frm_ReportViewer frv = new frm_ReportViewer();
         frv.report             = new ReportTable();
         frv.report.ReportName  = strRptName;
         frv.report.ReportPath  = ObjectFinder.ReportPath;
         frv.report.SourceTable = rptdetails.SP_GeneratePriceList(UserSettings.LogInYear, BPSolutionsTools.BPSUtilitiesV1.NZ(mcboCategory.SelectedValue, "").ToString());
         if (frv.report.SourceTable == null || frv.report.SourceTable.Rows.Count == 0)
         {
             throw new Exception("Report no Data!");
         }
         frv.Text          = "Price List Report";
         frv.StartPosition = FormStartPosition.CenterScreen;
         frv.Show();
     }
     catch (Exception ex)
     {
         MessageHelpers.ShowError(ex.Message);
     }
     finally
     {
         FormHelpers.CursorWait(false);
     }
 }
Exemplo n.º 21
0
        public async Task <IReadableStringCollection> GetFormAsync(CancellationToken cancellationToken)
        {
            if (_features == null)
            {
                return(_form);
            }

            var body = _request.Fetch(_features).Body;

            if (_bodyStream == null || _bodyStream != body)
            {
                _bodyStream = body;
                if (!_bodyStream.CanSeek)
                {
                    var buffer = new MemoryStream();
                    await _bodyStream.CopyToAsync(buffer, 4096, cancellationToken);

                    _bodyStream = buffer;
                    _request.Fetch(_features).Body = _bodyStream;
                    _bodyStream.Seek(0, SeekOrigin.Begin);
                }
                using (var streamReader = new StreamReader(_bodyStream, Encoding.UTF8,
                                                           detectEncodingFromByteOrderMarks: true,
                                                           bufferSize: 1024, leaveOpen: true))
                {
                    string form = await streamReader.ReadToEndAsync();

                    _form = FormHelpers.ParseForm(form);
                }
            }
            return(_form);
        }
Exemplo n.º 22
0
        private void ChangePassword(object sender, EventArgs e)
        {
            frmUserPassword frm = new frmUserPassword();

            frm.MyCaller = this;
            FormHelpers.ShowDialog(frm);
        }
Exemplo n.º 23
0
        public Form_Main()
        {
            InitializeComponent();
            CenterToScreen();
            Icon = NHMCore.Properties.Resources.logo;
            errorWarningProvider2.Icon = new IconEx(IconEx.SystemIcons.Warning, new Size(16, 16)).Icon; // SystemIcons.Warning;
            labelWarningNotProfitableOrNoIntenret.Visible = false;
            InitElevationWarning();
            this.TopMost = ConfigManager.GeneralConfig.GUIWindowsAlwaysOnTop;

            devicesListViewEnableControl1 = devicesMainBoard1.SpeedsControl;
            FormHelpers.SubscribeAllControls(this);

            Width  = ConfigManager.GeneralConfig.MainFormSize.X;
            Height = ConfigManager.GeneralConfig.MainFormSize.Y;

            Text = ApplicationStateManager.Title;

            notifyIcon1.Icon = NHMCore.Properties.Resources.logo;
            notifyIcon1.Text = Application.ProductName + " v" + Application.ProductVersion +
                               "\n" + Tr("Double-click to restore...");

            linkLabelNewVersion.Text = "";

            InitMainConfigGuiData();
            devicesMainBoard1.SecondPanelVisible = false;
            labelDemoMode.DataBindings.AddSafeBinding("Visible", MiningState.Instance, nameof(MiningState.Instance.IsDemoMining), true, DataSourceUpdateMode.OnPropertyChanged);
            labelDemoMode.BringToFront();
            labelDemoMode.VisibleChanged += LabelDemoMode_VisibleChanged;
            InitControlValidators();
            FormHelpers.TranslateFormControls(this);
        }
Exemplo n.º 24
0
        private void sectionToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //new section form
            var frm = new frmSectionList();

            FormHelpers.ShowForm(frm, this);
        }
Exemplo n.º 25
0
        private void GenerateReport(string strRptName, string spname)
        {
            try
            {
                FormHelpers.CursorWait(true);
                if (strRptName == "")
                {
                    MessageBox.Show("No Report Available!");
                }
                else
                {
                    frm_ReportViewer frv = new frm_ReportViewer();
                    frv.report             = new ReportTable();
                    frv.report.ReportName  = strRptName;
                    frv.report.ReportPath  = ObjectFinder.ReportPath;
                    frv.report.SourceTable = rptdetails.SP_dtComponent(spname, UserSettings.LogInYear);
                    if (frv.report.SourceTable == null || frv.report.SourceTable.Rows.Count == 0)
                    {
                        throw new Exception("Report no Data!");
                    }
                    frv.Text          = "Components Report";
                    frv.StartPosition = FormStartPosition.CenterScreen;

                    frv.Show();
                }
            }
            catch (Exception ex)
            {
                MessageHelpers.ShowError(ex.Message);
            }
            finally
            {
                FormHelpers.CursorWait(false);
            }
        }
Exemplo n.º 26
0
        private void Delete()
        {
            try
            {
                FormHelpers.CursorWait(true);
                var msg = "Deleting";
                if (MessageHelpers.ShowQuestion("Are you sure you want to delete record?") == System.Windows.Forms.DialogResult.Yes)
                {
                    var yearused = UserSettings.LogInYear;
                    var partno   = mgridListVP.Rows[mgridListVP.SelectedCells[0].RowIndex].Cells["colPartNoVP"].Value.ToString();

                    vp = vpbal.GetByID(Convert.ToInt32(yearused), partno.ToString());;
                    if (vpbal.Delete(vp))
                    {
                        MessageHelpers.ShowInfo(msg + " Successful!");
                        RefreshGrid();
                        PageManager(1);
                    }
                    else
                    {
                        MessageHelpers.ShowWarning(msg + " Failed!");
                    }
                }
            }
            catch (Exception ex)
            {
                MessageHelpers.ShowError(ex.Message);
            }
            finally
            {
                FormHelpers.CursorWait(false);
            }
        }
Exemplo n.º 27
0
        protected override async Task <TokenResponse> ExchangeCodeAsync(string code, string redirectUri)
        {
            var queryBuilder = new QueryBuilder()
            {
                { "grant_type", "authorization_code" },
                { "code", code },
                { "redirect_uri", redirectUri },
                { "client_id", Options.AppId },
                { "client_secret", Options.AppSecret },
            };

            var tokenResponse = await Backchannel.GetAsync(Options.TokenEndpoint + queryBuilder.ToString(), Context.RequestAborted);

            tokenResponse.EnsureSuccessStatusCode();
            string oauthTokenResponse = await tokenResponse.Content.ReadAsStringAsync();

            IFormCollection form     = FormHelpers.ParseForm(oauthTokenResponse);
            var             response = new JObject();

            foreach (string key in form.Keys)
            {
                response.Add(string.Equals(key, "expires", StringComparison.OrdinalIgnoreCase) ? "expires_in" : key, form[key]);
            }
            // The refresh token is not available.
            return(new TokenResponse(response));
        }
Exemplo n.º 28
0
        public void StokHareketiKaydet()
        {
            DynamicTryCatch.TryCatchLogla(() =>
            {
                dtoStokHareket                = new StokHareketleriDto();
                dtoStokHareket.FisNo          = txtFisNumarasi.Text;
                dtoStokHareket.Miktar         = FormHelpers.TextNullCheck(txtMiktar.Text) ? Convert.ToInt32(txtMiktar.Text) : -1;
                dtoStokHareket.HareketDurumId = Convert.ToInt32(lookUpDurum.EditValue) > 0 ? Convert.ToInt32(lookUpDurum.EditValue) : -1;
                dtoStokHareket.KayitTarihi    = dtpKayitTarihi.DateTime;
                dtoStokHareket.KullaniciId    = kullaniciId;
                dtoStokHareket.StokKartId     = Convert.ToInt32(lookUpUrun.EditValue) > 0 ? Convert.ToInt32(lookUpUrun.EditValue) : -1;
                dtoStokHareket.AktifMi        = true;
            }, MethodBase.GetCurrentMethod().Name);

            StokHareketleriBll stokHareketleri = new StokHareketleriBll();

            CudEnums enums = stokHareketleri.StokHareketiEkle(dtoStokHareket);

            if (enums == CudEnums.IslemBasarili)
            {
                FormHelpers.ClearTextboxes(this.Controls);
                dtpKayitTarihi.DateTime = DateTime.Now;
            }

            FormHelpers.ShowMessage(enums);
        }
Exemplo n.º 29
0
        private void ShowEntryForm(FormState Mystate)
        {
            try
            {
                FormHelpers.CursorWait(true);
                var frm = new frmWIPCosting();
                switch (Mystate)
                {
                case FormState.Add:
                    break;

                case FormState.Edit:
                case FormState.View:
                    var recid = Convert.ToInt64(BPSolutionsTools.BPSUtilitiesV1.NZ(mgridList.Rows[mgridList.SelectedCells[0].RowIndex].Cells["colRecID"].Value, 0));
                    frm.recid = recid;
                    var itemno = BPSolutionsTools.BPSUtilitiesV1.NZ(mgridList.Rows[mgridList.SelectedCells[0].RowIndex].Cells["colItemNo"].Value, "").ToString();
                    frm.itemno = itemno;
                    var partcode = BPSolutionsTools.BPSUtilitiesV1.NZ(mgridList.Rows[mgridList.SelectedCells[0].RowIndex].Cells["colPartNo"].Value, "").ToString();
                    frm.partcode = partcode;
                    break;
                }
                frm.MyState  = Mystate;
                frm.MyCaller = this;
                FormHelpers.ShowForm(frm, (MetroForm)this.MdiParent);
            }
            catch (Exception ex)
            {
                MessageHelpers.ShowError(ex.Message);
            }
            finally
            {
                FormHelpers.CursorWait(false);
            }
        }
Exemplo n.º 30
0
 private void SaveRecord()
 {
     try
     {
         FormHelpers.CursorWait(true);
         if (IsValid())
         {
             AssignRecord(true);
             if (compbal.Update(comp))
             {
                 MessageHelpers.ShowInfo("Update Successful!");
                 MyState = FormState.View;
                 Init_Form();
             }
             else
             {
                 MessageHelpers.ShowWarning("Update Failed!");
             }
         }
     }
     catch (Exception ex)
     {
         MessageHelpers.ShowError(ex.Message);
     }
     finally
     {
         FormHelpers.CursorWait(false);
     }
 }