public static string ValidateLogin(string email, string password, string path)
 {
     DataSet ds = new DataSet(); string custId = string.Empty;
     PredictCustomerDbo algorithmDBO = new PredictCustomerDbo();
     ds = algorithmDBO.GetData(path);
     if (ds != null && ds.Tables.Count > 0)
     {
         DataRow[] row = ds.Tables[1].Select("CustEmail='" + email + "' and Cust_Password='******'");
         if (row != null && row.Length > 0)
             custId = row[0]["CustId"].ToString();
     }
     return custId;
 }
        public bool Processdataforcustomer(string custid,string path)
        {
            DataSet ds = new DataSet();
            PredictCustomerDbo algorithmDBO = new PredictCustomerDbo();
            ds = algorithmDBO.GetData(path);
            if (ds != null && ds.Tables.Count > 0)
            {

                custProfile = new List<CustProfile>();
                foreach (DataRow dr in ds.Tables[2].Select("Cust_Id='" + custid + "'"))
                {

                    CustProfile c = new CustProfile();
                    AssignDataRow(dr, c);
                    custProfile.Add(c);
                }
                customerInfo = new List<CustomerInfo>();
                foreach (DataRow dr in ds.Tables[3].Select("Cust_Id='" + custid + "'"))
                {

                    CustomerInfo c1 = new CustomerInfo();
                    AssignDataRow(dr, c1);
                    customerInfo.Add(c1);
                }
                usageDetail = new List<UsageDetail>();
                foreach (DataRow dr in ds.Tables[5].Select("Cust_Id='" + custid + "'"))
                {

                    UsageDetail c2 = new UsageDetail();
                    AssignDataRow(dr, c2);
                    usageDetail.Add(c2);
                }

                if (productDetails == null || productDetails.Count == 0)
                {
                    productDetails = new List<Product>();
                    foreach (DataRow dr in ds.Tables[4].Rows)
                    {
                        Product p = new Product();
                        AssignDataRow(dr, p);
                        productDetails.Add(p);
                    }
                }

                if (bundleDetails == null || bundleDetails.Count == 0)
                {
                    bundleDetails = new List<BundleProduct>();

                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        BundleProduct p = new BundleProduct();
                        AssignDataRow(dr, p);
                        bundleDetails.Add(p);
                    }
                }

                existingCustomerProducts = new List<Product>();
                foreach (var item in custProfile)
                {
                    var prod = getProductsByID(Convert.ToInt32(item.Product_Id));
                    if (prod != null)
                        existingCustomerProducts.Add(prod);
                }

                bundleComps = new List<string>();
                bundleComps = (from prod in existingCustomerProducts
                           where prod.Category != "BUNDLE"
                           select prod.Category).Distinct().ToList();
            }

            return true;
        }