protected void Button1_Click(object sender, EventArgs e)
        {
            Response.Write("google");
            try
            {
                IOrganizationService service;
                string userName = "******";
                string password = "******";
                string orgUrl   = "https://edusysglobalservices.api.crm5.dynamics.com/XRMServices/2011/Organization.svc";
                service = EDUsys.CreateService(userName, password, orgUrl);

                DataTable dtTable = EDUsys.GetContacts(service, 1, TextBox1.Text);
                //     EDUsys.GetContacts(service, 1, "Su");
                if (dtTable.Rows.Count > 0)
                {
                    GridView1.DataSource = dtTable;
                    GridView1.DataBind();
                }
                else
                {
                    Response.Write("No data found");
                }
            }

            catch (Exception l) {
                Response.Write(l.Message);
            }
        }
Ejemplo n.º 2
0
        public IOrganizationService connection_to_crm()
        {
            IOrganizationService service = null;

            try
            {
                string userName = TextBox1.Text; //"*****@*****.**";
                string password = TextBox2.Text; //"Saxu0104";
                string orgUrl   = "https://edusysglobalservices.api.crm5.dynamics.com/XRMServices/2011/Organization.svc";
                service = EDUsys.CreateService(userName, password, orgUrl);

                return(service);
            }
            catch (Exception v)
            {
                Response.Write(v.Message);
            }
            return(service);
        }
 public void connection_to_crm()
 {
     try
     {
         IOrganizationService service;
         string userName      = "******";
         string password      = "******";
         string OwnerFullName = "Quote VMEdu";
         string orgUrl        = "https://edusysglobalservices.api.crm5.dynamics.com/XRMServices/2011/Organization.svc";
         service = EDUsys.CreateService(userName, password, orgUrl);
         string ownerUserGUID = EDUsys.ValidateOwnerWithCRMUser(service, OwnerFullName);
         Response.Write("The owner guid is " + ownerUserGUID);
         //string QuoteGUID = EDUsys.CreateQuote(service, string topic, string ContactGUID, DateTime estCloseDate, int probabiliy, int Phase, int Rating, string OwnerUserGUID, bool Revenue, decimal EstRevenue, decimal DiscountPercent, decimal ProductTotal, decimal DiscountAmount, decimal PreFreightAmount, decimal TotalAmount, int Quantity, decimal PricePerUnit, decimal ExtendedAmount);
     }
     catch (Exception v)
     {
         Response.Write(v.Message);
     }
 }
        public IOrganizationService connection_to_crm()
        {
            IOrganizationService service = null;

            try
            {
                string userName = "******";
                string password = "******";
                string orgUrl   = "https://edusysglobalservices.api.crm5.dynamics.com/XRMServices/2011/Organization.svc";
                service = EDUsys.CreateService(userName, password, orgUrl);
                return(service);
                //dtTable = EDUsys.GetContacts(service, 3, search_key);// search by last name(3)
                /// Response.Write("The owner guid is "+ownerUserGUID);
                //string QuoteGUID = EDUsys.CreateQuote(service, string topic, string ContactGUID, DateTime estCloseDate, int probabiliy, int Phase, int Rating, string OwnerUserGUID, bool Revenue, decimal EstRevenue, decimal DiscountPercent, decimal ProductTotal, decimal DiscountAmount, decimal PreFreightAmount, decimal TotalAmount, int Quantity, decimal PricePerUnit, decimal ExtendedAmount);
            }
            catch (Exception v)
            {
                Response.Write(v.Message);
            }
            return(service);
        }