public string FBConfigurationInsert(FBConfigurationModels oFBConfigurationModels)
        {
            var customerid = oFBConfigurationModels.CustomerId;

            try
            {
                string result      = string.Empty;
                var    idParameter = new ObjectParameter("Id", typeof(string));
                if (ModelState.IsValid)
                {
                    if (CheckFbClientId(oFBConfigurationModels.FBClientId) == false)
                    {
                        result = oFBConfigurationBL.FBConfigurationInsert(oFBConfigurationModels);
                        return("1");
                    }
                    return("-1");
                }
                return("3");
            }
            catch (Exception ex)
            {
                long CustomerID = Convert.ToInt32(customerid);
                ex.Message.ToString();
                Errorlog.ErrorDetail(CustomerID, orderId, "Sf Configuration Creation", ex.Message, 1);
                return("0");
            }
        }
        public string FBUpdate(FBConfigurationModels oFBConfigurationModels)
        {
            var customerid = oFBConfigurationModels.CustomerId;

            try
            {
                if (ModelState.IsValid)
                {
                    if (CheckFbClientId(oFBConfigurationModels.FBClientId) == false)
                    {
                        var result = oFBConfigurationBL.FBConfigurationEdit(oFBConfigurationModels);
                        return("1");
                    }
                    return("-1");
                }
                return("3");
            }
            catch (Exception ex)
            {
                long CustomerID = Convert.ToInt32(customerid);
                ex.Message.ToString();
                Errorlog.ErrorDetail(CustomerID, orderId, "Sf Configuration Creation", ex.Message, 1);
                return("0");
            }
        }
        public JsonResult EditById(int id)
        {
            var salesforceConnection   = oSaleforceConnector.USP_FBConfiguration_SelectById(id).FirstOrDefault();
            var oFBConfigurationModels = new FBConfigurationModels();

            oFBConfigurationModels.Id               = Convert.ToInt32(salesforceConnection.Id);
            oFBConfigurationModels.FBDataSource     = salesforceConnection.FBDataSource;
            oFBConfigurationModels.FBInitialCatalog = salesforceConnection.FBInitialCatalog;
            oFBConfigurationModels.FBClientId       = salesforceConnection.FBClientId;
            oFBConfigurationModels.FBClientPassword = salesforceConnection.FBClientPassword;
            oFBConfigurationModels.FBPort           = salesforceConnection.FBPort;
            oFBConfigurationModels.FBConnection     = salesforceConnection.FBConnection;
            return(Json(oFBConfigurationModels, JsonRequestBehavior.AllowGet));
        }