예제 #1
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();
                }
            }
        }