Example #1
0
        public ProfileData getProfileData([FromBody] OrderData input)
        {
            //    string crmURL = VLCC.CustomerOrderData.WEBAPI.Properties.Settings.Default.CRMConnectionString;
            //    CrmConnection connections = CrmConnection.Parse(crmURL);
            //    OrganizationService orgService = new OrganizationService(connections);

            string UserName = VLCC.CustomerOrderData.WEBAPI.Properties.Settings.Default.UserName;
            string Password = VLCC.CustomerOrderData.WEBAPI.Properties.Settings.Default.Password;
            string service  = VLCC.CustomerOrderData.WEBAPI.Properties.Settings.Default.Service;
            IOrganizationService orgService = ConnectToMSCRM(UserName, Password, service);
            Status           status         = new Status();
            ProfileData      _profile       = new ProfileData();
            FetchProfileData fetchProfile   = new FetchProfileData();

            if (!string.IsNullOrEmpty(input.mobile))
            {
                _profile = fetchProfile.fetchProfile(input.mobile, orgService);
            }
            else
            {
                status.code     = "202";
                status.message  = "Mobile Number is mandatory";
                _profile.Status = status;
            }
            return(_profile);
        }
Example #2
0
        public Status updateProfile([FromBody] UpdateProfile input)
        {
            //string crmURL = VLCC.CustomerOrderData.WEBAPI.Properties.Settings.Default.CRMConnectionString;
            //CrmConnection connections = CrmConnection.Parse(crmURL);
            //OrganizationService orgService = new OrganizationService(connections);

            string UserName = VLCC.CustomerOrderData.WEBAPI.Properties.Settings.Default.UserName;
            string Password = VLCC.CustomerOrderData.WEBAPI.Properties.Settings.Default.Password;
            string service  = VLCC.CustomerOrderData.WEBAPI.Properties.Settings.Default.Service;
            IOrganizationService orgService = ConnectToMSCRM(UserName, Password, service);
            Status           status         = new Status();
            FetchProfileData _fetchProfile  = new FetchProfileData();

            if (!string.IsNullOrEmpty(input.mobile))
            {
                status = _fetchProfile.updateProfileData(input, orgService);
            }
            else
            {
                status.code    = "201";
                status.message = "Mobile Number Not present";
            }
            return(status);
        }