Пример #1
0
        public bool editUser(string iConnection, string iUserName, string iOfficeSpaceId, DataTable dt, int currentIndex, string Database)
        {
            Connection    = iConnection;
            UserName      = iUserName;
            OfficeSpaceId = iOfficeSpaceId;
            DatabaseName  = Database;
            if (dt.Rows.Count == 0)
            {
                return(false);
            }

            string POSITION_CODE = dt.Rows[currentIndex]["POSITION_CODE"].ToString();


            frmUser frm = new frmUser();

            frm.Command    = "Edit";
            frm.ID_TEMP    = dt.Rows[currentIndex]["ID"].ToString();
            frm._Title     = dt.Rows[currentIndex]["TITLE"].ToString();
            frm._FIRSTNAME = dt.Rows[currentIndex]["FIRSTNAME"].ToString();
            frm._LASTNAME  = dt.Rows[currentIndex]["LASTNAME"].ToString();
            frm._Password  = dt.Rows[currentIndex]["PASSWORD"].ToString();
            frm._USERNAME  = dt.Rows[currentIndex]["USERNAME"].ToString();

            ConnectServer.cConection cConn = new ConnectServer.cConection(cMain.UserName);
            NextwaverDB.NColumns     NCS   = new NextwaverDB.NColumns();
            NCS.Add(new NextwaverDB.NColumn("POSITION_NAME"));
            NextwaverDB.NWheres NWS = new NextwaverDB.NWheres();
            NWS.Add(new NextwaverDB.NWhere("POSITION_CODE", POSITION_CODE));

            DataTable dtTemp = cConn.Retreive(cMain.Connection, cMain.OfficeSpaceId, cMain.DatabaseName, "position", NCS, NWS);

            frm._POSITION_CODE = POSITION_CODE;
            frm._POSITION_NAME = dtTemp.Rows[0][0].ToString();

            bool bOutput = false;

            if (frm.ShowDialog() == DialogResult.OK)
            {
                bOutput = true;
            }
            if (!frm.IsDisposed)
            {
                frm.Close();
                frm.Dispose();
            }
            return(bOutput);
        }
Пример #2
0
        public bool newUser(string iConnection, string iUserName, string iOfficeSpaceId, string Database)
        {
            Connection    = iConnection;
            UserName      = iUserName;
            OfficeSpaceId = iOfficeSpaceId;
            DatabaseName  = Database;
            frmUser frm = new frmUser();

            frm.Command = "New";
            bool bOutput = false;

            if (frm.ShowDialog() == DialogResult.OK)
            {
                bOutput = true;
            }
            if (!frm.IsDisposed)
            {
                frm.Close();
                frm.Dispose();
            }
            return(bOutput);
        }