protected void Page_Load(object sender, EventArgs e) { if (Convert.ToString(Session["aid"]) == "") { Session["msg"] = "Please Log In First"; Response.Redirect("~/Log_In.aspx"); } else { if (IsPostBack != true) { if (!Request.QueryString.AllKeys.Contains("TiffinId")) { string j = "select pid from providers"; DataSet dsj = new DataSet(); dsj = dc.getdata(j); ProviderIdDD.DataSource = dsj; ProviderIdDD.DataBind(); ProviderIdDD.DataTextField = "pid"; ProviderIdDD.DataBind(); ProviderIdDD.Items.Insert(0, "-- To Select --"); } else { GetTiffinDetails(Request.QueryString["TiffinId"].ToString()); } } } }
protected void Page_Load(object sender, EventArgs e) { if (Convert.ToString(Session["aid"]) == "") { Session["msg"] = "Please Log In First"; Response.Redirect("~/Log_In.aspx"); } else { if (IsPostBack != true) { DataSet ds1 = new DataSet(); string j = "select * from fast_food_categories"; ds1 = dc.getdata(j); Cat_dd.DataSource = ds1; Cat_dd.DataBind(); Cat_dd.DataTextField = "name"; Cat_dd.DataValueField = "cat_id"; Cat_dd.DataBind(); Cat_dd.Items.Insert(0, "--To Select--"); //for (int z = 0; z < ds1.Tables[0].Rows.Count; z++) //{ // DropDownList3.Items.Add(ds1.Tables[0].Rows[z][1].ToString()); //} } } }
protected void Page_Load(object sender, EventArgs e) { if (Convert.ToString(Session["aid"]) == "") { Session["msg"] = "Please Log In First"; Response.Redirect("~/Log_In.aspx"); } else { if (IsPostBack != true) { Panel1.Visible = false; DataSet ds = new DataSet(); string s = "select * from simple_tiffin where t_id='" + Session["stid"].ToString() + "'"; ds = dc.getdata(s); Label1.Text = ds.Tables[0].Rows[0][0].ToString(); LinkButton2.Text = ds.Tables[0].Rows[0][2].ToString(); TextBox1.Text = ds.Tables[0].Rows[0][4].ToString(); TextBox2.Text = ds.Tables[0].Rows[0][5].ToString(); TextBox3.Text = ds.Tables[0].Rows[0][6].ToString(); TextBox4.Text = ds.Tables[0].Rows[0][7].ToString(); TextBox5.Text = ds.Tables[0].Rows[0][9].ToString(); TextBox6.Text = ds.Tables[0].Rows[0][8].ToString(); Image1.ImageUrl = ds.Tables[0].Rows[0][10].ToString(); } } }
protected void Page_Load(object sender, EventArgs e) { if (Convert.ToString(Session["aid"]) == "") { Session["msg"] = "Please Log In First"; Response.Redirect("~/Log_In.aspx"); } else { if (IsPostBack != true) { Button8.Visible = false; DataSet ds = new DataSet(); string s = "select * from city"; ds = dc.getdata(s); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { DropDownList6.Items.Add(ds.Tables[0].Rows[i][0].ToString()); DropDownList9.Items.Add(ds.Tables[0].Rows[i][0].ToString()); } } } }
public List <AdmissionCategory> GetAdminssionCtegory() { List <AdmissionCategory> List = new List <AdmissionCategory>(); string jk = "select * from AdmissionCategory where IsShow=1"; DataSet dsjk = new DataSet(); dsjk = dc.getdata(jk); if (dsjk.Tables[0].Rows.Count != 0) { for (int i = 0; i < dsjk.Tables[0].Rows.Count; i++) { AdmissionCategory admissionCategory = new AdmissionCategory(); admissionCategory.Id = dsjk.Tables[0].Rows[i][0].ToString(); admissionCategory.CategoryName = dsjk.Tables[0].Rows[i][1].ToString(); admissionCategory.Image = "/User/images/appPhoto/a" + dsjk.Tables[0].Rows[i][0].ToString() + ".jpg"; admissionCategory.Status = "Success"; List.Add(admissionCategory); } } else { AdmissionCategory admissionCategory = new AdmissionCategory(); admissionCategory.Status = "NoData"; List.Add(admissionCategory); } return(List); }
private void SetData(string id) { string zk = "select * from admissionform where id='" + id + "'"; DataSet ds = new DataSet(); ds = dc.getdata(zk); string jk = "select Category from admissioncategory where id='" + ds.Tables[0].Rows[0][16].ToString() + "'"; DataSet ds1 = new DataSet(); ds1 = dc.getdata(jk); FNameTb.Text = ds.Tables[0].Rows[0][2].ToString(); MNameTb.Text = ds.Tables[0].Rows[0][3].ToString(); LNameTb.Text = ds.Tables[0].Rows[0][4].ToString(); DOBTb.Text = ds.Tables[0].Rows[0][5].ToString(); GenderTb.Text = ds.Tables[0].Rows[0][6].ToString(); AddressTb.Text = ds.Tables[0].Rows[0][7].ToString(); StateTb.Text = ds.Tables[0].Rows[0][8].ToString(); PINTb.Text = ds.Tables[0].Rows[0][9].ToString(); EmailTb.Text = ds.Tables[0].Rows[0][10].ToString(); FatherNameTb.Text = ds.Tables[0].Rows[0][11].ToString(); MotherNameTb.Text = ds.Tables[0].Rows[0][12].ToString(); StuMobTb.Text = ds.Tables[0].Rows[0][13].ToString(); FaMobileTb.Text = ds.Tables[0].Rows[0][14].ToString(); StuPhoto.ImageUrl = ds.Tables[0].Rows[0][15].ToString(); AdmissionTb.Text = ds1.Tables[0].Rows[0][0].ToString(); TenMarkHl.NavigateUrl = ds.Tables[0].Rows[0][17].ToString(); TwelveMarkHl.NavigateUrl = ds.Tables[0].Rows[0][18].ToString(); }
protected void Page_Load(object sender, EventArgs e) { if (Convert.ToString(Session["pid"]) == "") { Session["msg"] = "Please Log In First"; Response.Redirect("~/Log_in.aspx"); } else { if (IsPostBack != true) { Panel1.Visible = false; Panel2.Visible = false; DataSet ds = new DataSet(); string s = "select pid,name,city,mob_no,e_id,address from providers where pid='" + Session["pid"].ToString() + "'"; ds = dc.getdata(s); //Label1.Text = ds.Tables[0].Rows[0][0].ToString(); TextBox1.Text = ds.Tables[0].Rows[0][1].ToString(); Label2.Text = ds.Tables[0].Rows[0][2].ToString(); TextBox2.Text = ds.Tables[0].Rows[0][3].ToString(); Label1.Text = ds.Tables[0].Rows[0][4].ToString(); TextBox4.Text = ds.Tables[0].Rows[0][5].ToString(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string zk = "select * from gallery where IsShow=1"; DataSet ds = new DataSet(); ds = dc.getdata(zk); GalleryRptr.DataSource = ds; GalleryRptr.DataBind(); DataSet ds3 = new DataSet(); string zkp = "select * from admissioncategory where IsShow=1"; ds3 = dc.getdata(zkp); AdmissionCategoryRptr.DataSource = ds3; AdmissionCategoryRptr.DataBind(); DataSet ds1 = new DataSet(); string jk = "select * from joboffercategory where IsShow=1"; ds1 = dc.getdata(jk); JobOfferCategoryRptr.DataSource = ds1; JobOfferCategoryRptr.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (Convert.ToString(Session["aid"]) == "") { Session["msg"] = "Please Log In First"; Response.Redirect("~/Log_In.aspx"); } else { string zk = "select DISTINCT order_id,date,time,del_city,del_area from fast_food_orders where date='" + current_time.ToLongDateString() + "' and time<='" + current_time.ToLongTimeString() + "' and read_order = 0 and delivered = 0 and cancelled = 0"; //string zk = "select DISTINCT order_id,date,time,del_city,del_area from fast_food_orders where date='" + current_time.ToLongDateString() + "' and time<='" + current_time.ToLongTimeString() + "'"; DataSet ds = new DataSet(); ds = dc.getdata(zk); if (ds.Tables[0].Rows.Count != 0) { no_of_order_lbl.Text = ds.Tables[0].Rows.Count.ToString(); } else { no_of_order_lbl.Text = "0"; } string jk = "select * from SpecialTiffinOrder where BookDate='" + current_time.ToLongDateString() + "' and BookTime<='" + current_time.ToLongTimeString() + "' and IsRead = 0 and IsDelivered = 0 and IsCancelled = 0"; DataSet dsjk = dc.getdata(jk); if (dsjk.Tables[0].Rows.Count == 0) { SPTNoOfOdr.Text = "0"; } else { SPTNoOfOdr.Text = dsjk.Tables[0].Rows.Count.ToString(); } } }
protected void CityDD_SelectedIndexChanged(object sender, EventArgs e) { DataSet ds1 = new DataSet(); AreaDD.Items.Clear(); SpecialTiffinRptr.DataSource = ""; SpecialTiffinRptr.DataBind(); InfoLbl.Text = ""; if (CityDD.SelectedIndex == 0) { AreaDD.Items.Clear(); SpecialTiffinRptr.DataSource = ""; SpecialTiffinRptr.DataBind(); InfoLbl.Text = ""; } else { string s = "select area from delivery_area where city='" + CityDD.Text + "'"; ds1 = dc.getdata(s); AreaDD.DataSource = ds1; AreaDD.DataTextField = "area"; AreaDD.DataBind(); AreaDD.Items.Insert(0, "--To Select--"); } }
protected void Page_Load(object sender, EventArgs e) { if (Convert.ToString(Session["aid"]) == "") { Session["msg"] = "Please Log In First"; Response.Redirect("~/Log_In.aspx"); } else { if (IsPostBack != true) { Panel1.Visible = false; DataSet ds = new DataSet(); string s = "select * from monthly_tiffin_menu where tiffin_id='" + Session["monthly_tiffin_id"].ToString() + "'"; ds = dc.getdata(s); Label1.Text = ds.Tables[0].Rows[0][0].ToString(); LinkButton2.Text = ds.Tables[0].Rows[0][2].ToString(); No_of_roti_tb.Text = ds.Tables[0].Rows[0][1].ToString(); Price_tb.Text = ds.Tables[0].Rows[0][4].ToString(); Trial_price_tb.Text = ds.Tables[0].Rows[0][5].ToString(); Image1.ImageUrl = ds.Tables[0].Rows[0][6].ToString(); } } }
protected void Page_Load(object sender, EventArgs e) { //if (Convert.ToString(Session["uid"]) == "") //{ // Session["msg"] = "Please Log In First"; // Response.Redirect("~/Log_in.aspx"); //} if (IsPostBack != true) { DataSet ds = new DataSet(); string jk = "select time from order_timmings"; ds = dc.getdata(jk); Lunch_time_lbl.Text = ds.Tables[0].Rows[0][0].ToString(); Dinner_time_lbl.Text = ds.Tables[0].Rows[1][0].ToString(); #region Fast Food Order Timmings Get DataSet ds10 = new DataSet(); string ffot = "select * from ff_order_timmings"; ds10 = dc.getdata(ffot); StartFFTimeLbl.Text = ds10.Tables[0].Rows[0][1].ToString(); EndFFTimeLbl.Text = ds10.Tables[0].Rows[0][2].ToString(); #endregion Fast Food Order Timmings Get } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string id = Request.QueryString["id"].ToString(); string zk = "select * from admissioncategory where id=" + id; DataSet ds = new DataSet(); ds = dc.getdata(zk); AdmissionCatLbl.Text = ds.Tables[0].Rows[0][1].ToString(); GetDataItem(id); } }
protected void Page_Load(object sender, EventArgs e) { #region Delivery Charges Get string jkp = "select * from delivery_charges"; DataSet dsCharge = new DataSet(); dsCharge = dc.getdata(jkp); charge_limit = Convert.ToInt32(dsCharge.Tables[0].Rows[0][1].ToString()); del_charge = Convert.ToInt32(dsCharge.Tables[0].Rows[0][2].ToString()); #endregion Delivery Charges Get //#region Fast Food Order Timmings Get //string ot = "select * from ff_order_timmings"; //ds10 = dc.getdata(ot); //start_time = Convert.ToDateTime(ds10.Tables[0].Rows[0][1].ToString()); //end_time = Convert.ToDateTime(ds10.Tables[0].Rows[0][2].ToString()); //#endregion Fast Food Order Timmings Get if (IsPostBack != true) { order_details_pnl.Visible = false; Session["tiffin_type"] = ""; if (Convert.ToString(Session["tiffin_type"]) == "") { empty_cart_lbl.Visible = false; add_item_in_list(); //ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please Check Your Quntity');", true); } else { order_details_pnl.Visible = true; checkout_btn.Visible = false; fil_order_details(); add_item_in_list(); ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please Check Your Quntity');", true); } //if (Cache["productId"] != null) //{ // List<int> zk = ((List<int>)Cache["productId"]); // if (zk.Count != 0 || zk != null) // { // for (int i = 0; i < zk.Count; i++) // { // string jk = "select * from fast_food_products where product_id=" + zk[i]; // DataSet ds1 = new DataSet(); // ds1 = dc.getdata(jk); // list.Add(new Cart { product_name = ds1.Tables[0].Rows[0][4].ToString(), price = ds1.Tables[0].Rows[0][6].ToString(), image = ds1.Tables[0].Rows[0][8].ToString(), product_id = ds1.Tables[0].Rows[0][0].ToString() }); // } // cart_rptr.DataSource = list; // cart_rptr.DataBind(); // } //} } }
protected void Button1_Click(object sender, EventArgs e) { if (DropDownList1.SelectedIndex == 0) { ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('Please Select Order For Lunch Or Dinner Or Both');", true); } else { DataSet ds6 = new DataSet(); string b = "select * from monthly_order where ((start_date <='" + current_time.ToString("dd/MM/yyyy") + "' and finish_date>= '" + current_time.ToString("dd/MM/yyyy") + "') and book_for='" + DropDownList1.SelectedItem + "' and pid='" + Convert.ToString(Session["pid"]) + "')"; ds6 = dc.getdata(b); if (ds6.Tables[0].Rows.Count == 0) { Label1.Text = "No Monthly Base Order For " + DropDownList1.SelectedItem + " Today"; GridView1.DataSource = ""; GridView1.DataBind(); } else { Label1.Text = "Monthly Base Order For " + DropDownList1.SelectedItem + " Today Are Showing Below"; GridView1.DataSource = ds6; GridView1.DataBind(); } } }
protected void Page_Load(object sender, EventArgs e) { if (Convert.ToString(Session["uid"]) == "") { Session["msg"] = "Please Log In First"; Response.Redirect("~/Log_in.aspx"); } else { if (IsPostBack != true) { DataSet ds = new DataSet(); string s = "select * from simple_tiffin_daily_order where uid='" + Session["uid"].ToString() + "'"; //+ "' and date='" + DateTime.Now.ToLongDateString() + "'"; ds = dc.getdata(s); if (ds.Tables[0].Rows.Count != 0) { Label1.Text = "You Booked Simple Tiffin From Tiffin Dabba As Details Are Given Below"; Repeater1.DataSource = ds; Repeater1.DataBind(); } else { Label1.Text = "You Did Not Book Simple Tiffin From Tiffin Dabba."; Repeater1.DataSource = ""; Repeater1.DataBind(); } } } }
protected void Page_Load(object sender, EventArgs e) { if (Convert.ToString(Session["uid"]) == "") { Session["msg"] = "Please Log In First"; Response.Redirect("~/Log_in.aspx"); } else { if (IsPostBack != true) { //Panel1.Visible = true; DataSet ds = new DataSet(); string s = "select id,name,address,mob_no,eid from user_accounts where id='" + Session["uid"].ToString() + "'"; ds = dc.getdata(s); //Label3.Height = 50; //Label3.Width = 100; // Label1.Text = ds.Tables[0].Rows[0][0].ToString(); Label2.Text = ds.Tables[0].Rows[0][1].ToString(); Label3.Text = ds.Tables[0].Rows[0][2].ToString(); Label4.Text = ds.Tables[0].Rows[0][3].ToString(); Label5.Text = ds.Tables[0].Rows[0][4].ToString(); Label6.Text = "Welcome:- " + ds.Tables[0].Rows[0][1].ToString(); } } }
protected void Page_Load(object sender, EventArgs e) { if (Convert.ToString(Session["aid"]) == "") { Session["msg"] = "Please Log In First"; Response.Redirect("~/Log_In.aspx"); } else { if (IsPostBack != true) { DataSet ds = new DataSet(); string s = "select * from user_accounts where id='" + Session["uid"].ToString() + "'"; ds = dc.getdata(s); Label1.Text = ds.Tables[0].Rows[0][0].ToString(); Label2.Text = ds.Tables[0].Rows[0][1].ToString(); Label3.Text = ds.Tables[0].Rows[0][2].ToString(); Label4.Text = ds.Tables[0].Rows[0][3].ToString(); Label5.Text = ds.Tables[0].Rows[0][4].ToString(); Label6.Text = ds.Tables[0].Rows[0][5].ToString(); Label7.Text = ds.Tables[0].Rows[0][6].ToString(); } } }
protected void Page_Load(object sender, EventArgs e) { if (Convert.ToString(Session["pid"]) == "") { Session["msg"] = "Please Log In First"; Response.Redirect("~/Log_in.aspx"); } else { if (IsPostBack != true) { DataSet ds = new DataSet(); string s = "select * from simple_tiffin where p_id='" + Session["pid"].ToString() + "'"; ds = dc.getdata(s); if (ds.Tables[0].Rows.Count != 0) { GridView1.DataSource = ds; GridView1.DataBind(); } else { GridView1.DataSource = ""; GridView1.DataBind(); ScriptManager.RegisterClientScriptBlock(this.Page, this.Page.GetType(), "alert", "alert('You have no Simple Tiffin');", true); //Response.Write("<script>alert('You have no Simple Tiffin')</script>"); } } } }
protected void Page_Load(object sender, EventArgs e) { if (Convert.ToString(Session["uid"]) == "") { Session["msg"] = "Please Log In First"; Response.Redirect("~/Log_in.aspx"); } else { if (IsPostBack != true) { DataSet ds = new DataSet(); string s = "select SpecialTiffinOrder.OrderId,SpecialTiffinOrder.UserId,SpecialTiffinOrder.DelCity,SpecialTiffinOrder.DelArea,SpecialTiffinOrder.DelAddress,SpecialTiffinOrder.BookDate,SpecialTiffinOrder.BookTime,SpecialTiffinOrder.IsRead,SpecialTiffinOrder.IsDelivered,SpecialTiffinOrder.IsCancelled,SpecialTiffin.TiffinName,SpecialTiffin.Description,SpecialTiffin.ProviderId,SpecialTiffin.Image,SpecialTiffin.Price from SpecialTiffinOrder JOIN SpecialTiffin ON SpecialTiffinOrder.TiffinId=SpecialTiffin.TiffinId where SpecialTiffinOrder.UserId='" + Convert.ToString(Session["uid"]) + "'"; ds = dc.getdata(s); if (ds.Tables[0].Rows.Count != 0) { InfoLbl.Text = "You Booked Special Tiffin From Tiffin Dabba As Details Are Given Below"; SpecialTiffinOdrHisRptr.DataSource = ds; SpecialTiffinOdrHisRptr.DataBind(); } else { InfoLbl.Text = "You Did Not Book Special Tiffin From Tiffin Dabba."; SpecialTiffinOdrHisRptr.DataSource = ""; SpecialTiffinOdrHisRptr.DataBind(); } } } }
protected void Page_Load(object sender, EventArgs e) { if (Convert.ToString(Session["aid"]) == "") { Session["msg"] = "Please Log In First"; Response.Redirect("~/Log_In.aspx"); } else { string zk = "select DISTINCT order_id,date,time,del_city,del_area from fast_food_orders where date='" + current_time.ToLongDateString() + "' and cancelled = 1"; //string zk = "select DISTINCT order_id,date,time,del_city,del_area from fast_food_orders where date='" + current_time.ToLongDateString() + "' and time<='" + current_time.ToLongTimeString() + "' and read_order = 1"; //string zk = "select DISTINCT order_id,date,time,del_city,del_area from fast_food_orders where date='" + current_time.ToLongDateString() + "' and time<='" + current_time.ToLongTimeString() + "'"; DataSet ds = new DataSet(); ds = dc.getdata(zk); if (ds.Tables[0].Rows.Count != 0) { new_ff_order_gv.DataSource = ds; new_ff_order_gv.DataBind(); } else { new_ff_order_gv.DataSource = ""; new_ff_order_gv.DataBind(); no_order_lbl.Text = "No Cancelled Orders Of Today"; } } }
protected void Page_Load(object sender, EventArgs e) { if (Convert.ToString(Session["aid"]) == "") { Session["msg"] = "Please Log In First"; Response.Redirect("~/Log_In.aspx"); } else { if (IsPostBack != true) { DataSet ds = new DataSet(); string jk = "select * from monthly_order where order_id='" + Convert.ToString(Session["monthly_order_id"]) + "'"; ds = dc.getdata(jk); Caption_lbl.Text = "Full Details Of Monthly Base Order Id:- " + ds.Tables[0].Rows[0][0].ToString(); Order_id_lbl.Text = ds.Tables[0].Rows[0][0].ToString(); Book_for_lbl.Text = ds.Tables[0].Rows[0][1].ToString(); Tiffin_id_lbl.Text = ds.Tables[0].Rows[0][2].ToString(); Provider_id_lb.Text = ds.Tables[0].Rows[0][3].ToString(); User_id_lb.Text = ds.Tables[0].Rows[0][4].ToString(); Uname_lbl.Text = ds.Tables[0].Rows[0][5].ToString(); Ueid_lbl.Text = ds.Tables[0].Rows[0][6].ToString(); Mobile_no_lbl.Text = ds.Tables[0].Rows[0][7].ToString(); Delivery_area_lbl.Text = ds.Tables[0].Rows[0][8].ToString(); Delivery_address_lbl.Text = ds.Tables[0].Rows[0][9].ToString(); Booking_date_lbl.Text = ds.Tables[0].Rows[0][10].ToString(); No_of_days_lbl.Text = ds.Tables[0].Rows[0][11].ToString(); Start_date_lbl.Text = ds.Tables[0].Rows[0][12].ToString(); Finish_date_lbl.Text = ds.Tables[0].Rows[0][13].ToString(); No_of_roti_lbl.Text = ds.Tables[0].Rows[0][14].ToString(); Price_lbl.Text = ds.Tables[0].Rows[0][15].ToString(); } } }
protected void EditCategory_Click(object sender, CommandEventArgs e) { string id = e.CommandArgument.ToString(); string zkp = "select * from admissioncategory where id='" + id + "'"; DataSet ds3 = new DataSet(); ds3 = dc.getdata(zkp); if (ds3.Tables[0].Rows.Count != 0) { NameTb.Text = ds3.Tables[0].Rows[0][1].ToString(); IsShowChk.Checked = Convert.ToBoolean(ds3.Tables[0].Rows[0][2].ToString()); CatIdLbl.Text = id; ActionLbl.Text = "Update"; } }
protected void Page_Load(object sender, EventArgs e) { string ot = "select * from order_timmings"; ds = dc.getdata(ot); Lunch_time_lbl.Text = ds.Tables[0].Rows[0][1].ToString() + "."; Dinner_time_lbl.Text = ds.Tables[0].Rows[1][1].ToString() + "."; }
public string GetNoOfAdmInq() { DataCon dc = new DataCon(); string zk = "select * from admissionform where RegistarionDate='" + current_time.ToShortDateString() + "' and IsAnswered=0"; DataSet ds = new DataSet(); ds = dc.getdata(zk); return(ds.Tables[0].Rows.Count.ToString()); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack == true) { DataSet ds1 = new DataSet(); string j = "select * from admissioncategory where IsShow=1"; ds1 = dc.getdata(j); AdmissionDD.DataSource = ds1; AdmissionDD.DataBind(); AdmissionDD.DataTextField = "Category"; AdmissionDD.DataValueField = "Id"; AdmissionDD.DataBind(); AdmissionDD.Items.Insert(0, "--To Select--"); GetInquiryData(); } }
public string GetNoOfInq() { DataCon dc = new DataCon(); string zk = "select * from inquiry where InquiryDate='" + current_time.ToShortDateString() + "' and IsAnswered=0"; DataSet ds = new DataSet(); ds = dc.getdata(zk); return(ds.Tables[0].Rows.Count.ToString()); }
protected void Page_Load(object sender, EventArgs e) { if (Convert.ToString(Session["aid"]) == "") { Session["msg"] = "Please Log In First"; Response.Redirect("~/Log_In.aspx"); } else { if (IsPostBack != true) { //DataSet ds3 = new DataSet(); //string ui = "select t_id from simple_tiffin order by t_id DESC"; //ds3 = dc.getdata(ui); //if (ds3.Tables[0].Rows.Count == 0) //{ // tid = "ST1"; //} //else //{ // String s = ds3.Tables[0].Rows[0][0].ToString(); // string t = s.Substring(2, s.Length - 2); // int n = Convert.ToInt32(t); // n = n + 1; // tid = "ST" + n.ToString(); //} //Label1.Text = tid; DataSet ds = new DataSet(); string p = "select city from city"; ds = dc.getdata(p); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { DropDownList1.Items.Add(ds.Tables[0].Rows[i][0].ToString()); } } } }
private void BindData() { string jk = "select * from SpecialTiffin"; DataSet dsjk = new DataSet(); dsjk = dc.getdata(jk); SpecialTiffinGv.DataSource = dsjk; SpecialTiffinGv.DataBind(); }
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); } } }