예제 #1
0
        protected void btnDebugAdd_Click(object sender, EventArgs e)
        {
            MyFileIt.MyFileItAppServiceClient obj    = new MyFileIt.MyFileItAppServiceClient();
            MyFileIt.MyFileItResult           result = new MyFileIt.MyFileItResult();
            var message = "";
            var id      = 10;
            var res     = obj.GetOrganizations(appGlobal.username, appGlobal.password, id, null);
            //var addedOrgDTO = res.Organizations.First();
            var test        = obj.GetOrganizations(appGlobal.username, appGlobal.password, id, null).Organizations;
            var addedOrgDTO = obj.GetOrganizations(appGlobal.username, appGlobal.password, id, null).Organizations.First();
            var orgDTO      = new OrganizationDTO
            {
                ID                       = addedOrgDTO.ID, //THIS IS IMPORTANT FOR THE UPDATED TO WORK!!!
                NAME                     = "FullOrgCabinet",
                ADDRESS1                 = "840 Sullivan Drive",
                ADDRESS2                 = addedOrgDTO.ADDRESS2,
                CITY                     = "Lansdale test",
                STATECODE                = addedOrgDTO.STATECODE,
                ZIPCODE                  = "19442",
                PHONE                    = "2151234567",
                EMAILADDRESS             = "*****@*****.**",
                ORGANIZATIONTYPEID       = 1,
                CONTACTPERSON            = "Contact name",
                DATECREATED              = addedOrgDTO.DATECREATED,
                ORGANIZATIONSTATUSID     = 1,
                SALESREPID               = 1,
                DIRECTORNAME             = "Director Name",
                DIRECTOREMAIL            = "*****@*****.**",
                DIRECTORPHONE            = "33344455555",
                ALLOWCOACHTOCREATEEVENTS = addedOrgDTO.ALLOWCOACHTOCREATEEVENTS,
                CCALLEMAILTODIRECTOR     = addedOrgDTO.CCALLEMAILTODIRECTOR,
                CABINETID                = addedOrgDTO.CABINETID,
                COMMENT                  = "comments",
                LOGOIMAGE                = addedOrgDTO.LOGOIMAGE
            };
            var responseNew = obj.UpdateOrganization(appGlobal.username, appGlobal.password, orgDTO);

            if (responseNew.Success)
            {
                message = "Successful Update";
            }
            else
            {
                message = "Error on Update user";
            }
            var io = 0;
        }
예제 #2
0
        public bool SaveOrganization()
        {
            try
            {
                var c = new MyFileIt.CoachDTO();

                MyFileIt.MyFileItAppServiceClient obj             = new MyFileIt.MyFileItAppServiceClient();
                MyFileIt.MyFileItResult           result          = new MyFileIt.MyFileItResult();
                MyFileIt.OrganizationDTO          objOrganization = new MyFileIt.OrganizationDTO();
                objOrganization = setdata(objOrganization);
                if (Session["Organization"] != null)
                {
                    objOrganization.ID = Convert.ToInt16(Session["Organization"]);
                    result             = obj.UpdateOrganization(appGlobal.username, appGlobal.password, objOrganization);
                    if (result.Success)
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
                else
                {
                    result = obj.AddOrganization(appGlobal.username, appGlobal.password, objOrganization);
                    if (result.Success)
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
            }
            catch (Exception ex)
            {
                appGlobal.DisplayMsg(ex.Message.ToString(), this);
            }
            return(false);
        }