Exemple #1
0
    protected void AddBtn_Click(object sender, EventArgs e)
    {
        if (ActionLbl.Text == "Add")
        {
            if (Image.HasFile)
            {
                string ext = System.IO.Path.GetExtension(Image.FileName);

                if (ext.ToLower() == ".png" || ext.ToLower() == ".jpg" || ext.ToLower() == ".jpeg")
                {
                    Image.SaveAs(Server.MapPath(ConfigurationManager.AppSettings["GalleryImgPath"]) + Image.FileName);
                    string path = ConfigurationManager.AppSettings["GalleryImgPath"] + Image.FileName;

                    string zk = "insert into gallery (Title,Description,Image,CreatedOn,IsShow) values('" + TitileTb.Text + "','" + DescriptionTb.Text + "','" + path + "','" + current_time + "'," + IsShowChk.Checked + ")";
                    dc.setdata(zk);
                    ClearFields();
                }
                else
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please Select Image Only.');", true);
                }
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please select Image.');", true);
            }
        }
        else
        {
            if (Image.HasFile)
            {
                string ext = System.IO.Path.GetExtension(Image.FileName);

                if (ext.ToLower() == ".png" || ext.ToLower() == ".jpg" || ext.ToLower() == ".jpeg")
                {
                    Image.SaveAs(Server.MapPath(ConfigurationManager.AppSettings["GalleryImgPath"]) + Image.FileName);
                    string path = ConfigurationManager.AppSettings["GalleryImgPath"] + Image.FileName;

                    string zk = "update gallery set Title='" + TitileTb.Text + "',Description='" + DescriptionTb.Text + "',Image='" + path + "',CreatedOn='" + current_time + "',IsShow=" + IsShowChk.Checked + " where id='" + ImageIdLbl.Text + "'";
                    dc.setdata(zk);
                    ClearFields();
                }
                else
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please Select Image Only.');", true);
                }
            }
            else
            {
                string zk = "update gallery set Title='" + TitileTb.Text + "',Description='" + DescriptionTb.Text + "',CreatedOn='" + current_time + "',IsShow=" + IsShowChk.Checked + " where id='" + ImageIdLbl.Text + "'";
                dc.setdata(zk);
                ClearFields();
            }
        }
    }
    public String SaveAdmData(String Fname, String Mname, String Lname, String DOB, String Gender, String Address, String State, String PIN, String Email, String FAname, String MOname, String StuMob, String FAMob, String Course, String StuImg, String TenMSImg, String TwelveMSImg)
    {
        // byte[] image_byte = Encoding.Unicode.GetBytes(image);
        Image convertedStuImg      = ConvertToImage(StuImg);
        Image convertedTenMSImg    = ConvertToImage(TenMSImg);
        Image convertedTwelveMSImg = ConvertToImage(TwelveMSImg);
        //String stuPath = ConfigurationManager.AppSettings["StuPhotoPath"] + Email;
        //String tenPath = ConfigurationManager.AppSettings["10thMarksheetPath"] + Email;
        //String twelvePath = ConfigurationManager.AppSettings["12thMarksheetPath"] + Email;
        String stuPath    = "~//Admin//StudentPhotos//" + Email + ".png";
        String tenPath    = "~//Admin//10thMarksheet//" + Email + ".png";
        String twelvePath = "~//Admin//12thMarksheet//" + Email + ".png";

        try
        {
            convertedStuImg.Save(Server.MapPath(stuPath), System.Drawing.Imaging.ImageFormat.Png);
            convertedTenMSImg.Save(Server.MapPath(tenPath), System.Drawing.Imaging.ImageFormat.Png);
            convertedTwelveMSImg.Save(Server.MapPath(twelvePath), System.Drawing.Imaging.ImageFormat.Png);

            string zk = "insert into admissionform (RegistarionDate,FName,MName,LName,DOB,Gender,Address,State,PostalCode,EmailId,FatherName,MotherName,StudenMobile,FatherMobile,Photo,AdmissionInId,TenMarkSheet,TwelveMarkSheet,IsAnswered) values('" + current_time.ToShortDateString() + "','" + Fname + "','" + Mname
                        + "','" + Lname + "','" + DOB + "','" + Gender + "','" + Address + "','" + State + "','" + PIN + "','" + Email + "','" + FAname + "','" + MOname + "','" + StuMob + "','" + FAMob + "','" + stuPath + "'," + Course + ",'" + tenPath + "','" + twelvePath + "',0)";
            dc.setdata(zk);
        }
        catch (Exception e)
        {
            return(e.Message);
        }
        return("Success");
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (DropDownList1.SelectedIndex == 0)
        {
            ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please Select City');", true);
            //Response.Write("<script>alert('Please Select City')</script>");
        }
        else
        {
            if (is_ff_chk.Checked == true)
            {
                is_ff = 1;
            }
            else
            {
                is_ff = 0;
            }
            string k = "insert into providers values('" + TextBox3.Text + "','" + TextBox1.Text + "','" + DropDownList1.SelectedItem + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "'," + is_ff + ",'" + TextBox5.Text + "')";
            dc.setdata(k);
            ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Provider is Registered');", true);
            TextBox1.Text = "";
            TextBox2.Text = "";
            TextBox3.Text = "";
            TextBox4.Text = "";
            TextBox5.Text = "";

            TextBox1.Focus();
        }
    }
    protected void SubmitBtn_Click(object sender, EventArgs e)
    {
        string ext = System.IO.Path.GetExtension(Photo.FileName);

        if (ext.ToLower() == ".png" || ext.ToLower() == ".jpg" || ext.ToLower() == ".jpeg")
        {
            Photo.SaveAs(Server.MapPath(ConfigurationManager.AppSettings["StuPhotoPath"]) + Photo.FileName);
            TenMarkSheet.SaveAs(Server.MapPath(ConfigurationManager.AppSettings["10thMarksheetPath"]) + TenMarkSheet.FileName);
            TewlveMarkSheet.SaveAs(Server.MapPath(ConfigurationManager.AppSettings["12thMarksheetPath"]) + TewlveMarkSheet.FileName);
            string stuPath        = ConfigurationManager.AppSettings["StuPhotoPath"] + Photo.FileName;
            string tenMarkPath    = ConfigurationManager.AppSettings["10thMarksheetPath"] + TenMarkSheet.FileName;
            string twelveMarkPath = ConfigurationManager.AppSettings["12thMarksheetPath"] + TewlveMarkSheet.FileName;

            string zk = "insert into admissionform (RegistarionDate,FName,MName,LName,DOB,Gender,Address,State,PostalCode,EmailId,FatherName,MotherName,StudenMobile,FatherMobile,Photo,AdmissionInId,TenMarkSheet,TwelveMarkSheet,IsAnswered) values('" + current_time.ToShortDateString() + "','" + FNameTb.Text + "','" + MNameTb.Text
                        + "','" + LNameTb.Text + "','" + DOBTb.Text + "','" + gender.SelectedItem + "','" + AddressTb.Text + "','" + StateTb.Text + "','" + PINTb.Text + "','" + EmailTb.Text + "','" + FatherNameTb.Text + "','" + MotherNameTb.Text + "','" + StuMobTb.Text + "','" + FaMobTb.Text + "','" + stuPath + "'," + AdmissionDD.SelectedValue + ",'" + tenMarkPath + "','" + twelveMarkPath + "',0)";
            dc.setdata(zk);
            //ClearFields();

            ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Form Submitted.');window.location='AdmissionForm.aspx';", true);
        }
        else
        {
            ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Select Image Only For Photo.');", true);
        }
    }
Exemple #5
0
    protected void Delete_order_btn_Click(object sender, EventArgs e)
    {
        string kj = "delete from monthly_order where order_id='" + Order_id_lbl.Text + "'";

        dc.setdata(kj);
        ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('This Order Is Deleted');window.location='View_monthly_order.aspx';", true);
    }
Exemple #6
0
    protected void SendMailBtn_Click(object sender, EventArgs e)
    {
        if (SubjectTb.Text == "")
        {
            ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please Enter Subject.');", true);
        }
        if (MsgTb.Text == "")
        {
            ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please Enter Message.');", true);
        }

        Thread email = new Thread(delegate()
        {
            sendmail();
        });

        email.IsBackground = true;
        email.Start();

        string zkp = "update inquiry set IsAnswered=1 where id='" + Request.QueryString["id"].ToString() + "'";

        dc.setdata(zkp);

        ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Email Is Sent.');window.location='Inqury.aspx';", true);
    }
    private void DeleteCurrentOrder()
    {
        DataSet ds12 = new DataSet();
        string  jk   = "select finish_date from monthly_order where uid='" + Convert.ToString(Session["uid"]) + "'";

        ds12 = dc.getdata(jk);

        if (ds12.Tables[0].Rows.Count != 0)
        {
            string td = current_time.ToString("dd/MM/yyyy");
            if (td == ds12.Tables[0].Rows[0][0].ToString())
            {
                string jkp = "delete from monthly_order where uid='" + Convert.ToString(Session["uid"]) + "'";
                dc.setdata(jkp);
            }
        }
    }
Exemple #8
0
    protected void DeleteLb_Command(object sender, CommandEventArgs e)
    {
        string id  = e.CommandArgument.ToString();
        string jkp = "delete from SpecialTiffin where TiffinId='" + id + "'";

        dc.setdata(jkp);
        BindData();
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        string s = "update admin_login set pass='******' where id='" + Session["aid"].ToString() + "'";

        dc.setdata(s);

        Session["msg"] = "Password Is Changed Please Log In With New Password";
        Response.Redirect("~/Log_in.aspx");
    }
    protected void DeleteProduct(object sender, GridViewDeleteEventArgs e)
    {
        string id = ((Label)ff_gv.Rows[e.RowIndex]
                     .FindControl("product_id_lbl")).Text;

        string zk = "delete from fast_food_products where product_id='" + id + "'";

        dc.setdata(zk);
        BindData();
    }
    protected void del_charge_btn_Click(object sender, EventArgs e)
    {
        string j = "update delivery_charges set del_charge_limit='" + del_charge_limit_tb.Text + "', del_charge='" + del_charge_tb.Text + "' where charges_id=1";

        dc.setdata(j);

        ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Charges are updated');", true);
        Panel2.Visible = false;
        Panel1.Visible = true;
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string j = "delete from providers where pid='" + Label1.Text + "'";

        dc.setdata(j);
        string y = "delete from simple_tiffin where p_id='" + Label1.Text + "'";

        dc.setdata(y);
        string o = "delete from tiffin_with_sweet where p_id='" + Label1.Text + "'";

        dc.setdata(o);
        string t = "delete from simple_tiffin_daily_order where pid='" + Label1.Text + "'";

        dc.setdata(t);
        string i = "delete from tiffin_with_sweet_daily_order where pid='" + Label1.Text + "'";

        dc.setdata(i);
        ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('This provider is deleted from TIFFIN DABBA');window.location='View_providers.aspx';", true);
    }
    protected void Order_Time_btn_Click(object sender, EventArgs e)
    {
        string j = "update order_timmings set time='" + Lunch_Time_tb.Text + "' where order_for='Lunch'";

        dc.setdata(j);
        string k = "update order_timmings set time='" + Dinner_Time_tb.Text + "' where order_for='Dinner'";

        dc.setdata(k);

        ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Tiffin Times are updated');", true);
        Panel2.Visible            = false;
        ff_order_time_pnl.Visible = false;
        Panel1.Visible            = true;

        //DataSet ds1 = new DataSet();
        //string l = "select * from order_timmings";
        //ds1 = dc.getdata(l);
        //Lunch_Time_tb.Text = ds1.Tables[0].Rows[0][1].ToString();
        //Dinner_Time_tb.Text = ds1.Tables[0].Rows[1][1].ToString();
    }
Exemple #14
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (DropDownList1.SelectedIndex == 0)
     {
         ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please select Availability of tiffin');", true);
         //Response.Write("<script>alert('Please select Availability of tiffin')</script>");
     }
     else if (DropDownList1.SelectedIndex == 1)
     {
         string j = "update simple_tiffin set available='Order Now' where t_id='" + Session["stid"].ToString() + "'";
         dc.setdata(j);
         Response.Redirect("~/provider/Simple_tiffin_list.aspx");
     }
     else if (DropDownList1.SelectedIndex == 2)
     {
         string j = "update simple_tiffin set available='Not Available' where t_id='" + Session["stid"].ToString() + "'";
         dc.setdata(j);
         Response.Redirect("~/provider/Simple_tiffin_list.aspx");
     }
 }
Exemple #15
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (TextBox1.Text == "")
        {
            ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please Select City');", true);
            //Response.Write("<script>alert('Please Enter City')</script>");
        }
        else
        {
            string j = "insert into city (city) values('" + TextBox1.Text + "')";
            dc.setdata(j);
            TextBox1.Text = "";


            DataSet ds1 = new DataSet();
            string  k   = "select * from city";
            ds1 = dc.getdata(k);

            GridView1.DataSource = ds1;
            GridView1.DataBind();
            GridView2.DataSource = ds1;
            GridView2.DataBind();


            DropDownList1.Items.Clear();
            for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
            {
                DropDownList1.Items.Add(ds1.Tables[0].Rows[i][0].ToString());
            }
        }
    }
    protected void AddBtn_Click(object sender, EventArgs e)
    {
        if (ProviderIdDD.SelectedIndex == 0)
        {
            ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please select Provider');", true);
        }
        else
        {
            String ext = System.IO.Path.GetExtension(Image.FileName);
            if (ext.ToLower() == ".png" || ext.ToLower() == ".jpg" || ext.ToLower() == ".jpeg" || ext.ToLower() == ".gif")
            {
                Image.SaveAs(Server.MapPath("~//admin//special_tiffin_image//" + Image.FileName));
                string path = "~//admin//special_tiffin_image//" + Image.FileName;

                string o = "insert into SpecialTiffin (ProviderId,ProviderCity,TiffinName,Description,Price,StartTime,EndTime,IsAvailable,IsAppHome,Image) values('" + ProviderIdDD.SelectedItem.ToString() + "','" +
                           ProviderCityLbl.Text + "','" + TiffinNameTb.Text + "','" + DescriptionTb.Text + "','" + PriceTb.Text + "','" + StartTimeTb.Text + "','" + EndTimeTb.Text + "'," +
                           IsAvailableChk.Checked + "," + IsAppHome.Checked + ",'" + path + "')";
                dc.setdata(o);

                ProviderIdDD.SelectedIndex = 0;
                ProviderCityLbl.Text       = "";
                ProviderNameLbl.Text       = "";
                TiffinNameTb.Text          = "";
                DescriptionTb.Text         = "";
                PriceTb.Text           = "";
                StartTimeTb.Text       = "";
                EndTimeTb.Text         = "";
                IsAvailableChk.Checked = false;
                IsAppHome.Checked      = false;

                ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Tiffin Added.');", true);
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please select image only');", true);
            }
        }
    }
    private void BookOrder()
    {
        string jk = "insert into SpecialTiffinOrder (UserId,TiffinId,DelCity,DelArea,DelAddress,BookDate,BookTime,IsRead,IsDelivered,IsCancelled) values('" + Convert.ToString(Session["uid"]) + "','" +
                    Convert.ToString(Session["sptid"]) + "','" + Convert.ToString(Session["delivery_city"]) + "','" + Convert.ToString(Session["delivery_area"]) + "','" + DelAddressTb.Text + "','" +
                    DateLbl.Text + "','" + TimeLbl.Text + "',0,0,0)";

        dc.setdata(jk);

        string  provider   = "select ProviderId from SpecialTiffin where TiffinId='" + Convert.ToString(Session["sptid"]) + "'";
        DataSet dsProvider = new DataSet();

        dsProvider = dc.getdata(provider);

        string  providerDetails   = "select * from providers where pid='" + dsProvider.Tables[0].Rows[0][0].ToString() + "'";
        DataSet dsProviderDetails = new DataSet();

        dsProviderDetails = dc.getdata(providerDetails);

        string providerName   = dsProviderDetails.Tables[0].Rows[0][1].ToString();
        string providerMobile = dsProviderDetails.Tables[0].Rows[0][3].ToString();
        string providerEmail  = dsProviderDetails.Tables[0].Rows[0][4].ToString();

        string  user   = "******" + Convert.ToString(Session["uid"]) + "'";
        DataSet dsUser = new DataSet();

        dsUser = dc.getdata(user);

        string userName   = dsUser.Tables[0].Rows[0][1].ToString();
        string userMobile = dsUser.Tables[0].Rows[0][3].ToString();
        string userEmail  = dsUser.Tables[0].Rows[0][5].ToString();

        string msgAdmin    = "Hello Admin, We are from Tiffin Dabba new Special Tiffin order booked.Tiffin Name:-  " + TiffinNameLbl.Text + " , Price:-  " + PriceLbl.Text + " Rs.";
        string msgProvider = "Hello " + providerName + ", We are from Tiffin Dabba new Special Tiffin order booked.Tiffin Name:-  " + TiffinNameLbl.Text;
        string msgUser     = "******" + userName + ", We are from Tiffin Dabba,You booked Special Tiffin.Tiffin Name:-  " + TiffinNameLbl.Text + ", Price:-  " + PriceLbl.Text + " Rs.";

        Thread thread = new Thread(delegate()
        {
            SendMsgAdmin(msgAdmin);
            SendMsgProvider(msgProvider, providerMobile);
            SendMsgUser(msgUser, userMobile);

            SendEmailUser(msgUser, userEmail);
        });

        thread.IsBackground = true;
        thread.Start();

        //ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Your Order Is Booked You Can Check From Simple Tiffin Order Page');window.location='View_simple_tiffin_order.aspx';", true);
        ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Your Order Is Booked.');", true);
    }
Exemple #18
0
    protected void Button3_Click(object sender, EventArgs e)
    {
        string s = "update trial_tiffin_order set status='Delivered' where order_id=" + Label1.Text;

        dc.setdata(s);

        DataSet ds10 = new DataSet();
        string  j    = "select * from trial_tiffin_order where order_id=" + Label1.Text;

        ds10         = dc.getdata(j);
        Label17.Text = ds10.Tables[0].Rows[0][15].ToString();

        ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('This tiffin is delireved');", true);
    }
    protected void UpdateCat(object sender, GridViewUpdateEventArgs e)
    {
        string id = ((Label)ff_cat_gv.Rows[e.RowIndex]
                     .FindControl("cat_id_lbl")).Text;
        string name = ((TextBox)ff_cat_gv.Rows[e.RowIndex]
                       .FindControl("cat_name_tb")).Text;

        FileUpload catImage = ((FileUpload)ff_cat_gv.Rows[e.RowIndex].FindControl("CatImage"));

        if (catImage.HasFile)
        {
            string ext = System.IO.Path.GetExtension(catImage.FileName);

            if (ext == ".jpg" || ext == ".png" || ext == ".jpeg" || ext == ".gif" || ext == ".GIF" || ext == ".PNG" || ext == ".JPEG" || ext == ".JPG")
            {
                catImage.SaveAs(Server.MapPath("~//admin//fast_food_image//FastFoodCatImage//" + catImage.FileName));
                string path = "~//admin//fast_food_image//FastFoodCatImage//" + catImage.FileName;

                string zk = "update fast_food_categories set name='" + name + "',Image='" + path + "' where cat_id='" + id + "'";
                dc.setdata(zk);
                ff_cat_gv.EditIndex = -1;
                BindData();
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please select Image Only');", true);
            }
        }
        else
        {
            string zk = "update fast_food_categories set name='" + name + "' where cat_id='" + id + "'";
            dc.setdata(zk);
            ff_cat_gv.EditIndex = -1;
            BindData();
        }
    }
    public void SubmitBtn_ServerClick(object sender, EventArgs e)
    {
        string zk = "insert into inquiry (InquiryDate,Name,EmailId,Mobile,Location,Message,IsAnswered) values('" + current_time.ToShortDateString() + "','" + NameTb.Text + "','" + EmailTb.Text + "','" + MobileTb.Text + "','" + LocationTb.Text + "','" + MsgTb.Text + "',false)";

        dc.setdata(zk);

        Thread email = new Thread(delegate()
        {
            sendmail();
        });

        email.IsBackground = true;
        email.Start();

        ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Inqiury Submitted.');window.location='ContactUs.aspx';", true);
    }
    private void send_activation_mail()
    {
        //try
        //{
        //    string activationlink = "http://*****:*****@gmail.com", "TIFFIN DABBA");//TIFFIN DABBA represent title in sent email.
        //    mm.To.Add(TextBox4.Text);
        //    mm.Subject = "Account Activation";
        //    mm.Body = "Hello: " + TextBox1.Text + "<br /><br />To activate your TIFFIN DABBA account <a href='" + activationlink + "'>Click here</a>";

        //    mm.IsBodyHtml = true;
        //    SmtpClient smtp = new SmtpClient();
        //    smtp.Host = "smtp.gmail.com";
        //    smtp.EnableSsl = true;
        //    smtp.Port = 587;
        //    smtp.Credentials = new System.Net.NetworkCredential("*****@*****.**", "102515209");


        //    smtp.Send(mm);

        string kz = "insert into user_accounts values('" + TextBox4.Text + "','" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "','" + TextBox5.Text + "','Allowed')";

        dc.setdata(kz);

        TextBox1.Text = "";
        TextBox2.Text = "";
        TextBox3.Text = "";
        TextBox4.Text = "";
        TextBox5.Text = "";

        TextBox1.Focus();

        ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Now You Can Login');", true);
        Email_login_tb.Focus();
        //Session["msg"] = "Now You Can Log In";
        //Response.Redirect("~/Log_in.aspx");
        //ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('activation link is send to your email id please activate your account');window.location='Log_in.aspx';", true);
        //}
        //catch (Exception ex)
        //{
        //    string Mail_msg = "Registration fail please try again.";
        //    ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('" + Mail_msg + "');", true);
        //}
    }
Exemple #22
0
    protected void UpdateProvider(object sender, GridViewUpdateEventArgs e)
    {
        string id = ((LinkButton)GridView3.Rows[e.RowIndex]
                     .FindControl("LinkButton3")).Text;
        string ff = ((TextBox)GridView3.Rows[e.RowIndex]
                     .FindControl("is_ff_tb")).Text;

        string zk = "update  providers set is_fastfood='" + ff + "' where pid='" + id + "'";

        dc.setdata(zk);
        GridView3.EditIndex = -1;
        BindData();
    }
    protected void UpdateTiffin(object sender, GridViewUpdateEventArgs e)
    {
        string t_id = ((LinkButton)GridView1.Rows[e.RowIndex]
                       .FindControl("LinkButton1")).Text;
        string stdu = ((TextBox)GridView1.Rows[e.RowIndex]
                       .FindControl("Std_tb")).Text;
        string avgu = ((TextBox)GridView1.Rows[e.RowIndex]
                       .FindControl("Avg_tb")).Text;
        string pooru = ((TextBox)GridView1.Rows[e.RowIndex]
                        .FindControl("Poor_tb")).Text;
        string taglineu = ((TextBox)GridView1.Rows[e.RowIndex]
                           .FindControl("Tagline_tb")).Text;
        string recommendu = ((TextBox)GridView1.Rows[e.RowIndex]
                             .FindControl("Recommend_tb")).Text;

        string zk = "update monthly_tiffin_menu set standard='" + stdu + "',average='" + avgu + "',poor='" + pooru + "',tagline='" + taglineu + "',recommend='" + recommendu + "' where tiffin_id='" + t_id + "'";

        dc.setdata(zk);
        GridView1.EditIndex = -1;
        BindData();
    }
    protected void UpdateTiffin(object sender, GridViewUpdateEventArgs e)
    {
        string t_id = ((LinkButton)GridView1.Rows[e.RowIndex]
                       .FindControl("LinkButton1")).Text;
        string stdu = ((TextBox)GridView1.Rows[e.RowIndex]
                       .FindControl("Std_tb")).Text;
        string avgu = ((TextBox)GridView1.Rows[e.RowIndex]
                       .FindControl("Avg_tb")).Text;
        string pooru = ((TextBox)GridView1.Rows[e.RowIndex]
                        .FindControl("Poor_tb")).Text;
        string taglineu = ((TextBox)GridView1.Rows[e.RowIndex]
                           .FindControl("Tagline_tb")).Text;
        string recommendu = ((TextBox)GridView1.Rows[e.RowIndex]
                             .FindControl("Recommend_tb")).Text;

        CheckBox isAppHomeChk = ((CheckBox)GridView1.Rows[e.RowIndex].FindControl("IsAppHomeEditChk"));

        string zk = "update tiffin_with_sweet set standard='" + stdu + "',average='" + avgu + "',poor='" + pooru + "',tagline='" + taglineu + "',recommend='" + recommendu + "',IsAppHome=" + isAppHomeChk.Checked + " where t_id='" + t_id + "'";

        dc.setdata(zk);
        GridView1.EditIndex = -1;
        BindData();
    }
    protected void ProfileImgSaveBtn_Click(object sender, EventArgs e)
    {
        string  jk = "select * from app_setting";
        DataSet ds = new DataSet();

        ds = dc.getdata(jk);

        if (ds.Tables[0].Rows.Count == 0)
        {
            string ext = System.IO.Path.GetExtension(ProfileImg.FileName);
            if (ext == ".jpg" || ext == ".png" || ext == ".jpeg" || ext == ".gif" || ext == ".GIF" || ext == ".PNG" || ext == ".JPEG" || ext == ".JPG")
            {
                ProfileImg.SaveAs(Server.MapPath("~//admin//AppSetting//ProfileImage//" + ProfileImg.FileName));
                string path = "~//admin//AppSetting//ProfileImage//" + ProfileImg.FileName;

                string jkp = "insert into app_setting values('App1','" + path + "')";
                dc.setdata(jkp);
                ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Image Added.');", true);
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please select Image Only');", true);
            }
        }
        else
        {
            string ext = System.IO.Path.GetExtension(ProfileImg.FileName);
            if (ext == ".jpg" || ext == ".png" || ext == ".jpeg" || ext == ".gif" || ext == ".GIF" || ext == ".PNG" || ext == ".JPEG" || ext == ".JPG")
            {
                ProfileImg.SaveAs(Server.MapPath("~//admin//AppSetting//ProfileImage//" + ProfileImg.FileName));
                string path = "~//admin//AppSetting//ProfileImage//" + ProfileImg.FileName;

                string jkp = "update app_setting set ProfileImg='" + path + "' where Id='App1'";
                dc.setdata(jkp);

                ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Image Updated.');", true);
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please select Image Only');", true);
            }
        }
    }
    protected void AddUpdateBtn_Click(object sender, EventArgs e)
    {
        if (CategoryDD.SelectedIndex == 0)
        {
            ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please Select Category.');", true);
        }
        else
        {
            if (DescriptionTb.Text == "")
            {
                ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please Write Some Content.');", true);
            }
            else
            {
                if (TitleTb.Text == "")
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please Enter Title.');", true);
                }
                else
                {
                    if (ActionLbl.Text == "Add")
                    {
                        if (Image.HasFile)
                        {
                            string ext = System.IO.Path.GetExtension(Image.FileName);

                            if (ext.ToLower() == ".png" || ext.ToLower() == ".jpg" || ext.ToLower() == ".jpeg")
                            {
                                Image.SaveAs(Server.MapPath(ConfigurationManager.AppSettings["JobImgPath"]) + Image.FileName);
                                string path = ConfigurationManager.AppSettings["JobImgPath"] + Image.FileName;

                                string zk = "insert into jobs (CreatedOn,Title,Image,Content,CategoryId,IsShow) values('" + current_time.ToShortDateString() + "','" + TitleTb.Text + "','" + path + "','" + DescriptionTb.Text + "','" + CategoryDD.SelectedValue + "'," + IsShowChk.Checked + ")";
                                dc.setdata(zk);
                                ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Data Added.');", true);
                                ClearFields();
                            }
                            else
                            {
                                ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please Select Image Only.');", true);
                            }
                        }
                        else
                        {
                            ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please select Image.');", true);
                        }
                    }
                    else
                    {
                        if (Image.HasFile)
                        {
                            string ext = System.IO.Path.GetExtension(Image.FileName);

                            if (ext.ToLower() == ".png" || ext.ToLower() == ".jpg" || ext.ToLower() == ".jpeg")
                            {
                                Image.SaveAs(Server.MapPath(ConfigurationManager.AppSettings["JobImgPath"]) + Image.FileName);
                                string path = ConfigurationManager.AppSettings["JobImgPath"] + Image.FileName;

                                string zk = "update jobs set CreatedOn='" + current_time.ToShortDateString() + "',Title='" + TitleTb.Text + "',Image='" + path + "',Content='" + DescriptionTb.Text + "',CategoryId='" + CategoryDD.SelectedValue + "',IsShow=" + IsShowChk.Checked + " where id='" + ImageIdLbl.Text + "'";
                                dc.setdata(zk);
                                ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Data Updated.');", true);
                                ClearFields();
                            }
                            else
                            {
                                ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please Select Image Only.');", true);
                            }
                        }
                        else
                        {
                            string zk = "update jobs set CreatedOn='" + current_time.ToShortDateString() + "',Title='" + TitleTb.Text + "',Content='" + DescriptionTb.Text + "',CategoryId='" + CategoryDD.SelectedValue + "',IsShow=" + IsShowChk.Checked + " where id='" + ImageIdLbl.Text + "'";
                            dc.setdata(zk);
                            ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Data Updated.');", true);
                            ClearFields();
                        }
                    }
                }
            }
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (DropDownList1.SelectedIndex != 0)
        {
            if (DropDownList2.SelectedIndex != 0)
            {
                //DataSet ds3 = new DataSet();
                //string ui = "select t_id from tiffin_with_sweet order by t_id DESC";
                //ds3 = dc.getdata(ui);

                //if (ds3.Tables[0].Rows.Count == 0)
                //{
                //    tid = "TWS1";
                //}
                //else
                //{
                //    String s = ds3.Tables[0].Rows[0][0].ToString();

                //    string t = s.Substring(3, s.Length - 3);
                //    int n = Convert.ToInt32(t);
                //    n = n + 1;


                //    tid = "TWS" + n.ToString();
                //}

                string ext = System.IO.Path.GetExtension(FileUpload1.FileName);

                if (ext == ".jpg" || ext == ".png" || ext == ".jpeg" || ext == ".gif" || ext == ".GIF" || ext == ".PNG" || ext == ".JPEG" || ext == ".JPG")
                {
                    FileUpload1.SaveAs(Server.MapPath("~//admin//tiffin_with_sweet_image//" + FileUpload1.FileName));
                    string path = "~//admin//tiffin_with_sweet_image//" + FileUpload1.FileName;


                    try
                    {
                        if (Std_chk.Checked == true)
                        {
                            std = "1";
                        }
                        else
                        {
                            std = "0";
                        }

                        if (avg_chk.Checked == true)
                        {
                            avg = "1";
                        }
                        else
                        {
                            avg = "0";
                        }

                        if (poor_chk.Checked == true)
                        {
                            poor = "1";
                        }
                        else
                        {
                            poor = "0";
                        }

                        if (Rmd_yes_rb.Checked == true)
                        {
                            string q = "insert into tiffin_with_sweet values('" + TextBox7.Text + "','" + DropDownList1.Text + "','" + DropDownList2.Text + "','" + Label2.Text + "','" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "','" + TextBox5.Text + "','" + TextBox8.Text + "','" + TextBox6.Text + "','" + std + "','" + avg + "','" + poor + "','" + TextBox9.Text + "','1','" + path + "','Order Now'," + IsAppHomeChk.Checked + ")";
                            dc.setdata(q);
                            ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('" + TextBox7.Text + " Tiffin With Sweet Added'');", true);

                            TextBox1.Text               = "";
                            TextBox2.Text               = "";
                            TextBox3.Text               = "";
                            TextBox4.Text               = "";
                            TextBox5.Text               = "";
                            TextBox6.Text               = "";
                            TextBox7.Text               = "";
                            TextBox8.Text               = "";
                            TextBox9.Text               = "";
                            Std_chk.Checked             = false;
                            avg_chk.Checked             = false;
                            poor_chk.Checked            = false;
                            IsAppHomeChk.Checked        = false;
                            DropDownList1.SelectedIndex = 0;
                            DropDownList2.Items.Clear();
                            Label2.Text = "";
                        }
                        if (Rmd_no_rb.Checked == true)
                        {
                            string q = "insert into tiffin_with_sweet values('" + TextBox7.Text + "','" + DropDownList1.Text + "','" + DropDownList2.Text + "','" + Label2.Text + "','" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "','" + TextBox5.Text + "','" + TextBox8.Text + "','" + TextBox6.Text + "','" + std + "','" + avg + "','" + poor + "','" + TextBox9.Text + "','0','" + path + "','Order Now'," + IsAppHomeChk.Checked + ")";
                            dc.setdata(q);
                            ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('" + TextBox7.Text + " Tiffin With Sweet Added'');", true);

                            TextBox1.Text               = "";
                            TextBox2.Text               = "";
                            TextBox3.Text               = "";
                            TextBox4.Text               = "";
                            TextBox5.Text               = "";
                            TextBox6.Text               = "";
                            TextBox7.Text               = "";
                            TextBox8.Text               = "";
                            TextBox9.Text               = "";
                            Std_chk.Checked             = false;
                            avg_chk.Checked             = false;
                            poor_chk.Checked            = false;
                            IsAppHomeChk.Checked        = false;
                            DropDownList1.SelectedIndex = 0;
                            DropDownList2.Items.Clear();
                            Label2.Text = "";
                        }
                    }
                    catch (Exception ex)
                    {
                        ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('This Tiffin Id Already Exist.');", true);
                        TextBox7.Text = "";
                        TextBox7.Focus();
                    }

                    //String j = Label1.Text;
                    //string k = j.Substring(3, j.Length - 3);
                    //int l = Convert.ToInt32(k);
                    //l = l + 1;
                    //string jy = "TWS" + l.ToString();
                    //Label1.Text = jy;
                }
                else
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please select Image Only');", true);
                }
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please select provider');", true);
                //Response.Write("<script>alert('Please select provider')</script>");
            }
        }
        else
        {
            ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please Select City');", true);
            //Response.Write("<script>alert('Please select city')</script>");
        }
    }
Exemple #28
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (DropDownList1.SelectedIndex == 0)
        {
            ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please select book for LUNCH or DINNER');", true);
            DropDownList1.Focus();
        }
        else if (CheckBox1.Checked == false)
        {
            ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please agree to Terms & Condition');", true);
        }
        else if (DropDownList1.SelectedIndex == 1)
        {
            int in_lunch_time = DateTime.Compare(current_time, lunch_time);

            if (in_lunch_time < 0)
            {
                System.Threading.Thread.Sleep(1000);

                DataSet ds3 = new DataSet();
                string  l   = "select p_id from tiffin_with_sweet where t_id='" + Session["twsid"].ToString() + "'";
                ds3 = dc.getdata(l);

                DataSet ds4 = new DataSet();
                string  z   = "select tws_image from tiffin_with_sweet where t_id='" + Session["twsid"].ToString() + "'";
                ds4 = dc.getdata(z);

                string p = "insert into tiffin_with_sweet_daily_order values('" + Label1.Text + "','" + DropDownList1.Text + "','" + Session["twsid"].ToString() + "','" + ds3.Tables[0].Rows[0][0].ToString() + "','" + Session["uid"].ToString() + "','" + Label2.Text + "','" + Label10.Text + "','" + Label4.Text + "','" + Label3.Text + "','" + TextBox1.Text + "','" + Session["delivery_area"].ToString() + "','" + TextBox2.Text + "','" + Label5.Text + "','" + Label6.Text + "','" + Label7.Text + "','" + Label8.Text + "','" + Label11.Text + "','" + Other_lbl.Text + "','" + Label9.Text + "','" + ds4.Tables[0].Rows[0][0].ToString() + "','Not Delivered')";
                dc.setdata(p);

                Thread email = new Thread(delegate()
                {
                    sendmail_user_lunch();
                    sendmail_provider_lunch();
                    sendmail_admin_lunch();
                });
                email.IsBackground = true;
                email.Start();

                ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Your Order Is Booked You Can Check From Tiffin With Sweet Order Page');window.location='View_tiffin_with_sweet_order.aspx';", true);
            }
            else if (in_lunch_time == 0)
            {
                System.Threading.Thread.Sleep(1000);

                DataSet ds3 = new DataSet();
                string  l   = "select p_id from tiffin_with_sweet where t_id='" + Session["twsid"].ToString() + "'";
                ds3 = dc.getdata(l);

                DataSet ds4 = new DataSet();
                string  z   = "select tws_image from tiffin_with_sweet where t_id='" + Session["twsid"].ToString() + "'";
                ds4 = dc.getdata(z);

                string p = "insert into tiffin_with_sweet_daily_order values('" + Label1.Text + "','" + DropDownList1.Text + "','" + Session["twsid"].ToString() + "','" + ds3.Tables[0].Rows[0][0].ToString() + "','" + Session["uid"].ToString() + "','" + Label2.Text + "','" + Label10.Text + "','" + Label4.Text + "','" + Label3.Text + "','" + TextBox1.Text + "','" + Session["delivery_area"].ToString() + "','" + TextBox2.Text + "','" + Label5.Text + "','" + Label6.Text + "','" + Label7.Text + "','" + Label8.Text + "','" + Label11.Text + "','" + Other_lbl.Text + "','" + Label9.Text + "','" + ds4.Tables[0].Rows[0][0].ToString() + "','Not Delivered')";
                dc.setdata(p);

                Thread email = new Thread(delegate()
                {
                    sendmail_user_lunch();
                    sendmail_provider_lunch();
                    sendmail_admin_lunch();
                });
                email.IsBackground = true;
                email.Start();

                ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Your Order Is Booked You Can Check From Tiffin With Sweet Order Page');window.location='View_tiffin_with_sweet_order.aspx';", true);
            }
            else if (in_lunch_time > 0)
            {
                Label12.Text = "You can't book tiffin for LUNCH after " + ds10.Tables[0].Rows[0][1].ToString() + ".";
                //TextBox1.Text = "";
                //TextBox2.Text = "";
                DropDownList1.SelectedIndex = 0;
                CheckBox1.Checked           = false;
                //ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('You can't book tiffin for LUNCH after 10:30 AM');", true);
            }
        }
        else if (DropDownList1.SelectedIndex == 2)
        {
            int in_dinner_time = DateTime.Compare(current_time, dinner_time);

            if (in_dinner_time < 0)
            {
                System.Threading.Thread.Sleep(1000);

                DataSet ds3 = new DataSet();
                string  l   = "select p_id from tiffin_with_sweet where t_id='" + Session["twsid"].ToString() + "'";
                ds3 = dc.getdata(l);

                DataSet ds4 = new DataSet();
                string  z   = "select tws_image from tiffin_with_sweet where t_id='" + Session["twsid"].ToString() + "'";
                ds4 = dc.getdata(z);

                string p = "insert into tiffin_with_sweet_daily_order values('" + Label1.Text + "','" + DropDownList1.Text + "','" + Session["twsid"].ToString() + "','" + ds3.Tables[0].Rows[0][0].ToString() + "','" + Session["uid"].ToString() + "','" + Label2.Text + "','" + Label10.Text + "','" + Label4.Text + "','" + Label3.Text + "','" + TextBox1.Text + "','" + Session["delivery_area"].ToString() + "','" + TextBox2.Text + "','" + Label5.Text + "','" + Label6.Text + "','" + Label7.Text + "','" + Label8.Text + "','" + Label11.Text + "','" + Other_lbl.Text + "','" + Label9.Text + "','" + ds4.Tables[0].Rows[0][0].ToString() + "','Not Delivered')";
                dc.setdata(p);

                Thread email = new Thread(delegate()
                {
                    sendmail_user_dinner();
                    sendmail_provider_dinner();
                    sendmail_admin_dinner();
                });
                email.IsBackground = true;
                email.Start();

                ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Your Order Is Booked You Can Check From Tiffin With Sweet Order Page');window.location='View_tiffin_with_sweet_order.aspx';", true);
            }
            else if (in_dinner_time == 0)
            {
                System.Threading.Thread.Sleep(1000);

                DataSet ds3 = new DataSet();
                string  l   = "select p_id from tiffin_with_sweet where t_id='" + Session["twsid"].ToString() + "'";
                ds3 = dc.getdata(l);

                DataSet ds4 = new DataSet();
                string  z   = "select tws_image from tiffin_with_sweet where t_id='" + Session["twsid"].ToString() + "'";
                ds4 = dc.getdata(z);

                string p = "insert into tiffin_with_sweet_daily_order values('" + Label1.Text + "','" + DropDownList1.Text + "','" + Session["twsid"].ToString() + "','" + ds3.Tables[0].Rows[0][0].ToString() + "','" + Session["uid"].ToString() + "','" + Label2.Text + "','" + Label10.Text + "','" + Label4.Text + "','" + Label3.Text + "','" + TextBox1.Text + "','" + Session["delivery_area"].ToString() + "','" + TextBox2.Text + "','" + Label5.Text + "','" + Label6.Text + "','" + Label7.Text + "','" + Label8.Text + "','" + Label11.Text + "','" + Other_lbl.Text + "','" + Label9.Text + "','" + ds4.Tables[0].Rows[0][0].ToString() + "','Not Delivered')";
                dc.setdata(p);

                Thread email = new Thread(delegate()
                {
                    sendmail_user_dinner();
                    sendmail_provider_dinner();
                    sendmail_admin_dinner();
                });
                email.IsBackground = true;
                email.Start();

                ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Your Order Is Booked You Can Check From Tiffin With Sweet Order Page');window.location='View_tiffin_with_sweet_order.aspx';", true);
            }
            else if (in_dinner_time > 0)
            {
                Label12.Text = "You can't book tiffin for DINNER after " + ds10.Tables[0].Rows[1][1].ToString() + ".";
                //TextBox1.Text = "";
                //TextBox2.Text = "";
                DropDownList1.SelectedIndex = 0;
                CheckBox1.Checked           = false;
                //ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('You can't book tiffin for DINNER after 04:30 PM');", true);
            }
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (DropDownList1.SelectedIndex == 0)
        {
            ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please select book for LUNCH or DINNER');", true);
            DropDownList1.Focus();
        }
        else if (CheckBox1.Checked == false)
        {
            ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please agree to Terms & Condition');", true);
        }
        else if (DropDownList1.SelectedIndex == 1)
        {
            int in_lunch_time = DateTime.Compare(current_time, lunch_time);

            if (in_lunch_time < 0)
            {
                DataSet ds3 = new DataSet();
                string  l   = "select pid from monthly_tiffin_menu where tiffin_id='" + Session["monthly_tiffin_id"].ToString() + "'";
                ds3 = dc.getdata(l);

                DataSet ds4 = new DataSet();
                string  z   = "select image from monthly_tiffin_menu where tiffin_id='" + Session["monthly_tiffin_id"].ToString() + "'";
                ds4 = dc.getdata(z);

                string p = "insert into trial_tiffin_order values('" + Trial_tiffin_order_id_lbl.Text + "','" + DropDownList1.Text + "','" + Session["monthly_tiffin_id"].ToString() + "','" + ds3.Tables[0].Rows[0][0].ToString() + "','" + Session["uid"].ToString() + "','" + Trial_tiffin_name_lbl.Text + "','" + Trial_tiffin_email_lbl.Text + "','" + Trial_tiffin_time_lbl.Text + "','" + Trial_tiffin_date_lbl.Text + "','" + Trial_tiffin_mobile_tb.Text + "','" + Session["delivery_area"].ToString() + "','" + Trial_tiffin_address_tb.Text + "','" + Trial_tiffin_roti_lbl.Text + "','" + Trial_tiffin_price_lbl.Text + "','" + ds4.Tables[0].Rows[0][0].ToString() + "','Not Delivered')";
                dc.setdata(p);

                Thread email = new Thread(delegate()
                {
                    sendmail_user_lunch();
                    sendmail_provider_lunch();
                    sendmail_admin_lunch();
                });
                email.IsBackground = true;
                email.Start();

                ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Your Order Is Booked.');", true);
            }
            else if (in_lunch_time == 0)
            {
                DataSet ds3 = new DataSet();
                string  l   = "select pid from monthly_tiffin_menu where tiffin_id='" + Session["monthly_tiffin_id"].ToString() + "'";
                ds3 = dc.getdata(l);

                DataSet ds4 = new DataSet();
                string  z   = "select image from monthly_tiffin_menu where tiffin_id='" + Session["monthly_tiffin_id"].ToString() + "'";
                ds4 = dc.getdata(z);

                string p = "insert into trial_tiffin_order values('" + Trial_tiffin_order_id_lbl.Text + "','" + DropDownList1.Text + "','" + Session["monthly_tiffin_id"].ToString() + "','" + ds3.Tables[0].Rows[0][0].ToString() + "','" + Session["uid"].ToString() + "','" + Trial_tiffin_name_lbl.Text + "','" + Trial_tiffin_email_lbl.Text + "','" + Trial_tiffin_time_lbl.Text + "','" + Trial_tiffin_date_lbl.Text + "','" + Trial_tiffin_mobile_tb.Text + "','" + Session["delivery_area"].ToString() + "','" + Trial_tiffin_address_tb.Text + "','" + Trial_tiffin_roti_lbl.Text + "','" + Trial_tiffin_price_lbl.Text + "','" + ds4.Tables[0].Rows[0][0].ToString() + "','Not Delivered')";
                dc.setdata(p);

                Thread email = new Thread(delegate()
                {
                    sendmail_user_lunch();
                    sendmail_provider_lunch();
                    sendmail_admin_lunch();
                });

                email.IsBackground = true;
                email.Start();

                ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Your Order Is Booked.');window.location='Home.aspx';", true);
            }
            else if (in_lunch_time > 0)
            {
                Label11.Text = "You can't book trial tiffin for LUNCH after " + ds10.Tables[0].Rows[0][1].ToString() + ".";
                Trial_tiffin_address_tb.Text = "";
                Trial_tiffin_mobile_tb.Text  = "";
                DropDownList1.SelectedIndex  = 0;
                CheckBox1.Checked            = false;
                //ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('You can't book tiffin for LUNCH after 10:30 AM');", true);
            }
        }
        else if (DropDownList1.SelectedIndex == 2)
        {
            int in_dinner_time = DateTime.Compare(current_time, dinner_time);

            if (in_dinner_time < 0)
            {
                DataSet ds3 = new DataSet();
                string  l   = "select pid from monthly_tiffin_menu where tiffin_id='" + Session["monthly_tiffin_id"].ToString() + "'";
                ds3 = dc.getdata(l);

                DataSet ds4 = new DataSet();
                string  z   = "select image from monthly_tiffin_menu where tiffin_id='" + Session["monthly_tiffin_id"].ToString() + "'";
                ds4 = dc.getdata(z);

                string p = "insert into trial_tiffin_order values('" + Trial_tiffin_order_id_lbl.Text + "','" + DropDownList1.Text + "','" + Session["monthly_tiffin_id"].ToString() + "','" + ds3.Tables[0].Rows[0][0].ToString() + "','" + Session["uid"].ToString() + "','" + Trial_tiffin_name_lbl.Text + "','" + Trial_tiffin_email_lbl.Text + "','" + Trial_tiffin_time_lbl.Text + "','" + Trial_tiffin_date_lbl.Text + "','" + Trial_tiffin_mobile_tb.Text + "','" + Session["delivery_area"].ToString() + "','" + Trial_tiffin_address_tb.Text + "','" + Trial_tiffin_roti_lbl.Text + "','" + Trial_tiffin_price_lbl.Text + "','" + ds4.Tables[0].Rows[0][0].ToString() + "','Not Delivered')";
                dc.setdata(p);

                Thread email = new Thread(delegate()
                {
                    sendmail_user_dinner();
                    sendmail_provider_dinner();
                    sendmail_admin_dinner();
                });
                email.IsBackground = true;
                email.Start();

                ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Your Order Is Booked.');window.location='Home.aspx';", true);
            }
            else if (in_dinner_time == 0)
            {
                DataSet ds3 = new DataSet();
                string  l   = "select pid from monthly_tiffin_menu where tiffin_id='" + Session["monthly_tiffin_id"].ToString() + "'";
                ds3 = dc.getdata(l);

                DataSet ds4 = new DataSet();
                string  z   = "select image from monthly_tiffin_menu where tiffin_id='" + Session["monthly_tiffin_id"].ToString() + "'";
                ds4 = dc.getdata(z);

                string p = "insert into trial_tiffin_order values('" + Trial_tiffin_order_id_lbl.Text + "','" + DropDownList1.Text + "','" + Session["monthly_tiffin_id"].ToString() + "','" + ds3.Tables[0].Rows[0][0].ToString() + "','" + Session["uid"].ToString() + "','" + Trial_tiffin_name_lbl.Text + "','" + Trial_tiffin_email_lbl.Text + "','" + Trial_tiffin_time_lbl.Text + "','" + Trial_tiffin_date_lbl.Text + "','" + Trial_tiffin_mobile_tb.Text + "','" + Session["delivery_area"].ToString() + "','" + Trial_tiffin_address_tb.Text + "','" + Trial_tiffin_roti_lbl.Text + "','" + Trial_tiffin_price_lbl.Text + "','" + ds4.Tables[0].Rows[0][0].ToString() + "','Not Delivered')";
                dc.setdata(p);

                Thread email = new Thread(delegate()
                {
                    sendmail_user_dinner();
                    sendmail_provider_dinner();
                    sendmail_admin_dinner();
                });

                email.IsBackground = true;
                email.Start();
                ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Your Order Is Booked.);window.location='Home.aspx';", true);
            }
            else if (in_dinner_time > 0)
            {
                Label11.Text = "You can't book trial tiffin for DINNER after " + ds10.Tables[0].Rows[1][1].ToString() + ".";
                Trial_tiffin_mobile_tb.Text  = "";
                Trial_tiffin_address_tb.Text = "";
                DropDownList1.SelectedIndex  = 0;
                CheckBox1.Checked            = false;
                //ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('You can't book tiffin for DINNER after 04:30 PM');", true);
            }
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (DropDownList1.SelectedIndex != 0)
        {
            if (DropDownList2.SelectedIndex != 0)
            {
                string ext = System.IO.Path.GetExtension(FileUpload1.FileName);

                if (ext == ".jpg" || ext == ".png" || ext == ".jpeg" || ext == ".gif" || ext == ".GIF" || ext == ".PNG" || ext == ".JPEG" || ext == ".JPG")
                {
                    FileUpload1.SaveAs(Server.MapPath("~//admin//simple_tiffin_image//" + FileUpload1.FileName));
                    string path = "~//admin//simple_tiffin_image//" + FileUpload1.FileName;

                    try
                    {
                        if (Std_chk.Checked == true)
                        {
                            std = "1";
                        }
                        else
                        {
                            std = "0";
                        }

                        if (avg_chk.Checked == true)
                        {
                            avg = "1";
                        }
                        else
                        {
                            avg = "0";
                        }

                        if (poor_chk.Checked == true)
                        {
                            poor = "1";
                        }
                        else
                        {
                            poor = "0";
                        }

                        if (Rmd_yes_rb.Checked == true)
                        {
                            string q = "insert into simple_tiffin values('" + TextBox6.Text + "','" + DropDownList1.Text + "','" + DropDownList2.Text + "','" + Label2.Text + "','" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "','" + TextBox7.Text + "','" + TextBox5.Text + "','" + std + "','" + avg + "','" + poor + "','" + TextBox8.Text + "','1','" + path + "','Order Now'," + IsAppHomeChk.Checked + ")";
                            dc.setdata(q);

                            ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('" + TextBox6.Text + "' Simple Tiffin Added');", true);

                            TextBox1.Text               = "";
                            TextBox2.Text               = "";
                            TextBox3.Text               = "";
                            TextBox4.Text               = "";
                            TextBox5.Text               = "";
                            TextBox6.Text               = "";
                            TextBox7.Text               = "";
                            TextBox8.Text               = "";
                            Std_chk.Checked             = false;
                            avg_chk.Checked             = false;
                            poor_chk.Checked            = false;
                            IsAppHomeChk.Checked        = false;
                            DropDownList1.SelectedIndex = 0;
                            DropDownList2.Items.Clear();
                            Label2.Text = "";
                        }
                        else if (Rmd_no_rb.Checked == true)
                        {
                            string q = "insert into simple_tiffin values('" + TextBox6.Text + "','" + DropDownList1.Text + "','" + DropDownList2.Text + "','" + Label2.Text + "','" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "','" + TextBox7.Text + "','" + TextBox5.Text + "','" + std + "','" + avg + "','" + poor + "','" + TextBox8.Text + "','0','" + path + "','Order Now'," + IsAppHomeChk.Checked + ")";
                            dc.setdata(q);

                            ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('" + TextBox6.Text + "' Simple Tiffin Added');", true);

                            TextBox1.Text               = "";
                            TextBox2.Text               = "";
                            TextBox3.Text               = "";
                            TextBox4.Text               = "";
                            TextBox5.Text               = "";
                            TextBox6.Text               = "";
                            TextBox7.Text               = "";
                            TextBox8.Text               = "";
                            Std_chk.Checked             = false;
                            avg_chk.Checked             = false;
                            poor_chk.Checked            = false;
                            IsAppHomeChk.Checked        = false;
                            DropDownList1.SelectedIndex = 0;
                            DropDownList2.Items.Clear();
                            Label2.Text = "";
                        }
                    }
                    catch (Exception ex)
                    {
                        string try_msg = ex.Message;
                        //Label2.Text = try_msg;
                        ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('This Tiffin Id Already Exist.');", true);

                        TextBox6.Text = "";
                        TextBox6.Focus();
                    }
                }
                else
                {
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please select Image Only');", true);
                }
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please select provider');", true);
                //Response.Write("<script>alert('Please select provider')</script>");
            }
        }
        else
        {
            ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please Select City');", true);
            //Response.Write("<script>alert('Please select city')</script>");
        }
    }