Ejemplo n.º 1
0
 private static void InsertData(Defaultlogin obj, string newDB)
 {
     if (CheckData(obj, newDB) == false)
     {
         CDefaultlogin.Insert(obj, new DAL());
     }
     ;
 }
Ejemplo n.º 2
0
        private void Login_checkBox_CheckedChanged(object sender, EventArgs e)
        {
            Defaultlogin obj = CDefaultlogin_exten.PKId("1", new DAL());

            if (login_checkBox.Checked == true)
            {
                if (obj.Defaultlogin_name != null)
                {
                    if ((txt_user_name.Text == obj.Defaultlogin_name) && (txt_user_password.Text == obj.Default_password))
                    {
                        return;
                    }
                    else
                    {
                        obj.Defaultlogin_id   = "1";
                        obj.Defaultlogin_name = txt_user_name.Text;
                        obj.Default_password  = txt_user_password.Text;
                        obj.Createon          = Current.Datetime;

                        CDefaultlogin.Update(obj, new DAL());
                    }
                }
                else
                {
                    if ((txt_user_name.Text != "") || (txt_user_password.Text != ""))
                    {
                        obj.Defaultlogin_id   = "1";
                        obj.Defaultlogin_name = txt_user_name.Text;
                        obj.Default_password  = txt_user_password.Text;
                        obj.Createon          = Current.Datetime;

                        CDefaultlogin.Insert(obj, new DAL());
                    }
                }
            }
            else if (login_checkBox.Checked == false)
            {
                CDefaultlogin.Delete("1", new DAL());
            }
        }