コード例 #1
0
ファイル: menu_add.aspx.cs プロジェクト: pramodgupta/Eathub
    protected void Page_Load(object sender, EventArgs e)
    {
        restaurantmenus.restaurant_menus r1 = new restaurantmenus.restaurant_menus();
        string emailid = Session["main_res"].ToString();

        ArrayList a = new ArrayList(r1.category_retrieve(emailid));
        ArrayList b = new ArrayList();
        b.Clear();
        b = (ArrayList)a;

        foreach (string c in b)
        {
            string[] row = c.Split('^');
            // Adds the category name dropdown
            ListItem f = new ListItem();
            f.Value = row[0];
            f.Text = row[0];
            category.Items.Add(f);
           // Adds the category type dropdown
            ListItem g = new ListItem();
            g.Value = row[1];
            g.Text = row[1];
            cattype.Items.Add(g);

        }
    }
コード例 #2
0
ファイル: menu_edit.aspx.cs プロジェクト: pramodgupta/Eathub
    protected void update_Click(object sender, EventArgs e)
    {
        restaurantmenus.restaurant_menus r1 = new restaurantmenus.restaurant_menus();

        int x = Convert.ToInt32(Request.QueryString["id"]);
        string img = "";
        int y = r1.menu_update_update(x,name.Text,price.Text,category.Text,cattype.Text,img,desc.Text);
        Response.Redirect("restaurant_menus.aspx");
    }
コード例 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string email = Request.QueryString["email"];
        string cat = Request.QueryString["cat"];
        restaurantmenus.restaurant_menus r1 = new restaurantmenus.restaurant_menus();

        goback.Text = "<a href='restaurant_single.aspx?email=" + email + "' class='green'> Go Back</a>";

        ArrayList a = new ArrayList(r1.menu_category_retrieve(email,cat));
        ArrayList b = new ArrayList();
        b = (ArrayList)a;

        string[,] data = new string[100, 7];
        int iterator = 0;
        foreach (string c in b)
        {
            string[] row = c.Split('^');
            data[iterator, 0] = row[0];
            data[iterator, 1] = row[1];
            data[iterator, 2] = row[2];
            data[iterator, 3] = row[3];
            data[iterator, 4] = row[4];
            data[iterator, 5] = row[5];
            data[iterator, 6] = row[6];
            iterator++;
        }

        DataTable newsDataTable = new DataTable();

        // add some columns to our datatable
        newsDataTable.Columns.Add("itemname");
        newsDataTable.Columns.Add("itemprice");
        newsDataTable.Columns.Add("itemcategory");
        newsDataTable.Columns.Add("itemtype");
        newsDataTable.Columns.Add("itempath");
        newsDataTable.Columns.Add("itemdesc");
        newsDataTable.Columns.Add("itemid");

        // adding new rows
        for (int i = 0; i < iterator; i++)
        {
            DataRow newsDataRow = newsDataTable.NewRow();
            newsDataRow["itemname"] = data[i, 0];
            newsDataRow["itemprice"] = data[i, 1];
            newsDataRow["itemcategory"] = data[i, 2];
            newsDataRow["itemtype"] = data[i, 3];
            newsDataRow["itempath"] = data[i, 4];
            newsDataRow["itemdesc"] = data[i, 5];
            newsDataRow["itemid"] = data[i, 6];

            newsDataTable.Rows.Add(newsDataRow);
        }

        // bind our datatable to our repeater
        menu1.DataSource = newsDataTable;
        menu1.DataBind();
    }
コード例 #4
0
    protected void add_Click(object sender, EventArgs e)
    {
        restaurantmenus.restaurant_menus r1 = new restaurantmenus.restaurant_menus();

        string catname = cat_name.Text;
        string cattype = cat_type.Text;
        string main_res =  Session["main_res"].ToString();
        string path = "C:\\Users\\pramod\\Desktop\\ase project\\FIRST INCREMENT\\eathub_webservice\\images\\" + main_res + "\\category\\";

        if (catimg.HasFile)
        {
            try
            {
                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);

                }

                catimg.SaveAs(path + catimg.FileName);
                path = "http://localhost:51966/eathub_webservice/images/" + main_res + "/category/" + catimg.FileName;

            }
            catch
            {
              //  Label1.Visible = true;
               // Label1.Text = "Unable to save file";

            }
        }

        int a = r1.category_add(main_res, catname, cattype, path);

        if (a == 1)
        {
            status.Visible = true;
            status.Text = "Category created successfully";

            cat_name.Text = null;
            cat_type.Text = null;

        }
        else {
            status.Visible = true;
            status.Text = "Error";
        }
    }
コード例 #5
0
ファイル: menu_add.aspx.cs プロジェクト: pramodgupta/Eathub
    protected void Button1_Click(object sender, EventArgs e)
    {
        string emailid = Session["main_res"].ToString();
        string path = "C:\\Users\\pramod\\Desktop\\ase project\\FIRST INCREMENT\\eathub_webservice\\images\\" + emailid + "\\";

        if (FileUpload1.HasFile)
        {
            try
            {
                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                    Label1.Text = "path created";

                }

                FileUpload1.SaveAs(path + FileUpload1.FileName);
                Label1.Visible = true;
                Label1.Text = "File uploaded";
                path = "http://localhost:51966/eathub_webservice/images/" + emailid + "/"+ FileUpload1.FileName;
                Label1.Text = path;

            }
            catch
            {
                Label1.Visible = true;
                Label1.Text = "Unable to save file";

            }
        }

        restaurantmenus.restaurant_menus r2 = new restaurantmenus.restaurant_menus();
        int status = r2.item_add(emailid, name.Text, price.Text, category.Text, cattype.Text, path, desc.Text);

           if (status == 1)
           {
           Label1.Visible = true;
          Label1.Text = "Item Added Successfully";

           }
           else
           {
           Label1.Text = "try again";
           }
    }
コード例 #6
0
ファイル: category.aspx.cs プロジェクト: pramodgupta/Eathub
    protected void Page_Load(object sender, EventArgs e)
    {
        restaurantmenus.restaurant_menus r1 = new restaurantmenus.restaurant_menus();
           string main_res = Session["main_res"].ToString();

        ArrayList a = new ArrayList(r1.category_retrieve(main_res));
        ArrayList b = new ArrayList();
        b = (ArrayList)a;

        string[,] data = new string[100,3];
        int iterator = 0;

        foreach (string c in b)
        {
            string[] row = c.Split('^');
            data[iterator,0] = row[0];
            data[iterator,1] = row[1];
            data[iterator, 2] = row[2];
            iterator++;
        }

        DataTable newsDataTable = new DataTable();

        // add some columns to our datatable
        newsDataTable.Columns.Add("categoryname");
        newsDataTable.Columns.Add("categorytype");
        newsDataTable.Columns.Add("categoryimg");

        // adding new rows
        for (int i = 0; i < iterator; i++)
        {
            DataRow newsDataRow = newsDataTable.NewRow();
            newsDataRow["categoryname"] = data[i,0];
            newsDataRow["categorytype"] = data[i,1];
            newsDataRow["categoryimg"] = data[i, 2];
            newsDataTable.Rows.Add(newsDataRow);
        }

        // bind our datatable to our repeater
        c11.DataSource = newsDataTable;
        c11.DataBind();
    }
コード例 #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        restaurantmenus.restaurant_menus r1 = new restaurantmenus.restaurant_menus();
        string main_res = "";
        if (Session["main_res"] == null)
        {
            Response.Redirect("login.aspx");
        }
        else
        {

            main_res = Session["main_res"].ToString();
        }

        ArrayList a = new ArrayList(r1.menu_retrieve(main_res));
        ArrayList b = new ArrayList();
        b = (ArrayList)a;

        string[,] data = new string[100, 7];
        int iterator = 0;

        foreach (string c in b)
        {
            string[] row = c.Split('^');
            data[iterator, 0] = row[0];
            data[iterator, 1] = row[1];
            data[iterator, 2] = row[2];
            data[iterator, 3] = row[3];
            data[iterator, 4] = row[4];
            data[iterator, 5] = row[5];
            data[iterator, 6] = row[6];
            iterator++;
        }

        DataTable newsDataTable = new DataTable();

        // add some columns to our datatable
        newsDataTable.Columns.Add("itemname");
        newsDataTable.Columns.Add("itemprice");
        newsDataTable.Columns.Add("itemcategory");
        newsDataTable.Columns.Add("itemtype");
        newsDataTable.Columns.Add("itempath");
        newsDataTable.Columns.Add("itemdesc");
        newsDataTable.Columns.Add("itemid");

        // adding new rows
        for (int i = 0; i < iterator; i++)
        {
            DataRow newsDataRow = newsDataTable.NewRow();
            newsDataRow["itemname"] = data[i, 0];
            newsDataRow["itemprice"] = data[i, 1];
            newsDataRow["itemcategory"] = data[i, 2];
            newsDataRow["itemtype"] = data[i, 3];
            newsDataRow["itempath"] = data[i, 4];
            newsDataRow["itemdesc"] = data[i, 5];
            newsDataRow["itemid"] = data[i, 6];

            newsDataTable.Rows.Add(newsDataRow);
        }

        // bind our datatable to our repeater
        menu.DataSource = newsDataTable;
        menu.DataBind();
    }
コード例 #8
0
ファイル: menu_edit.aspx.cs プロジェクト: pramodgupta/Eathub
    protected void Page_Load(object sender, EventArgs e)
    {
        string main_res = Session["main_res"].ToString();
        //string main_res = "[email protected]";
        restaurantmenus.restaurant_menus r = new restaurantmenus.restaurant_menus();

        ArrayList a1 = new ArrayList(r.category_retrieve(main_res));
        ArrayList b1 = new ArrayList();
        b1.Clear();
        b1= (ArrayList)a1;

        foreach (string c in b1)
        {
            string[] row = c.Split('^');
            // Adds the category name dropdown
            ListItem f = new ListItem();
            f.Value = row[0];
            f.Text = row[0];
            category.Items.Add(f);
            // Adds the category type dropdown
            ListItem g = new ListItem();
            g.Value = row[1];
            g.Text = row[1];
            cattype.Items.Add(g);

        }

        restaurantmenus.restaurant_menus r1 = new restaurantmenus.restaurant_menus();
        int id = Convert.ToInt32(Request.QueryString["id"]);
        if(id == null)
        {
          id = 0;
        }

        ArrayList a = new ArrayList(r1.menu_retrieve_update(main_res,id));
        ArrayList b = new ArrayList();
        b = (ArrayList)a;

        string[,] data = new string[100, 7];
        int iterator = 0;

        foreach (string c in b)
        {
            string[] row = c.Split('^');
            data[iterator, 0] = row[0];
            data[iterator, 1] = row[1];
            data[iterator, 2] = row[2];
            data[iterator, 3] = row[3];
            data[iterator, 4] = row[4];
            data[iterator, 5] = row[5];
            data[iterator, 6] = row[6];
            iterator++;
        }

        if (!IsPostBack)
        {
            name.Text = data[0,0];
            price.Text = data[0,1];
            category.Text = data[0,2];
            cattype.Text = data[0,3];
            desc.Text = data[0,5];
        }
    }
コード例 #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string category = Request.QueryString["cat"];

         if (category != null)
         {
             restaurantmenus.restaurant_menus r1 = new restaurantmenus.restaurant_menus();

             ArrayList a = new ArrayList(r1.res_category(category));
             ArrayList b = new ArrayList();
             b = (ArrayList)a;

             string[,] data = new string[100, 10];
             int iterator = 0;

             foreach (string c in b)
             {
                 string[] row = c.Split('^');
                 data[iterator, 0] = row[0];
                 data[iterator, 1] = row[1];
                 data[iterator, 2] = row[2];
                 data[iterator, 3] = row[3];
                 data[iterator, 4] = row[4];
                 data[iterator, 5] = row[5];
                 data[iterator, 6] = row[6];
                 data[iterator, 7] = row[7];
                 data[iterator, 8] = row[8];
                 data[iterator, 9] = row[9];

                 iterator++;
             }

             DataTable newsDataTable = new DataTable();

             // add some columns to our datatable
             newsDataTable.Columns.Add("restaurant_name");
             newsDataTable.Columns.Add("contact_no");
             newsDataTable.Columns.Add("street");
             newsDataTable.Columns.Add("city");
             newsDataTable.Columns.Add("zipcode");
             newsDataTable.Columns.Add("logopath");
             newsDataTable.Columns.Add("restaurant_category");
             newsDataTable.Columns.Add("minamount");
             newsDataTable.Columns.Add("deliverytimings");
             newsDataTable.Columns.Add("email");

             // adding new rows
             for (int i = 0; i < iterator; i++)
             {
                 DataRow newsDataRow = newsDataTable.NewRow();
                 newsDataRow["restaurant_name"] = data[i, 0];
                 newsDataRow["contact_no"] = data[i, 1];
                 newsDataRow["street"] = data[i, 2];
                 newsDataRow["city"] = data[i, 3];
                 newsDataRow["zipcode"] = data[i, 4];
                 newsDataRow["logopath"] = data[i, 5];
                 newsDataRow["restaurant_category"] = data[i, 6];
                 newsDataRow["minamount"] = data[i, 7];
                 newsDataRow["deliverytimings"] = data[i, 8];
                 newsDataRow["email"] = data[i, 9];
                 newsDataTable.Rows.Add(newsDataRow);
             }

             // bind our datatable to our repeater
             rescat.DataSource = newsDataTable;
             rescat.DataBind();

             if (iterator != 0)
             {
             }
             else
             {
                 dis.Text = "No Restaurants";
             }
         }
         else
         {
             dis.Visible = true;
             dis.Text = "No Restaurants";
         }
    }
コード例 #10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string param1 = "";
        param1 = Request.QueryString["email"];

        try
        {

            /*param1 = "[email protected]";*/

            loginwebservice.login l1 = new loginwebservice.login();
            string[] a = l1.restaurant_profile_retrieve(param1);

            string img = a[8];
            name.Text = a[0];
            contact.Text = a[2];
            street.Text = a[3];
            city.Text = a[4];
            zipcode.Text = a[5];
            minamount.Text = a[6];
            category1.Text = a[9];
            timings.Text = a[7];
            gimg.Text = "<a class='details' data-fancybox-type='iframe' href='google.aspx?address=" +street.Text + "," + city.Text + "," + zipcode.Text + "'><img src='images/google-map.png'></a>";

            restaurantmenus.restaurant_menus r = new restaurantmenus.restaurant_menus();
            ArrayList b = new ArrayList(r.category_retrieve(param1));
            ArrayList c = new ArrayList();
            c = (ArrayList)b;

            string[,] data = new string[100, 4];

            int iterator = 0;

            foreach (string d in c)
            {

                string[] row = d.Split('^');

                data[iterator, 0] = row[0];

                data[iterator, 1] = row[1];

                data[iterator, 2] = row[2];

                data[iterator, 3] = row[3];

                iterator++;

            }

            DataTable newsDataTable = new DataTable();

            // add some columns to our datatable

            newsDataTable.Columns.Add("cat_name");

            newsDataTable.Columns.Add("cat_type");

            newsDataTable.Columns.Add("cat_img");

            newsDataTable.Columns.Add("id");

            // adding new rows

            for (int i = 0; i < iterator; i++)
            {

                DataRow newsDataRow = newsDataTable.NewRow();

                newsDataRow["cat_name"] = data[i, 0];

                newsDataRow["cat_type"] = data[i, 1];

                newsDataRow["cat_img"] = data[i, 2];

                newsDataRow["id"] = data[i, 3];

                newsDataTable.Rows.Add(newsDataRow);

            }

            Label1.Text = "<a title='Send Mail to Restaurant' href='mailto:" + param1 + "'><img src ='images/email-to.png'></a>";

            // bind our datatable to our repeater

            category.DataSource = newsDataTable;

            category.DataBind();

          // string email = "[email protected]";

            commentsweb.comments r1 = new commentsweb.comments();
            ArrayList p = new ArrayList(r1.retrieve_comments(param1));
            ArrayList q = new ArrayList();
            q = (ArrayList)p;

            string[,] data1 = new string[100, 3];

            int iterator1 = 0;

            string abcd= "";
            foreach (string d in q)
            {

                string[] row = d.Split('^');

                data1[iterator1, 0] = row[0];

                data1[iterator1, 1] = row[1];

                data1[iterator1, 2] = abcd;

                abcd = "children";

                iterator1++;

            }

            DataTable newsDataTable1 = new DataTable();

            // add some columns to our datatable

            newsDataTable1.Columns.Add("author");

            newsDataTable1.Columns.Add("comment");

            newsDataTable1.Columns.Add("abc");

            // adding new rows

            for (int i = 0; i < iterator1; i++)
            {

                DataRow newsDataRow1 = newsDataTable1.NewRow();

                newsDataRow1["author"] = data1[i, 0];

                newsDataRow1["comment"] = data1[i, 1];

                newsDataRow1["abc"] = data1[i, 2];

                newsDataTable1.Rows.Add(newsDataRow1);

            }

            // bind our datatable to our repeater

            commentsec.DataSource = newsDataTable1;

            commentsec.DataBind();

        }
        catch (Exception e1)
        {
            error.Visible = true;
            error.Text = "error";
            int abc = 1;
        }
    }