コード例 #1
0
        private void FxSave()
        {
            string lName    = TxtName.Text.Trim();
            string lIsoCode = TxtIsoCode.Text.Trim();
            string lSymbol  = TxtSymbol.Text.Trim();

            bool lEnabled = ChkEnabled.Checked;

            if (lName.Length < 3)
            {
                ClsFunctions.FxMessage(1, "Ingrese nombre");

                TxtName.Text = "";

                TxtName.Focus();

                return;
            }

            if (lIsoCode.Length < 3)
            {
                ClsFunctions.FxMessage(1, "Ingrese código");

                TxtIsoCode.Text = "";

                TxtIsoCode.Focus();

                return;
            }

            if (lSymbol.Length < 1)
            {
                ClsFunctions.FxMessage(1, "Ingrese símbolo");

                TxtSymbol.Text = "";

                TxtSymbol.Focus();

                return;
            }

            if (ClsFunctions.FxMessage(2, "¿Está seguro de guardar los cambios?") == true)
            {
                long lCurrencyId_new;

                if (lCurrencyId == 0)
                {
                    lCurrencyId_new = ClsSqlCore.Fx_ins_tblCurrency(lName, lIsoCode, lSymbol);
                }
                else
                {
                    lCurrencyId_new = ClsSqlCore.Fx_upt_tblCurrency(lCurrencyId, lName, lIsoCode, lSymbol, lEnabled);
                }

                if (lCurrencyId_new > 0)
                {
                    FxExit();
                }
            }
        }
コード例 #2
0
        private void FxLogo()
        {
            OpenFileDialog ObjOpenFileDialog = new OpenFileDialog
            {
                Title            = "Seleccionar logo",
                Filter           = "PNG|*.png",
                InitialDirectory = ClsVariables.gPathDocs
            };

            lFileLogo = "";

            ImgLogo.Image = null;

            if (ObjOpenFileDialog.ShowDialog() == DialogResult.OK)
            {
                lFileLogo = ObjOpenFileDialog.FileName;

                if (lFileLogo.EndsWith(".png") == false)
                {
                    ClsFunctions.FxMessage(1, "No es un archivo válido. Intente de nuevo");

                    lFileLogo = "";
                }

                ImgLogo.Image = Image.FromFile(lFileLogo);
            }

            ObjOpenFileDialog.Dispose();
        }
コード例 #3
0
        private void FxCancel()
        {
            TxtName.Text    = "";
            TxtIsoCode.Text = "";
            TxtSymbol.Text  = "";

            ChkEnabled.Checked = false;

            TxtName.Enabled    = false;
            TxtIsoCode.Enabled = false;
            TxtSymbol.Enabled  = false;

            ChkEnabled.Enabled = false;

            CmdSave.Enabled = false;

            if (lCurrencyId == 0)
            {
                Text += " - Adicionar";

                TxtName.Enabled    = true;
                TxtIsoCode.Enabled = true;
                TxtSymbol.Enabled  = true;

                ChkEnabled.Checked = true;

                CmdSave.Enabled = true;

                TxtName.Focus();
            }
            else
            {
                Text += " - Modificar";

                DataTable ObjDt = ClsSqlCore.Fx_sel_tblCurrency_detail(lCurrencyId);

                if (ObjDt != null)
                {
                    if (ObjDt.Rows.Count > 0)
                    {
                        TxtName.Text    = ObjDt.Rows[0][0].ToString();
                        TxtIsoCode.Text = ObjDt.Rows[0][2].ToString();
                        TxtSymbol.Text  = ObjDt.Rows[0][3].ToString();

                        ChkEnabled.Checked = ClsFunctions.FxConvertStringToBool(ObjDt.Rows[0][1].ToString());

                        TxtName.Enabled    = true;
                        TxtIsoCode.Enabled = true;
                        TxtSymbol.Enabled  = true;

                        ChkEnabled.Enabled = true;

                        CmdSave.Enabled = true;

                        TxtName.Focus();
                    }
                }
            }
        }
コード例 #4
0
ファイル: FrmMainMenu.cs プロジェクト: grupocenturia/Projects
        private void FxCancel()
        {
            Text = ClsVariables.gTitle;

            LblTitle.Text = "";

            LblStatus.Text = ClsFunctions.FxStatusBar();
        }
コード例 #5
0
        private void FxCancel()
        {
            TxtName.Text = "";


            ChkEnabled.Checked = false;

            TxtName.Enabled = false;


            ChkEnabled.Enabled = false;

            CmdSave.Enabled = false;

            if (lProfileId == 0)
            {
                Text += " - Adicionar";

                TxtName.Enabled = true;


                ChkEnabled.Checked = true;

                CmdSave.Enabled = true;

                TxtName.Focus();
            }
            else
            {
                Text += " - Modificar";

                DataTable ObjDt = ClsSqlAdministrator.Fx_sel_tblProfile_detail(lProfileId);

                if (ObjDt != null)
                {
                    if (ObjDt.Rows.Count > 0)
                    {
                        TxtName.Text = ObjDt.Rows[0][0].ToString();


                        ChkEnabled.Checked = ClsFunctions.FxConvertStringToBool(ObjDt.Rows[0][1].ToString());

                        TxtName.Enabled = true;


                        ChkEnabled.Enabled = true;

                        CmdSave.Enabled = true;

                        TxtName.Focus();
                    }
                }
            }
        }
コード例 #6
0
        private void FxSave()
        {
            string lName     = TxtName.Text.Trim();
            string lUserName = TxtUserName.Text.Trim();

            bool lEnabled = ChkEnabled.Checked;

            if (lName.Length < 3)
            {
                ClsFunctions.FxMessage(1, "Ingrese nombre");

                TxtName.Text = "";

                TxtName.Focus();

                return;
            }

            if (lUserName.Length < 3)
            {
                ClsFunctions.FxMessage(1, "Ingrese usuario");

                TxtUserName.Text = "";

                TxtUserName.Focus();

                return;
            }

            if (ClsFunctions.FxMessage(2, "¿Está seguro de guardar los cambios?") == true)
            {
                long lUserId_new;

                if (lUserId == 0)
                {
                    lUserId_new = ClsSqlAdministrator.Fx_ins_tblUser(lName, lUserName);
                }
                else
                {
                    lUserId_new = ClsSqlAdministrator.Fx_upt_tblUser(lUserId, lName, lUserName, lEnabled);
                }

                if (lUserId_new > 0)
                {
                    FxExit();
                }
            }
        }
コード例 #7
0
        private void FxReset()
        {
            long lUserId;

            try
            {
                lUserId = long.Parse(GrdData.SelectedRows[0].Cells[4].Value.ToString());
            }
            catch
            {
                lUserId = 0;
            }

            if (lUserId == 0)
            {
                ClsFunctions.FxMessage(1, "Seleccione usuario");

                GrdData.Focus();

                return;
            }

            if (ClsFunctions.FxMessage(2, "¿Está seguro de restablecer la constraseña?") == true)
            {
                long lUserId_new = ClsSqlAdministrator.Fx_upt_tblUser_resetPassword(lUserId);

                if (lUserId_new == 0)
                {
                    ClsFunctions.FxMessage(1, "Contraseña no fue restablecida. Intente de nuevo");
                }
                else
                {
                    ClsFunctions.FxMessage("Contraseña fue restablecida satisfactoriamente");

                    FxCancel();
                }
            }
        }
コード例 #8
0
        static void Main(string[] args)
        {
            if (args.Length == 0)
            {
                ClsFunctions.FxMessage(1, "Acceso denegado");
            }
            else
            {
                ClsFunctions.FxGetParametersFromCore(args[0]);

                if (ClsVariables.gUserId == 0)
                {
                    ClsFunctions.FxMessage(1, "Acceso denegado");
                }
                else
                {
                    Application.EnableVisualStyles();
                    Application.SetCompatibleTextRenderingDefault(false);

                    Application.Run(new FrmMainMenu());
                }
            }
        }
コード例 #9
0
ファイル: FrmCountry.cs プロジェクト: grupocenturia/Projects
        private void FxEdit()
        {
            long lCountryId;

            try
            {
                lCountryId = long.Parse(GrdData.SelectedRows[0].Cells[3].Value.ToString());
            }
            catch
            {
                lCountryId = 0;
            }

            if (lCountryId == 0)
            {
                ClsFunctions.FxMessage(1, "Seleccione país");

                GrdData.Focus();

                return;
            }

            FxFormDetail(lCountryId);
        }
コード例 #10
0
        private void FxEdit()
        {
            long lDataTypeId;

            try
            {
                lDataTypeId = long.Parse(GrdData.SelectedRows[0].Cells[2].Value.ToString());
            }
            catch
            {
                lDataTypeId = 0;
            }

            if (lDataTypeId == 0)
            {
                ClsFunctions.FxMessage(1, "Seleccione Tipo de dato");

                GrdData.Focus();

                return;
            }

            FxFormDetail(lDataTypeId);
        }
コード例 #11
0
 private void TxtName_Enter(object sender, EventArgs e)
 {
     ClsFunctions.FxSelectAll(sender);
 }
コード例 #12
0
        private void FxSave()
        {
            string lName      = TxtName.Text.Trim();
            string lTradeName = TxtTradeName.Text.Trim();
            string lShortName = TxtShortName.Text.Trim();
            string lDBName    = TxtDBName.Text.Trim();

            bool lEnabled = ChkEnabled.Checked;

            if (lName.Length < 3)
            {
                ClsFunctions.FxMessage(1, "Ingrese nombre de compañia");

                TxtName.Text = "";

                TxtName.Focus();

                return;
            }

            if (lTradeName.Length < 3)
            {
                ClsFunctions.FxMessage(1, "Ingrese nombre de comercio");

                TxtTradeName.Text = "";

                TxtTradeName.Focus();

                return;
            }

            if (lShortName.Length < 3)
            {
                ClsFunctions.FxMessage(1, "Ingrese nombre corto");

                TxtShortName.Text = "";

                TxtShortName.Focus();

                return;
            }

            if (lDBName.Length < 3)
            {
                ClsFunctions.FxMessage(1, "Ingrese Base de datos");

                TxtDBName.Text = "";

                TxtDBName.Focus();

                return;
            }

            if (ClsFunctions.FxMessage(2, "¿Está seguro de guardar los cambios?") == true)
            {
                long lCompanyId_new;

                if (lCompanyId == 0)
                {
                    lCompanyId_new = ClsSqlAdministrator.Fx_ins_tblCompany(lName, lTradeName, lShortName, lDBName);
                }
                else
                {
                    lCompanyId_new = ClsSqlAdministrator.Fx_upt_tblCompany(lCompanyId, lName, lTradeName, lShortName, lDBName, lEnabled);
                }

                if (lCompanyId_new > 0)
                {
                    FxExit();
                }
            }
        }
コード例 #13
0
        private void FxCancel()
        {
            ImgLogo.Image = null;

            lFileLogo = "";

            TxtName.Text        = "";
            TxtDescription.Text = "";
            TxtExecutable.Text  = "";

            ChkEnabled.Checked = false;

            TxtName.Enabled        = false;
            TxtDescription.Enabled = false;
            TxtExecutable.Enabled  = false;

            ChkEnabled.Enabled = false;

            CmdLogo.Enabled = true;
            CmdSave.Enabled = false;

            if (lModuleId == 0)
            {
                Text += " - Adicionar";

                TxtName.Enabled        = true;
                TxtDescription.Enabled = true;
                TxtExecutable.Enabled  = true;

                ChkEnabled.Checked = true;

                CmdSave.Enabled = true;

                TxtName.Focus();
            }
            else
            {
                Text += " - Modificar";

                DataTable ObjDt = ClsSqlAdministrator.Fx_sel_tblModule_detail(lModuleId);

                if (ObjDt != null)
                {
                    if (ObjDt.Rows.Count > 0)
                    {
                        TxtName.Text        = ObjDt.Rows[0][0].ToString();
                        TxtDescription.Text = ObjDt.Rows[0][1].ToString();
                        TxtExecutable.Text  = ObjDt.Rows[0][2].ToString();

                        ChkEnabled.Checked = ClsFunctions.FxConvertStringToBool(ObjDt.Rows[0][3].ToString());

                        Bitmap ObjLogo;

                        try
                        {
                            ObjLogo = ClsSqlAdministrator.Fx_sel_tblModuleLogo(lModuleId);
                        }
                        catch
                        {
                            ObjLogo = null;
                        }

                        if (ObjLogo != null)
                        {
                            lFileLogo = ClsVariables.gPathTemp + "Img" + ClsFunctions.FxRandomNumber().ToString() + ".png";

                            if (File.Exists(lFileLogo))
                            {
                                ClsFunctions.FxDeleteFile(lFileLogo);
                            }

                            ObjLogo.Save(lFileLogo);

                            ObjLogo.Dispose();

                            ImgLogo.Image = Bitmap.FromFile(lFileLogo);
                        }

                        TxtName.Enabled        = true;
                        TxtDescription.Enabled = true;
                        TxtExecutable.Enabled  = true;

                        ChkEnabled.Enabled = true;

                        CmdSave.Enabled = true;

                        TxtName.Focus();
                    }
                }
            }
        }
コード例 #14
0
        private void FxSave()
        {
            string lName        = TxtName.Text.Trim();
            string lDescription = TxtDescription.Text.Trim();
            string lExecutable  = TxtExecutable.Text.Trim();

            bool lEnabled = ChkEnabled.Checked;

            if (lName.Length < 3)
            {
                ClsFunctions.FxMessage(1, "Ingrese nombre");

                TxtName.Text = "";

                TxtName.Focus();

                return;
            }

            if (lDescription.Length < 3)
            {
                ClsFunctions.FxMessage(1, "Ingrese descripción");

                TxtDescription.Text = "";

                TxtDescription.Focus();

                return;
            }

            if (lExecutable.Length < 3)
            {
                ClsFunctions.FxMessage(1, "Ingrese ejecutable");

                TxtExecutable.Text = "";

                TxtExecutable.Focus();

                return;
            }

            if (ClsFunctions.FxMessage(2, "¿Está seguro de guardar los cambios?") == true)
            {
                long lModuleId_new;

                if (lModuleId == 0)
                {
                    lModuleId_new = ClsSqlAdministrator.Fx_ins_tblModule(lName, lDescription, lExecutable);
                }
                else
                {
                    lModuleId_new = ClsSqlAdministrator.Fx_upt_tblModule(lModuleId, lName, lDescription, lExecutable, lEnabled);
                }

                if (lModuleId_new > 0)
                {
                    if (lFileLogo.Length > 0)
                    {
                        lModuleId_new = ClsSqlAdministrator.Fx_ins_tblModuleLogo(lModuleId_new, lFileLogo);
                    }

                    ClsFunctions.FxMessage("Proceso concluido");

                    FxExit();
                }
            }
        }