public static List <ClassFields> Warnings(double DID)
    {
        List <ClassFields> list = new List <ClassFields>();

        using (SqlConnection conn = ClassConnection.ConnectToServer())
        {
            string sql = "SELECT     tbl_Drugs.DrugName, tbl_Drugs.GenericName, tbl_Drugs.BrandName, tbl_Warnings.WarningsDescription   FROM         tbl_WaningsDrugs INNER JOIN tbl_Warnings ON tbl_WaningsDrugs.WarningID = tbl_Warnings.WarningsID INNER JOIN  tbl_Drugs ON tbl_WaningsDrugs.DrugID = tbl_Drugs.DrugID    WHERE tbl_WaningsDrugs.DrugID = '" + DID + "'";
            using (SqlCommand cmd = new SqlCommand(sql, conn))
            {
                cmd.CommandType = CommandType.Text;
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    if (dr.HasRows)
                    {
                        while (dr.Read())
                        {
                            ClassFields f = new ClassFields();
                            f.WarningsDescription = "•" + dr["WarningsDescription"].ToString();
                            list.Add(f);
                        }
                    }
                }
            }
        }
        return(list);
    }
 void SearchUserNameDuplicate()
 {
     try
     {
         SqlConnection conn        = ClassConnection.ConnectToServer();
         TextBox       txtusername = Article1.ContentPlaceholder.Controls[0].FindControl("txtusername") as TextBox;
         SqlCommand    command     = new SqlCommand("SELECT Cust_username FROM CUSTOMER WHERE Cust_username = '******'", conn);
         SqlDataReader dr          = command.ExecuteReader();
         if (dr.HasRows)
         {
             while (dr.Read())
             {
                 Panel PanelProceedmessage              = Article1.ContentPlaceholder.Controls[0].FindControl("PanelProceedmessage") as Panel;
                 Panel PanelErrormessage                = Article1.ContentPlaceholder.Controls[0].FindControl("PanelErrormessage") as Panel;
                 Panel PanelWelcomemessage              = Article1.ContentPlaceholder.Controls[0].FindControl("PanelWelcomemessage") as Panel;
                 Panel PanelCountryValidation           = Article1.ContentPlaceholder.Controls[0].FindControl("PanelCountryValidation") as Panel;
                 Panel PanelAgeValidation               = Article1.ContentPlaceholder.Controls[0].FindControl("PanelAgeValidation") as Panel;
                 Panel PanelUsernameDuplicateValidation = Article1.ContentPlaceholder.Controls[0].FindControl("PanelUsernameDuplicateValidation") as Panel;
                 PanelWelcomemessage.Visible              = false;
                 PanelProceedmessage.Visible              = false;
                 PanelErrormessage.Visible                = false;
                 PanelCountryValidation.Visible           = false;
                 PanelAgeValidation.Visible               = false;
                 PanelUsernameDuplicateValidation.Visible = true;
             }
         }
         else
         {
             Registration();
         }
     }
     catch (Exception)
     {
     }
 }
예제 #3
0
 void SearchUserNameDuplicate()
 {
     try
     {
         SqlConnection conn            = ClassConnection.ConnectToServer();
         TextBox       TxtCategoryName = Article2.ContentPlaceholder.Controls[0].FindControl("TxtCategoryName") as TextBox;
         SqlCommand    command         = new SqlCommand("SELECT CategoryName FROM CATEGORY WHERE CategoryName = '" + TxtCategoryName.Text + "'", conn);
         SqlDataReader dr = command.ExecuteReader();
         if (dr.HasRows)
         {
             while (dr.Read())
             {
                 Panel CategoryExistsPanel = Article2.ContentPlaceholder.Controls[0].FindControl("CategoryExistsPanel") as Panel;
                 CategoryExistsPanel.Visible = true;
                 Panel CategoryAdded = Article2.ContentPlaceholder.Controls[0].FindControl("CategoryAdded") as Panel;
                 CategoryAdded.Visible = false;
             }
         }
         else
         {
             Panel CategoryExistsPanel = Article2.ContentPlaceholder.Controls[0].FindControl("CategoryExistsPanel") as Panel;
             CategoryExistsPanel.Visible = false;
             CreateCategory();
             Panel CategoryAdded = Article2.ContentPlaceholder.Controls[0].FindControl("CategoryAdded") as Panel;
             CategoryAdded.Visible = true;
         }
     }
     catch (Exception)
     {
     }
 }
예제 #4
0
    public static List <ClassFields> LoadSymptoms(double IllnessID)
    {
        List <ClassFields> list = new List <ClassFields>();

        using (SqlConnection conn = ClassConnection.ConnectToServer())
        {
            string sql = "SELECT        tbl_Illness.IllnessName, tbl_Symptoms.Symptoms, tbl_Illness.IllnessID  FROM            tbl_Illness INNER JOIN tbl_IllnessSymptoms ON tbl_Illness.IllnessID = tbl_IllnessSymptoms.IllnessID INNER JOIN    tbl_Symptoms ON tbl_IllnessSymptoms.SymptomsID = tbl_Symptoms.SymptomsID WHERE tbl_Illness.IllnessID = '" + IllnessID + "'GROUP BY tbl_Illness.IllnessName, tbl_Symptoms.Symptoms, tbl_Illness.IllnessID";
            using (SqlCommand cmd = new SqlCommand(sql, conn))
            {
                cmd.CommandType = CommandType.Text;
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    if (dr.HasRows)
                    {
                        while (dr.Read())
                        {
                            ClassFields f = new ClassFields();
                            f.Symptoms = "-->>     " + dr["Symptoms"].ToString();
                            list.Add(f);
                        }
                    }
                    else
                    {
                        ClassFields f = new ClassFields();
                        f.Symptoms = "Unavailable";
                        list.Add(f);
                    }
                }
            }
        }
        return(list);
    }
예제 #5
0
    public void CreatePromo()
    {
        try
        {
            TextBox TxtPromoName = Article2.ContentPlaceholder.Controls[0].FindControl("TxtPromoName") as TextBox;
            TextBox TxtStartDate = Article2.ContentPlaceholder.Controls[0].FindControl("TxtStartDate") as TextBox;
            TextBox TxtEndDate   = Article2.ContentPlaceholder.Controls[0].FindControl("TxtEndDate") as TextBox;

            SqlConnection conn = ClassConnection.ConnectToServer();
            System.Data.SqlClient.SqlCommand insertCommand = new System.Data.SqlClient.SqlCommand("Insert into [PROMOTION] (Promotion_Description,Promotion_StartDate,Promotion_EndDate) Values (@Promotion_Description,@Promotion_StartDate,@Promotion_EndDate)", conn);
            insertCommand.Parameters.Add(new SqlParameter("@Promotion_Description", TxtPromoName.Text));
            insertCommand.Parameters.Add(new SqlParameter("@Promotion_StartDate", TxtStartDate.Text));
            insertCommand.Parameters.Add(new SqlParameter("@Promotion_EndDate", TxtEndDate.Text));
            int queryResult = insertCommand.ExecuteNonQuery();
            if (queryResult == 1)
            {
                TxtPromoName.Text = string.Empty;
                TxtEndDate.Text   = string.Empty;
                TxtStartDate.Text = string.Empty;
            }
        }
        catch (Exception)
        {
        }
    }
 void SearchProductsDuplicate()
 {
     try
     {
         SqlConnection conn    = ClassConnection.ConnectToServer();
         SqlCommand    command = new SqlCommand("SELECT * FROM OrderFacts_StoredDatas WHERE Product_Num_stored = '" + double.Parse(Label5.Text) + "'AND Cust_Num = '" + double.Parse(Label6.Text) + "'", conn);
         SqlDataReader dr      = command.ExecuteReader();
         if (dr.HasRows)
         {
             while (dr.Read())
             {
                 Response.Redirect("Select-Products-Transactions-CkecksOut-Shopping-Cart-Orders.aspx");
             }
         }
         else
         {
             CreateCarts();
         }
     }
     catch (Exception)
     {
         throw;
         //Response.Redirect("Default.aspx");
     }
 }
예제 #7
0
    void PopulateAllCollectionsCategoryID()
    {
        Label lblcollection = Article2.ContentPlaceholder.Controls[0].FindControl("lblcollection") as Label;

        try
        {
            SqlConnection conn           = ClassConnection.ConnectToServer();
            DropDownList  DrpCollections = Article2.ContentPlaceholder.Controls[0].FindControl("DrpCollections") as DropDownList;
            SqlCommand    command        = new SqlCommand("SELECT * FROM COLLECTIONCATEGORY WHERE CollectionDescription = '" + DrpCollections.Text + "'", conn);
            SqlDataReader dr             = command.ExecuteReader();
            if (dr.HasRows)
            {
                lblcollection.Text = string.Empty;
                while (dr.Read())
                {
                    lblcollection.Text = dr[0].ToString();
                }
            }
            else
            {
                lblcollection.Text = string.Empty;
            }
        }
        catch (Exception)
        {
        }
    }
    public static List <ClassFields> view_Expenses_Categorized_bydate(double userIDxExpense, string startdate, string enddate)
    {
        List <ClassFields> list = new List <ClassFields>();

        using (SqlConnection conn = ClassConnection.ConnectToServer())
        {
            string sql = "SELECT        TOP (100) PERCENT tbl_RecordsSpent.amountspent, tbl_RecordsSpent.dateRecorded, tbl_RecordsSpent.usersexpensesID, tbl_expenses_users.expensesID   FROM            tbl_RecordsSpent INNER JOIN   tbl_expenses_users ON tbl_RecordsSpent.usersexpensesID = tbl_expenses_users.usersexpensesID  WHERE  tbl_RecordsSpent.dateRecorded BETWEEN '" + startdate + "'AND'" + enddate + "'AND tbl_expenses_users.expensesID = '" + userIDxExpense + "'ORDER BY tbl_RecordsSpent.dateRecorded DESC";
            using (SqlCommand cmd = new SqlCommand(sql, conn))
            {
                cmd.CommandType = CommandType.Text;
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    if (dr.HasRows)
                    {
                        while (dr.Read())
                        {
                            ClassFields f = new ClassFields();
                            string      v = string.Format("{0:N2}", dr["amountspent"].ToString());
                            f.amountspent  = "P  " + v.ToString();
                            f.dateRecorded = dr["dateRecorded"].ToString();
                            list.Add(f);
                        }
                    }
                    else
                    {
                        ClassFields f = new ClassFields();
                        f.amountspent  = "0";
                        f.dateRecorded = "no Record/s Yet";
                        list.Add(f);
                    }
                }
            }
        }
        return(list);
    }
예제 #9
0
    public static List <ClassFields> LoadMedicinesSearchings(double IllnessID, string likename)
    {
        List <ClassFields> list = new List <ClassFields>();

        using (SqlConnection conn = ClassConnection.ConnectToServer())
        {
            string sql = "SELECT     TOP (100) PERCENT tbl_Drugs.DrugID, tbl_Drugs.DrugName, tbl_Drugs.GenericName, tbl_Drugs.BrandName  FROM         tbl_Drugs INNER JOIN  tbl_DrugIllness ON tbl_Drugs.DrugID = tbl_DrugIllness.DrugID INNER JOIN  tbl_Illness ON tbl_DrugIllness.IllnessID = tbl_Illness.IllnessID   WHERE tbl_DrugIllness.IllnessID =  '" + IllnessID + "'AND tbl_Drugs.DrugName LIKE '" + likename + "%'ORDER BY tbl_Drugs.DrugName";
            using (SqlCommand cmd = new SqlCommand(sql, conn))
            {
                cmd.CommandType = CommandType.Text;
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    if (dr.HasRows)
                    {
                        while (dr.Read())
                        {
                            ClassFields f = new ClassFields();
                            f.DrugID      = long.Parse(dr["DrugID"].ToString());
                            f.DrugName    = dr["DrugName"].ToString();
                            f.GenericName = dr["GenericName"].ToString();
                            f.BrandName   = dr["BrandName"].ToString();
                            list.Add(f);
                        }
                    }
                    else
                    {
                    }
                }
            }
        }
        return(list);
    }
예제 #10
0
 void DeleteRecords_Cart(double orderFacts_Num)
 {
     try
     {
         SqlConnection conn = ClassConnection.ConnectToServer();
         System.Data.SqlClient.SqlCommand DeleteCommand = new System.Data.SqlClient.SqlCommand("DELETE FROM OrderFacts_StoredDatas WHERE orderFacts_Num = '" + orderFacts_Num + "'", conn);
         int queryResult = DeleteCommand.ExecuteNonQuery();
         if (queryResult == 1)
         {
             double f = 0;
             try
             {
                 for (int i = 0; i < GridImageRetrieve.Rows.Count; i++)
                 {
                     f             = double.Parse(f.ToString()) + Convert.ToDouble(GridImageRetrieve.Rows[i].Cells[7].Text.ToString());
                     lbltotal.Text = f.ToString();
                 }
             }
             catch (Exception)
             {
                 //throw;
             }
             Response.Redirect("Select-Products-Transactions-CkecksOut-Shopping-Cart-Orders.aspx");
         }
     }
     catch (Exception)
     {
         //throw;
     }
 }
예제 #11
0
 void PopulateAllCollectionsCategory()
 {
     try
     {
         SqlConnection conn           = ClassConnection.ConnectToServer();
         DropDownList  DrpCollections = Article2.ContentPlaceholder.Controls[0].FindControl("DrpCollections") as DropDownList;
         SqlCommand    command        = new SqlCommand("SELECT * FROM COLLECTIONCATEGORY ORDER BY CollectionDescription", conn);
         SqlDataReader dr             = command.ExecuteReader();
         if (dr.HasRows)
         {
             DrpCollections.Items.Clear();
             while (dr.Read())
             {
                 DrpCollections.Items.Add(dr["CollectionDescription"].ToString());
             }
         }
         else
         {
             DrpCollections.Items.Clear();
         }
     }
     catch (Exception)
     {
     }
 }
예제 #12
0
 void PopulateAllGenderType()
 {
     try
     {
         SqlConnection conn      = ClassConnection.ConnectToServer();
         DropDownList  DrpGender = Article2.ContentPlaceholder.Controls[0].FindControl("DrpGender") as DropDownList;
         SqlCommand    command   = new SqlCommand("SELECT * FROM GENDERCATEGORY ORDER BY GenderType", conn);
         SqlDataReader dr        = command.ExecuteReader();
         if (dr.HasRows)
         {
             DrpGender.Items.Clear();
             while (dr.Read())
             {
                 DrpGender.Items.Add(dr["GenderType"].ToString());
             }
         }
         else
         {
             DrpGender.Items.Clear();
         }
     }
     catch (Exception)
     {
     }
 }
예제 #13
0
    public static List <ClassFields> AllDrugz()
    {
        List <ClassFields> list = new List <ClassFields>();

        using (SqlConnection conn = ClassConnection.ConnectToServer())
        {
            string sql = "SELECT  * FROM tbl_Drugs ORDER BY DrugName";
            using (SqlCommand cmd = new SqlCommand(sql, conn))
            {
                cmd.CommandType = CommandType.Text;
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    if (dr.HasRows)
                    {
                        while (dr.Read())
                        {
                            ClassFields f = new ClassFields();
                            f.DrugID      = long.Parse(dr["DrugID"].ToString());
                            f.DrugName    = dr["DrugName"].ToString();
                            f.GenericName = dr["GenericName"].ToString();
                            f.BrandName   = dr["BrandName"].ToString();
                            list.Add(f);
                        }
                    }
                    else
                    {
                    }
                }
            }
        }
        return(list);
    }
예제 #14
0
    public static List <ClassFields> Illness_LoadSearching(string ill)
    {
        List <ClassFields> list = new List <ClassFields>();

        using (SqlConnection conn = ClassConnection.ConnectToServer())
        {
            string sql = "SELECT IllnessID,IllnessName FROM tbl_Illness WHERE IllnessName LIKE '" + ill + "%'ORDER BY IllnessName";
            using (SqlCommand cmd = new SqlCommand(sql, conn))
            {
                cmd.CommandType = CommandType.Text;
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    if (dr.HasRows)
                    {
                        while (dr.Read())
                        {
                            ClassFields f = new ClassFields();
                            f.IllnessID   = long.Parse(dr["IllnessID"].ToString());
                            f.IllnessName = dr["IllnessName"].ToString();
                            list.Add(f);
                        }
                    }
                }
            }
        }
        return(list);
    }
예제 #15
0
    public static List <ClassFields> LoadTreatments(double IllnessID)
    {
        List <ClassFields> list = new List <ClassFields>();

        using (SqlConnection conn = ClassConnection.ConnectToServer())
        {
            string sql = "SELECT * FROM tbl_Treatment WHERE IllnessID = '" + IllnessID + "'";
            using (SqlCommand cmd = new SqlCommand(sql, conn))
            {
                cmd.CommandType = CommandType.Text;
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    if (dr.HasRows)
                    {
                        while (dr.Read())
                        {
                            ClassFields f = new ClassFields();
                            f.TreatmentDescription = "-->>     " + dr["TreatmentDescription"].ToString();
                            list.Add(f);
                        }
                    }
                    else
                    {
                        ClassFields f = new ClassFields();
                        f.TreatmentDescription = "Unavailable";
                        list.Add(f);
                    }
                }
            }
        }
        return(list);
    }
예제 #16
0
    public static List <ClassFields> FormsAvailable(double DrugIDs)
    {
        List <ClassFields> list = new List <ClassFields>();

        using (SqlConnection conn = ClassConnection.ConnectToServer())
        {
            string sql = "SELECT     tbl_Drugs.DrugName, tbl_AvailableForms.AvailableForms   FROM         tbl_AvailableForms INNER JOIN    tbl_AvailableFormsDrugs ON tbl_AvailableForms.FormsID = tbl_AvailableFormsDrugs.FormsID INNER JOIN      tbl_Drugs ON tbl_AvailableFormsDrugs.DrugID = tbl_Drugs.DrugID    WHERE tbl_AvailableFormsDrugs.DrugID = '" + DrugIDs + "'";
            using (SqlCommand cmd = new SqlCommand(sql, conn))
            {
                cmd.CommandType = CommandType.Text;
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    if (dr.HasRows)
                    {
                        while (dr.Read())
                        {
                            ClassFields f = new ClassFields();
                            f.AvailableForms = dr["AvailableForms"].ToString();
                            list.Add(f);
                        }
                    }
                    else
                    {
                        ClassFields f = new ClassFields();
                        f.AvailableForms = "On progress";
                        list.Add(f);
                    }
                }
            }
        }
        return(list);
    }
예제 #17
0
    public static List <ClassFields> LoadDrugClass(double DrugIDs)
    {
        List <ClassFields> list = new List <ClassFields>();

        using (SqlConnection conn = ClassConnection.ConnectToServer())
        {
            string sql = "SELECT     tbl_DrugClass.drugClass  FROM         tbl_Drugs INNER JOIN  tbl_MedicineDrugClass ON tbl_Drugs.DrugID = tbl_MedicineDrugClass.DrugID INNER JOIN    tbl_DrugClass ON tbl_MedicineDrugClass.DrugclassID = tbl_DrugClass.DrugclassID WHERE tbl_Drugs.DrugID = '" + DrugIDs + "'";
            using (SqlCommand cmd = new SqlCommand(sql, conn))
            {
                cmd.CommandType = CommandType.Text;
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    if (dr.HasRows)
                    {
                        while (dr.Read())
                        {
                            ClassFields f = new ClassFields();
                            f.drugClass = ">>" + dr["drugClass"].ToString();
                            list.Add(f);
                        }
                    }
                    else
                    {
                        ClassFields f = new ClassFields();
                        f.drugClass = "--";
                        list.Add(f);
                    }
                }
            }
        }
        return(list);
    }
    public void CreateCarts()
    {
        try
        {
            double        idx  = 1;
            SqlConnection conn = ClassConnection.ConnectToServer();
            System.Data.SqlClient.SqlCommand insertCommand = new System.Data.SqlClient.SqlCommand("Insert into [OrderFacts_StoredDatas] (Product_Num_stored,Product_Name_stored,Product_Description_stored,Product_Price_stored,Product_Status_stored,Cust_Num,ProductItemsStored,ProductAmountStored) Values (@Product_Num_stored,@Product_Name_stored,@Product_Description_stored,@Product_Price_stored,@Product_Status_stored,@Cust_Num,@ProductItemsStored,@ProductAmountStored)", conn);
            insertCommand.Parameters.Add(new SqlParameter("@Product_Num_stored", double.Parse(Label5.Text)));// @Product_Price_stored,@Product_Status_stored,@Cust_Num
            insertCommand.Parameters.Add(new SqlParameter("@Product_Name_stored", Label1.Text));
            insertCommand.Parameters.Add(new SqlParameter("@Product_Description_stored", Label2.Text));
            insertCommand.Parameters.Add(new SqlParameter("@Product_Price_stored", double.Parse(Label7.Text)));
            insertCommand.Parameters.Add(new SqlParameter("@Product_Status_stored", Label4.Text));
            insertCommand.Parameters.Add(new SqlParameter("@Cust_Num", double.Parse(Label6.Text)));
            insertCommand.Parameters.Add(new SqlParameter("@ProductItemsStored", idx));
            insertCommand.Parameters.Add(new SqlParameter("@ProductAmountStored", double.Parse(Label7.Text)));

            int queryResult = insertCommand.ExecuteNonQuery();
            if (queryResult == 1)
            {
                Response.Redirect("Select-Products-Transactions-CkecksOut-Shopping-Cart-Orders.aspx");
            }
        }
        catch (Exception)
        {
            throw;
            //Response.Redirect("IndexLogin.aspx");
        }
    }
예제 #19
0
    public static List <ClassFields> LoadDosage(double DrugIDs)
    {
        List <ClassFields> list = new List <ClassFields>();

        using (SqlConnection conn = ClassConnection.ConnectToServer())
        {
            string sql = "SELECT     tbl_Drugs.DrugName, tbl_Dosage.Dosage, tbl_Dosage.DosageID, tbl_Drugs.DrugID  FROM         tbl_Dosage INNER JOIN  tbl_DosageDrugs ON tbl_Dosage.DosageID = tbl_DosageDrugs.DosageID INNER JOIN       tbl_Drugs ON tbl_DosageDrugs.DrugID = tbl_Drugs.DrugID WHERE tbl_DosageDrugs.DrugID = '" + DrugIDs + "'";
            using (SqlCommand cmd = new SqlCommand(sql, conn))
            {
                cmd.CommandType = CommandType.Text;
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    if (dr.HasRows)
                    {
                        while (dr.Read())
                        {
                            ClassFields f = new ClassFields();
                            f.Dosage = dr["Dosage"].ToString();
                            list.Add(f);
                        }
                    }
                    else
                    {
                    }
                }
            }
        }
        return(list);
    }
예제 #20
0
    void PopulateAllGenderTypeID()
    {
        Label lblgender = Article2.ContentPlaceholder.Controls[0].FindControl("lblgender") as Label;

        try
        {
            SqlConnection conn      = ClassConnection.ConnectToServer();
            DropDownList  DrpGender = Article2.ContentPlaceholder.Controls[0].FindControl("DrpGender") as DropDownList;
            SqlCommand    command   = new SqlCommand("SELECT * FROM GENDERCATEGORY WHERE GenderType = '" + DrpGender.Text + "'", conn);
            SqlDataReader dr        = command.ExecuteReader();
            if (dr.HasRows)
            {
                lblgender.Text = string.Empty;
                while (dr.Read())
                {
                    lblgender.Text = dr[0].ToString();
                }
            }
            else
            {
                lblgender.Text = string.Empty;
            }
        }
        catch (Exception)
        {
        }
    }
    public static List <ClassFields> AllDrugClassesSearch(string dc)
    {
        List <ClassFields> list = new List <ClassFields>();

        using (SqlConnection conn = ClassConnection.ConnectToServer())
        {
            string sql = "SELECT  * FROM tbl_DrugClass WHERE drugClass LIKE '" + dc + "%'ORDER BY drugClass";
            using (SqlCommand cmd = new SqlCommand(sql, conn))
            {
                cmd.CommandType = CommandType.Text;
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    if (dr.HasRows)
                    {
                        while (dr.Read())
                        {
                            ClassFields f = new ClassFields();
                            f.DrugclassID = long.Parse(dr["DrugclassID"].ToString());
                            f.drugClass   = dr["drugClass"].ToString();
                            list.Add(f);
                        }
                    }
                    else
                    {
                        ClassFields f = new ClassFields();
                        f.DrugclassID = 0;
                        f.drugClass   = "0 Result";
                        list.Add(f);
                    }
                }
            }
        }
        return(list);
    }
    public static List <ClassFields> CatgoryLoad()
    {
        List <ClassFields> list = new List <ClassFields>();

        using (SqlConnection conn = ClassConnection.ConnectToServer())
        {
            string sql = "SELECT * FROM CATEGORY ORDER BY CategoryName";
            using (SqlCommand cmd = new SqlCommand(sql, conn))
            {
                cmd.CommandType = CommandType.Text;
                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    if (dr.HasRows)
                    {
                        while (dr.Read())
                        {
                            ClassFields fields = new ClassFields();
                            fields.Category_Num = long.Parse(dr["Category_Num"].ToString());
                            fields.CategoryName = "[   " + dr["CategoryName"].ToString() + "   ]";
                            list.Add(fields);
                        }
                    }
                }
            }
        }
        return(list);
    }
예제 #23
0
 void SearchCarting(double orderFacts_Num)
 {
     try
     {
         SqlConnection conn    = ClassConnection.ConnectToServer();
         SqlCommand    command = new SqlCommand("SELECT * FROM OrderFacts_StoredDatas WHERE orderFacts_Num = '" + orderFacts_Num + "'", conn);
         SqlDataReader dr      = command.ExecuteReader();
         if (dr.HasRows)
         {
             PanelEdit.Visible = false;
             while (dr.Read())
             {
                 PanelEdit.Visible       = true;
                 txtorderCartId.Text     = dr[0].ToString();
                 LblProductNameEdit.Text = dr[2].ToString();
                 TxtPrice.Text           = dr[4].ToString();
                 txtQuantityEdit.Text    = dr[7].ToString();
             }
         }
         else
         {
             PanelEdit.Visible = false;
         }
     }
     catch (Exception)
     {
         throw;
         //Response.Redirect("Default.aspx");
     }
 }
예제 #24
0
    public void CreateProducts()
    {
        try
        {
            TextBox              txtproduct     = Article2.ContentPlaceholder.Controls[0].FindControl("txtproduct") as TextBox;
            TextBox              txtdescription = Article2.ContentPlaceholder.Controls[0].FindControl("txtdescription") as TextBox;
            TextBox              txtprice       = Article2.ContentPlaceholder.Controls[0].FindControl("txtprice") as TextBox;
            TextBox              txtstatus      = Article2.ContentPlaceholder.Controls[0].FindControl("txtstatus") as TextBox;
            TextBox              txtimagename   = Article2.ContentPlaceholder.Controls[0].FindControl("txtimagename") as TextBox;
            FileUpload           ImageUpload    = Article2.ContentPlaceholder.Controls[0].FindControl("ImageUpload") as FileUpload;
            System.Drawing.Image imag           = System.Drawing.Image.FromStream(ImageUpload.PostedFile.InputStream);
            Label lblcat        = Article2.ContentPlaceholder.Controls[0].FindControl("lblcat") as Label;
            Label lblgender     = Article2.ContentPlaceholder.Controls[0].FindControl("lblgender") as Label;
            Label lblcollection = Article2.ContentPlaceholder.Controls[0].FindControl("lblcollection") as Label;

            SqlConnection conn = ClassConnection.ConnectToServer();
            getImageFilename(); // image filename additional.
            System.Data.SqlClient.SqlCommand insertCommand = new System.Data.SqlClient.SqlCommand("Insert into [PRODUCT] (Category_Num,GenderCategory_Num,Collection_Num,Product_Name,Product_UpdatedDescription,Product_UpdatedPrice,Product_Status,Product_Image,ImageName) Values (@Category_Num,@GenderCategory_Num,@Collection_Num,@Product_Name,@Product_UpdatedDescription,@Product_UpdatedPrice,@Product_Status,@Product_Image,@ImageName)", conn);
            insertCommand.Parameters.Add(new SqlParameter("@Category_Num", lblcat.Text));
            insertCommand.Parameters.Add(new SqlParameter("@GenderCategory_Num", lblgender.Text));
            insertCommand.Parameters.Add(new SqlParameter("@Collection_Num", lblcollection.Text));
            insertCommand.Parameters.Add(new SqlParameter("@Product_Name", txtproduct.Text));
            insertCommand.Parameters.Add(new SqlParameter("@Product_UpdatedDescription", txtdescription.Text));
            insertCommand.Parameters.Add(new SqlParameter("@Product_UpdatedPrice", double.Parse(txtprice.Text)));
            insertCommand.Parameters.Add(new SqlParameter("@Product_Status", txtstatus.Text));
            insertCommand.Parameters.Add("Product_Image", SqlDbType.Image, 0).Value = ConvertImageToByteArray(imag, System.Drawing.Imaging.ImageFormat.Jpeg);
            insertCommand.Parameters.Add(new SqlParameter("@ImageName", txtimagename.Text));
            int queryResult = insertCommand.ExecuteNonQuery();
            if (queryResult == 1)
            {
                Panel CategoryExistsPanel = Article2.ContentPlaceholder.Controls[0].FindControl("CategoryExistsPanel") as Panel;
                Panel CategoryAdded       = Article2.ContentPlaceholder.Controls[0].FindControl("CategoryAdded") as Panel;

                CategoryExistsPanel.Visible = false;
                CategoryAdded.Visible       = true;
                StartUpLoad();
                txtdescription.Text = string.Empty;
                //txtprice.Text = null;
                txtproduct.Text = string.Empty;
                //txtstatus.Text = string.Empty;
                lblcat.Text        = null;
                lblcollection.Text = null;
                lblgender.Text     = null;
                txtimagename.Text  = null;
            }
        }
        catch (Exception)
        {
            throw;
        }
    }
예제 #25
0
 void DeleteCustomerOrderFacts()
 {
     try
     {
         SqlConnection conn = ClassConnection.ConnectToServer();
         System.Data.SqlClient.SqlCommand DeleteCommand = new System.Data.SqlClient.SqlCommand("DELETE FROM OrderFacts_StoredDatas WHERE  Cust_Num = '" + double.Parse(Txtcustomer.Text) + "'", conn);
         int queryResult = DeleteCommand.ExecuteNonQuery();
         if (queryResult == 1)
         {
         }
     }
     catch (Exception)
     {
         //throw;
     }
 }
예제 #26
0
 void UpdateCustomerBalance()
 {
     try
     {
         // double loadedid = double.Parse(iid.ToString());
         SqlConnection conn = ClassConnection.ConnectToServer();
         System.Data.SqlClient.SqlCommand insertCommand = new System.Data.SqlClient.SqlCommand("UPDATE CUSTOMER SET Cust_General_Balance ='" + double.Parse(txtcustomerbalanceGeneralFinal.Text) + "'WHERE Cust_Num = '" + double.Parse(Txtcustomer.Text) + "'", conn);
         int queryResult = insertCommand.ExecuteNonQuery();
         if (queryResult == 1)
         {
         }
     }
     catch (Exception)
     {
     }
 }
    protected void Button1_Click(object sender, EventArgs e)
    {
        TextBox       TextBox1 = Article1.ContentPlaceholder.Controls[0].FindControl("txtname") as TextBox;
        TextBox       TextBox2 = Article1.ContentPlaceholder.Controls[0].FindControl("txtcompany") as TextBox;
        TextBox       TextBox3 = Article1.ContentPlaceholder.Controls[0].FindControl("txtaddress") as TextBox;
        TextBox       TextBox4 = Article1.ContentPlaceholder.Controls[0].FindControl("txtmobilenumber") as TextBox;
        TextBox       TextBox5 = Article1.ContentPlaceholder.Controls[0].FindControl("txtemailadd") as TextBox;
        TextBox       TextBox6 = Article1.ContentPlaceholder.Controls[0].FindControl("txtmessage") as TextBox;
        SqlConnection conn     = ClassConnection.ConnectToServer();

        System.Data.SqlClient.SqlCommand insertCommand = new System.Data.SqlClient.SqlCommand("Insert into [CONTACT] (inq_num,name,company,address,mobileNumer,emailAddress,message) Values (@inq_num,@name,@company,@address,@mobileNumber,@emailAddress,@message)", conn);
        insertCommand.Parameters.Add(new SqlParameter("@name", TextBox1.Text));
        insertCommand.Parameters.Add(new SqlParameter("@company", TextBox1.Text));
        insertCommand.Parameters.Add(new SqlParameter("@address", TextBox1.Text));
        insertCommand.Parameters.Add(new SqlParameter("@mobileNumber", TextBox1.Text));
        insertCommand.Parameters.Add(new SqlParameter("@emailAddress", TextBox1.Text));
        insertCommand.Parameters.Add(new SqlParameter("@emailAddress", TextBox1.Text));
    }
예제 #28
0
 void UpdateCart()
 {
     try
     {
         // double loadedid = double.Parse(iid.ToString());
         SqlConnection conn = ClassConnection.ConnectToServer();
         System.Data.SqlClient.SqlCommand insertCommand = new System.Data.SqlClient.SqlCommand("UPDATE OrderFacts_StoredDatas SET ProductItemsStored ='" + txtQuantityEdit.Text + "', ProductAmountStored = '" + txttotal.Text + "'WHERE orderFacts_Num = '" + txtorderCartId.Text + "'", conn);
         int queryResult = insertCommand.ExecuteNonQuery();
         if (queryResult == 1)
         {
             PanelEdit.Visible = false;
             Response.Redirect("Select-Products-Transactions-CkecksOut-Shopping-Cart-Orders.aspx");
         }
     }
     catch (Exception)
     {
     }
 }
 void SearchUserNameDuplicate()
 {
     try
     {
         double prods     = 0;
         string productID = (string)(Session["ProductNum"]);
         prods = double.Parse(productID.ToString());
         SqlConnection conn = ClassConnection.ConnectToServer();
         //Label Label1 = Article1.ContentPlaceholder.Controls[0].FindControl("Label1") as Label; //name
         //Label Label2 = Article1.ContentPlaceholder.Controls[0].FindControl("Label2") as Label;  //description
         //Label Label3 = Article1.ContentPlaceholder.Controls[0].FindControl("Label3") as Label; //price
         //Label Label4 = Article1.ContentPlaceholder.Controls[0].FindControl("Label4") as Label; //status
         SqlCommand    command = new SqlCommand("SELECT * FROM PRODUCT WHERE Product_Num = '" + double.Parse(prods.ToString()) + "'", conn);
         SqlDataReader dr      = command.ExecuteReader();
         if (dr.HasRows)
         {
             Label1.Text = "[Product Name]";
             Label2.Text = "[Description]";
             Label3.Text = "[Price]";
             Label4.Text = "[Status]";
             while (dr.Read())
             {
                 Label1.Text = "[ " + dr[4].ToString() + " ]";
                 Label2.Text = "[ " + dr[5].ToString() + " ]";
                 Label3.Text = "[ " + dr[6].ToString() + " ]";
                 Label4.Text = "[ " + dr[7].ToString() + " ]";
                 Label5.Text = dr[0].ToString();
                 Label6.Text = (string)(Session["clientID"]);
                 Label7.Text = dr[6].ToString();
             }
         }
         else
         {
             Label1.Text = "[Product Name]";
             Label2.Text = "[Description]";
             Label3.Text = "[Price]";
             Label4.Text = "[Status]";
         }
     }
     catch (Exception)
     {
         Response.Redirect("Default.aspx");
     }
 }
예제 #30
0
    public void CreateCategory()
    {
        try
        {
            TextBox TxtCategoryName = Article2.ContentPlaceholder.Controls[0].FindControl("TxtCategoryName") as TextBox;

            SqlConnection conn = ClassConnection.ConnectToServer();
            System.Data.SqlClient.SqlCommand insertCommand = new System.Data.SqlClient.SqlCommand("Insert into [CATEGORY] (CategoryName) Values (@CategoryName)", conn);
            insertCommand.Parameters.Add(new SqlParameter("@CategoryName", TxtCategoryName.Text));
            int queryResult = insertCommand.ExecuteNonQuery();
            if (queryResult == 1)
            {
                TxtCategoryName.Text = string.Empty;
            }
        }
        catch (Exception)
        {
        }
    }