示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["ServiceUnitID"] == null)
                {
                    return;
                }
            }
            AppUserCollection userColl = new AppUserCollection();

            userColl.es.Connection.Name = "KENCANA";
            AppUserQuery userQ = new AppUserQuery("a");

            userQ.es2.Connection.Name = "KENCANA";
            userQ.SelectAll();
            userColl.Load(userQ);
            if (userColl.Count >= 1)
            {
                foreach (AppUser au in userColl)
                {
                    ADefHelpDeskUsersQuery hlpUserQ = new ADefHelpDeskUsersQuery("uQ");
                    hlpUserQ.es2.Connection.Name = "HELPDESK";
                    hlpUserQ.SelectAll().Where(hlpUserQ.Username == au.UserID);
                    DataTable dtU = hlpUserQ.LoadDataTable();
                    if (dtU.Rows.Count == 0)
                    {
                        ADefHelpDeskUsers hlpUser = new ADefHelpDeskUsers();
                        hlpUser.es.Connection.Name = "HELPDESK";
                        hlpUser.Username           = au.UserID;
                        hlpUser.FirstName          = au.UserName;
                        hlpUser.LastName           = ".";
                        hlpUser.IsSuperUser        = false;
                        hlpUser.Email    = au.UserID + "@rscmkencana.com";
                        hlpUser.Password = au.Password;
                        hlpUser.Save();
                    }
                }
            }
        }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                DataTable    dtU = new DataTable();
                DataTable    dtS = new DataTable();
                AppUserQuery uQ  = new AppUserQuery("a");
                uQ.SelectAll();
                uQ.es2.Connection.Name = "KENCANA";
                ServiceUnitQuery sQ = new ServiceUnitQuery("b");
                sQ.SelectAll();
                sQ.es2.Connection.Name = "KENCANA";
                dtU = uQ.LoadDataTable();
                dtS = sQ.LoadDataTable();

                storeServiceUnit.DataSource = dtS;
                storeServiceUnit.DataBind();
                storeUser.DataSource = dtU;
                storeUser.DataBind();

                smGrdServiceUnit.Select(0);
                smGrdServiceUnit.UpdateSelection();
            }
        }