コード例 #1
0
        protected void btnAddOrgDebug_Click(object sender, EventArgs e)
        {
            var message       = "";
            var username      = "******";
            var svc           = new MyFileItAppService();
            var appUserObject = new AppUserDTO()
            {
                USERNAME           = username,
                EMAILADDRESS       = username,
                PASSWORD           = "******",
                FIRSTNAME          = "first",
                LASTNAME           = "last",
                ADDRESS1           = "ADDRESS1",
                CITY               = "CITY",
                STATECODE          = "PA",
                ZIPCODE            = "19442",
                SEX                = "M",
                PRIMARYAPPUSERID   = 0,
                APPUSERTYPEID      = 4,
                BIRTHDATE          = null,
                PHONE              = "1234",
                RELATIONSHIPTYPEID = 2,
                DATECREATED        = DateTime.UtcNow,
                APPUSERSTATUSID    = 2
            };

            var response = svc.AddAppUser(SERVICEUSER, SERVICEPASS, appUserObject);

            lblMessage.Text = response.Success.ToString();
        }
コード例 #2
0
        protected void btnAddAppUser_Click(object sender, EventArgs e)
        {
            var svc           = new MyFileItAppService();
            var username      = DateTime.Now.Ticks.ToString();
            var appUserObject = new AppUserDTO()
            {
                USERNAME         = username,
                PASSWORD         = "******",
                FIRSTNAME        = "first",
                LASTNAME         = "last",
                ADDRESS1         = "add1",
                CITY             = "cit",
                STATECODE        = "PA",
                ZIPCODE          = "19442",
                SEX              = "M",
                EMAILADDRESS     = "*****@*****.**",
                PRIMARYAPPUSERID = (chkIsPrimaryUser.Checked ? null : (int?)36)
            };
            var response = svc.AddAppUser(SERVICEUSER, SERVICEPASS, appUserObject);
            var message  = "";

            if (response.Success)
            {
                var addedUser = svc.GetAppUsersByEmail(SERVICEUSER, SERVICEPASS, username, null, "pass").AppUsers.First();

                /*var addedUserDTO = new APPUSER
                 * {
                 *  ID = addedUser.ID, //THIS IS IMPORTANT FOR THE UPDATED TO WORK!!!
                 *  USERNAME = username,
                 *  PASSWORD = "******",
                 *  FIRSTNAME = "first",
                 *  LASTNAME = "last",
                 *  ADDRESS1 = "add1",
                 *  CITY = "cit UPDATED",
                 *  STATECODE = "PA",
                 *  ZIPCODE = "19442",
                 *  SEX = "M",
                 *  PRIMARYAPPUSERID = 1
                 * };*/
                addedUser.CITY = "UPDATED CITY " + DateTime.Now.ToString();
                svc.UpdateAppUser(SERVICEUSER, SERVICEPASS, addedUser);
                message = "Successful Add";
            }
            else
            {
                message = "Error on Add user";
            }
            lblMessage.Text = message;
        }