Exemple #1
0
    public static string GetServiceSubTypes(int customerId, int[] selectedSourceIds)
    {
        var objAdminBAL = new clsAdminBAL(strToolConnString, strToolConnType);
        var json        = JsonConvert.SerializeObject(objAdminBAL.GetServiceSubTypesForSource(customerId, selectedSourceIds));

        return(json);
    }
Exemple #2
0
    public static string GetCustomer(int customerId)
    {
        var objAdminBAL = new clsAdminBAL(strToolConnString, strToolConnType);
        var json        = JsonConvert.SerializeObject(objAdminBAL.GetCustomer(customerId));

        return(json);
    }
Exemple #3
0
    public static string ValidateDataSource(int[] allSelectedSourceIds)
    {
        var objAdminBAL       = new clsAdminBAL(strToolConnString, strToolConnType);
        var isSourceValidated = objAdminBAL.ValidateDataSource(allSelectedSourceIds);
        var json = JsonConvert.SerializeObject(new { isSourceValidated = isSourceValidated });

        return(json);
    }
Exemple #4
0
    public static string ValidateCustomerName(string customerName)
    {
        var objAdminBAL = new clsAdminBAL(strToolConnString, strToolConnType);
        var isValidated = objAdminBAL.ValidateCustomerName(customerName);
        var json        = JsonConvert.SerializeObject(new { isValidated = isValidated });

        return(json);
    }
Exemple #5
0
    public static string ChangeCustomerStatus(int customerId, bool status)
    {
        var  objAdminBAL     = new clsAdminBAL(strToolConnString, strToolConnType);
        bool isStatusChanged = objAdminBAL.ChangeCustomerStatus(customerId, status);
        var  json            = JsonConvert.SerializeObject(new { isStatusChanged = isStatusChanged });

        return(json);
    }
Exemple #6
0
    public static string GetDomains(int sourceId)
    {
        var objAdminBAL = new clsAdminBAL(strToolConnString, strToolConnType);
        var domains     = objAdminBAL.GetDomains(sourceId);
        var json        = JsonConvert.SerializeObject(new { domains = domains });

        return(json);
    }
Exemple #7
0
    public static string GetFilterSchema(int envDetailAutoId)
    {
        var          objAdminBAL = new clsAdminBAL(strToolConnString, strToolConnType);
        FilterSchema schema      = objAdminBAL.GetFilterSchema(envDetailAutoId);

        FillOperatorsClausesInSchema(schema);
        var json = JsonConvert.SerializeObject(schema);

        return(json);
    }
Exemple #8
0
    public static bool SaveCustomerSource(int customerId, string json)
    {
        clsMyDBCommonAttrEntity objMyDBCommonEntity = new clsMyDBCommonAttrEntity();

        clsSecurityFunction.GetUserSession(ref objMyDBCommonEntity);
        CustomerEntity customerEntity = JsonConvert.DeserializeObject <CustomerEntity>(json);
        var            objAdminBAL    = new clsAdminBAL(strToolConnString, strToolConnType);
        bool           isSaved        = objAdminBAL.SaveCustomerSource(customerId, customerEntity, objMyDBCommonEntity);

        return(isSaved);
    }
Exemple #9
0
    public static string GetAllCustomers()
    {
        clsMyDBCommonAttrEntity objMyDBCommonEntity = new clsMyDBCommonAttrEntity();

        clsSecurityFunction.GetUserSession(ref objMyDBCommonEntity);
        var objAdminBAL          = new clsAdminBAL(strToolConnString, strToolConnType);
        var isAddCustomerVisible = objMyDBCommonEntity.LoggedInUserRoleId == "4" ? true : false;
        var json = JsonConvert.SerializeObject(new { isAddCustomerVisible = isAddCustomerVisible, allCustomers = objAdminBAL.GetAllCustomers(objMyDBCommonEntity) });

        return(json);
    }
Exemple #10
0
    public static string CanCustomerDeleted(int customerId)
    {
        var  message            = string.Empty;
        var  objAdminBAL        = new clsAdminBAL(strToolConnString, strToolConnType);
        bool canCustomerDeleted = objAdminBAL.CanCustomerDeleted(customerId);

        if (!canCustomerDeleted)
        {
            message = "Customer cannot be deleted as its associated with user(s).";
        }
        var json = JsonConvert.SerializeObject(new { canCustomerDeleted = canCustomerDeleted, message = message });

        return(json);
    }