Exemplo n.º 1
0
        internal static int AddUserDetails()
        {
            try
            {
                daUSER = new tblLOGINTableAdapter();
                dtUSER = new DAL.DataObjects.dbDSCMainDataSet.tblLOGINDataTable();

                drwUSER = dtUSER.NewtblLOGINRow();

                drwUSER.UserName     = UserInfo.UserName;
                drwUSER.Password     = LoginBLL.EncryptPassword(UserInfo.Password);
                drwUSER.OfficialName = UserInfo.OfficialName;
                drwUSER.AddEntry     = UserInfo.AddEntry;
                drwUSER.EditEntry    = UserInfo.EditEntry;
                drwUSER.DeleteEntry  = UserInfo.DeleteEntry;
                drwUSER.AllowAccess  = UserInfo.AllowAccess;
                drwUSER.ViewEntry    = UserInfo.ViewEntry;
                drwUSER.ManageUsers  = UserInfo.ManageUsers;
                drwUSER.DateCreated  = UserInfo.DateCreated;
                drwUSER.CreatedBy    = UserInfo.CreatedBy;

                drwUSER.ManageFormTypes            = UserInfo.ManageFormTypes;
                drwUSER.DaysBeforeTransactionsLock = UserInfo.DaysBeforeTransactionsLock;


                dtUSER.Rows.Add(drwUSER);
                n = daUSER.Update(dtUSER);
                return(n);
            }
            catch (SqlException ex)
            {
                MessageBox.Show("Error: " + ex.Message.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(n);
            }
        }
Exemplo n.º 2
0
        internal static int SavePassword()
        {
            try
            {
                daUSER = new tblLOGINTableAdapter();
                dtUSER = new dbDSCMainDataSet.tblLOGINDataTable();

                daUSER.FillByUserName(dtUSER, UserInfo.UserName);
                drwUSER = dtUSER[0];

                drwUSER.UserName = UserInfo.UserName;
                drwUSER.Password = LoginBLL.EncryptPassword(UserInfo.Password);

                n = daUSER.Update(dtUSER);
                return(n);
            }
            catch (SqlException ex)
            {
                MessageBox.Show("Error: " + ex.Message.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(n);
            }
        }
Exemplo n.º 3
0
        internal static int UpdateUserDetails()
        {
            try
            {
                daUSER = new tblLOGINTableAdapter();
                dtUSER = new dbDSCMainDataSet.tblLOGINDataTable();

                daUSER.FillById(dtUSER, UserInfo.ID);
                drwUSER = dtUSER[0];

                drwUSER.UserName = UserInfo.UserName;
                if (UserInfo.ChangePassword == true)
                {
                    drwUSER.Password = LoginBLL.EncryptPassword(UserInfo.Password);
                }
                drwUSER.OfficialName = UserInfo.OfficialName;
                drwUSER.AddEntry     = UserInfo.AddEntry;
                drwUSER.EditEntry    = UserInfo.EditEntry;
                drwUSER.DeleteEntry  = UserInfo.DeleteEntry;
                drwUSER.AllowAccess  = UserInfo.AllowAccess;
                drwUSER.ViewEntry    = UserInfo.ViewEntry;
                drwUSER.ManageUsers  = UserInfo.ManageUsers;
                drwUSER.DateModified = UserInfo.DateModified;
                drwUSER.ModifiedBy   = UserInfo.ModifiedBy;

                drwUSER.ManageFormTypes            = UserInfo.ManageFormTypes;
                drwUSER.DaysBeforeTransactionsLock = UserInfo.DaysBeforeTransactionsLock;

                n = daUSER.Update(dtUSER);
                return(n);
            }
            catch (SqlException ex)
            {
                MessageBox.Show("Error: " + ex.Message.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(n);
            }
        }