Esempio n. 1
0
        private void btnReset_Click(object sender, System.EventArgs e)
        {
            if (MessageBox.Show(this,
                                "Premere OK solo se si è esattamente CERTI di quello che si sta facendo e " +
                                "se si è sotto la STRETTISSIMA tutela di un tecnico della software and more.",
                                "Attenzione", MessageBoxButtons.OKCancel) != DialogResult.OK)
            {
                btnReset.Visible         = false;
                btnRemoveLicense.Visible = false;
                btnOK.Visible            = false;
                Meta.CanSave             = false;
                return;
            }
            string     pwdChangeServer;
            FrmAskCode F = new FrmAskCode(0);

            F.txtID.PasswordChar = '?';
            DialogResult D = F.ShowDialog(this);

            if (D != DialogResult.OK)
            {
                return;
            }
            pwdChangeServer = F.txtID.Text;
            if (pwdChangeServer != "DoMasterChangeServer")
            {
                return;
            }
            DataRow R = DS.license.Rows[0];

            CalcolaInformazioni(R);
            R["checkflag"] = CheckFlags.CalcolaCheckFlag(R);
            R["checkman"]  = CheckFlags.CalcolaCheckMan(R);
            R["licstatus"] = "B";           //stato iniziale del nuovo db='bloccato'
            R["checklic"]  = CheckFlags.CalcolaCheckLic(R);

            //SetImpostazioniDefault(R);
            abilitaricalcolo = true;
            Meta.FreshForm(true);
            MessageBox.Show("Server del db n." + R["iddb"].ToString() + " reimpostato.");
        }
Esempio n. 2
0
        private void btnRemoveLicense_Click(object sender, System.EventArgs e)
        {
            if (MessageBox.Show(this,
                                "Premere OK solo se si è esattamente CERTI di quello che si sta facendo e " +
                                "se si è sotto la STRETTISSIMA tutela di un tecnico della software and more.",
                                "Attenzione", MessageBoxButtons.OKCancel) != DialogResult.OK)
            {
                btnReset.Visible         = false;
                btnRemoveLicense.Visible = false;
                btnOK.Visible            = false;
                Meta.CanSave             = false;
                return;
            }
            string     pwdChangeServer;
            FrmAskCode F = new FrmAskCode(0);

            F.txtID.PasswordChar = '?';
            DialogResult D = F.ShowDialog(this);

            if (D != DialogResult.OK)
            {
                return;
            }
            pwdChangeServer = F.txtID.Text;
            if (pwdChangeServer != "DoMasterChangeServer")
            {
                return;
            }
            DataRow R = DS.license.Rows[0];

            R["servername"]  = DBNull.Value;
            R["dbname"]      = DBNull.Value;
            R["swmorecode"]  = DBNull.Value;
            R["swmoreflag"]  = DBNull.Value;
            R["iddb"]        = DBNull.Value;
            abilitaricalcolo = true;
            Meta.FreshForm(true);
            MessageBox.Show("Informazioni sulla licenza eliminate");
        }
Esempio n. 3
0
        public void MetaData_BeforePost()
        {
            if (DS.license.Rows.Count == 0)
            {
                return;
            }
            Easy_DataAccess E = Meta.Conn as Easy_DataAccess;

            if (E != null)
            {
                if (((Easy_DataAccess)Meta.Conn).ReadOnly)
                {
                    return;
                }
            }
            PostData.RemoveFalseUpdates(DS);
            //if (!DS.HasChanges()) return;
            DataRow R = DS.license.Rows[0];

            if (CfgFn.GetNoNullInt32(R["iddb"]) == 0)
            {
                int mycode = RichiediCodice();
                if (mycode > 0)
                {
                    R["iddb"] = mycode;
                    if (abilitaricalcolo)
                    {
                        SetImpostazioniDefault(R);
                    }
                }
                else
                {
                    string xx = Meta.GetSys("FlagMenuAdmin") as string;
                    if (xx == null)
                    {
                        xx = "";
                    }
                    if (xx.ToUpper() == "S")
                    {
                        string     pwdChangeServer;
                        FrmAskCode F = new FrmAskCode(0);
                        F.txtID.PasswordChar = '?';
                        DialogResult D = F.ShowDialog(this);
                        if (D != DialogResult.OK)
                        {
                            return;
                        }
                        pwdChangeServer = F.txtID.Text;
                        if (pwdChangeServer == "DoMasterSetDB")
                        {
                            FrmAskCode   FF = new FrmAskCode(0);
                            DialogResult DD = FF.ShowDialog(this);
                            if (DD == DialogResult.OK)
                            {
                                mycode = CfgFn.GetNoNullInt32(
                                    HelpForm.GetObjectFromString(typeof(int), FF.txtID.Text, "x.y"));
                                if (mycode > 0)
                                {
                                    R["iddb"] = mycode;
                                }
                            }
                        }
                    }
                }
                string RealCheck = CheckFlags.CalcolaCheckFlag(R);
                R["checkflag"] = RealCheck;
            }
        }