public DataTable Get_GST_DC_TotAmt_onID(int ID) { DataTable table = null; try { // get a configured DbCommand object DbCommand comm = DBLayer.CreateCommand(); // set the stored procedure name comm.CommandText = "USP_GetDCTotAmtonID"; DbParameter param = comm.CreateParameter(); param.ParameterName = "@ID"; param.Value = ID; param.DbType = DbType.Int32; comm.Parameters.Add(param); // execute the stored procedure and save the results in a DataTable table = DBLayer.ExecuteSelectCommand(comm); return(table); } finally { table.Dispose(); } }
//get cust state public static DataTable get_cust_state(int id) { SqlCommand cmd = new SqlCommand("select s.Name from Users.Customers c, Users.User_state s where c.state = s.Id and c.id =@id "); cmd.Parameters.AddWithValue("@id", id); return(DBLayer.select(cmd)); }
public static DataTable get_reversecharges(int supplerid) { DataTable table = null; try { // get a configured DbCommand object DbCommand comm = DBLayer.CreateCommand(); // set the stored procedure name comm.CommandText = "getting_Reversecharges"; // create a new parameter DbParameter param = comm.CreateParameter(); param.ParameterName = "@Supplier_Id"; param.Value = supplerid; param.DbType = DbType.Int32; comm.Parameters.Add(param); // execute the stored procedure and save the results in a DataTable table = DBLayer.ExecuteSelectCommand(comm); return(table); } finally { table.Dispose(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Session["CurrentUser"] == null) { Response.Redirect("Login.aspx"); } if (CurrentPage != 0) { //BindData(); DBLayer db = new DBLayer(); DataSet ds = new DataSet(); ds = db.GetPageContent(CurrentPage); if (ds.Tables[0].Rows.Count > 0) { uiTextBoxTitle.Text = ds.Tables[0].Rows[0]["arTitle"].ToString(); uiFCKeditorContent.Value = Server.HtmlDecode(ds.Tables[0].Rows[0]["arContent"].ToString()); } uiPanelCurrentPages.Visible = false; uiPanelCurrent.Visible = true; } else { Response.Redirect("AdminCP.aspx"); } } }
private void BindData() { DBLayer db = new DBLayer(); if (!string.IsNullOrEmpty(uiDropDownListCats.SelectedValue)) uiDataListPhotos.DataSource = db.GetAllProductByCatID(Convert.ToInt32(uiDropDownListCats.SelectedValue)); uiDataListPhotos.DataBind(); }
// procerss public static DataTable getpassword(int id) { SqlCommand cmd = new SqlCommand("select u.password from Users.Users u , Users.Customers c where u.Id = c.userid and c.Id=@id "); cmd.Parameters.AddWithValue("@id", id); return(DBLayer.select(cmd)); }
//serch by name public static DataTable getByName(string name) { SqlCommand cmd = new SqlCommand("select * from users.Customers where firts_name=@name"); cmd.Parameters.AddWithValue("@name", name); return(DBLayer.select(cmd)); }
//serch by id public static DataTable getById(int id) { SqlCommand cmd = new SqlCommand("select * from users.Customers where id=@id"); cmd.Parameters.AddWithValue("@id", id); return(DBLayer.select(cmd)); }
// udpdate state from customre public static int ChangeCustState(int id) { SqlCommand cmd = new SqlCommand("update Users.Customers set state =1 where id =@id"); cmd.Parameters.AddWithValue("@id", id); return(DBLayer.dml(cmd)); }
// public static int add(string username, string fname, string lname, string email, string id_image, string location, string delivery_address, string password) { //check for userName unique SqlCommand cmd = new SqlCommand("insert into Users.Users values(@username,@password,1)"); cmd.Parameters.AddWithValue("@username", username); cmd.Parameters.AddWithValue("@password", password); if (DBLayer.dml(cmd) == 1) { //get id SqlCommand cmdGetId = new SqlCommand("select id from Users.Users where user_name=@username"); cmdGetId.Parameters.AddWithValue("@username", username); DataTable result = DBLayer.select(cmdGetId); int user_id = int.Parse(result.Rows[0]["id"].ToString()); // 1 for user state deactive SqlCommand cmdInserToCust = new SqlCommand("insert into Users.Customers values(@userid,@fname,@lname,@email,@idimage,@location,@delivery,1)"); cmdInserToCust.Parameters.AddWithValue("@userid", user_id); cmdInserToCust.Parameters.AddWithValue("@fname", fname); cmdInserToCust.Parameters.AddWithValue("@lname", lname); cmdInserToCust.Parameters.AddWithValue("@email", email); cmdInserToCust.Parameters.AddWithValue("@idimage", id_image); cmdInserToCust.Parameters.AddWithValue("@location", location); cmdInserToCust.Parameters.AddWithValue("@delivery", delivery_address); return(DBLayer.dml(cmdInserToCust)); } else { throw new Exception("user name is token try diff one "); // return -1 } }
public int UpdateFields(int fieldId) { int successStatusCode = 0; DBLayer dbLayerUpdateFieldTable = new DBLayer(); successStatusCode = dbLayerUpdateFieldTable.GetUpdateFieldTable(fieldId); return successStatusCode; }
// get delivery address public static DataTable get_cust_delivery_address(int id) { SqlCommand cmd = new SqlCommand("select delivery_address from users.Customers where id=@id"); cmd.Parameters.AddWithValue("@id", id); return(DBLayer.select(cmd)); }
//get id from user id public static DataTable get_id(int userid) { SqlCommand cmd = new SqlCommand("select id from Users.Customers where userid = @userid"); cmd.Parameters.AddWithValue("@userid", userid); return(DBLayer.select(cmd)); }
public static int last_add_item() { SqlCommand cmd = new SqlCommand("select SCOPE_IDENTITY()"); DataTable temp = DBLayer.select(cmd); return(int.Parse(temp.Rows[0][0].ToString())); }
public void ShowGames() { DataTable dtable = new DataTable(); dtable = DBLayer.RefreshTable(@"SELECT GameID,GameName as'اسم التدريب' FROM Games"); dataGridView1.DataSource = dtable; }
public static DataTable get_seller_order_state(int seller_id) { SqlCommand cmd = new SqlCommand("select * from[Orders].[Order_Status] oo, [Orders].[Order] o where oo.id = o.order_status and o.cust_id = @seller_id"); cmd.Parameters.AddWithValue("seller_id", seller_id); return(DBLayer.select(cmd)); }
protected void uiGridViewNews_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Editmails") { int id = Convert.ToInt32(e.CommandArgument.ToString()); CurrentMail = id; DBLayer db = new DBLayer(); DataSet ds = new DataSet(); ds = db.GetNewsContent(id); if (ds.Tables[0].Rows.Count > 0) { uiTextBoxTitle.Text = ds.Tables[0].Rows[0]["Email"].ToString(); uiTextBoxPosition.Text = ds.Tables[0].Rows[0]["Position"].ToString(); } uiPanelCurrentNews.Visible = false; uiPanelCurrent.Visible = true; } else if (e.CommandName == "Deletemails") { DBLayer db = new DBLayer(); db.DeleteBookingMails(Convert.ToInt32(e.CommandArgument.ToString())); BindData(); uiPanelCurrentNews.Visible = true; uiPanelCurrent.Visible = false; } }
public static DataTable get_order(int order_id) { SqlCommand cmd = new SqlCommand("select * from [Orders].[Order] where id=@id"); cmd.Parameters.AddWithValue("@id", order_id); return(DBLayer.select(cmd)); }
public static DataTable get_customer_orders(int cust_id) { SqlCommand cmd = new SqlCommand("select o.id, s.name order_status, order_date from[Orders].[Order] o,[Orders].[Order_Status] s where cust_id = @cust_id and o.order_status = s.id"); cmd.Parameters.AddWithValue("@cust_id", cust_id); return(DBLayer.select(cmd)); }
public static DataTable get_Shop_orders(int shop_id) { SqlCommand cmd = new SqlCommand("select o.* from [Orders].[Order] o , Orders.Order_Products op ,Shop.stock s where o.id = op.order_id and op.Product_id = s.product_id and and shop_id = @shop_id"); cmd.Parameters.AddWithValue("@shop_id", shop_id); return(DBLayer.select(cmd)); }
// get id by email for reset password public static DataTable getByEmail(string email) { SqlCommand cmd = new SqlCommand("select id from users.Customers where email=@email"); cmd.Parameters.AddWithValue("@email", email); return(DBLayer.select(cmd)); }
protected void Page_Load(object sender, EventArgs e) { DBLayer dblayer = new DBLayer(); dblayer.CreateConnectionString(Server.MapPath(".")); String LoginKey = Request["LoginKey"]; String CMailBoxInstallID = Request["CMailBoxInstallID"]; if ((LoginKey != null) && (LoginKey == "xezp3avnniqyjf45wso0ot45")) { if ((CMailBoxInstallID != null) && (CMailBoxInstallID != "")) { CMailBox cMailBox = dblayer.GetCMailBox(CMailBoxInstallID); Response.Write(dblayer.ErrorList); if (cMailBox != null) { Response.Write(cMailBox.CommercialUse ? "OK" : "Cancel"); } else { Response.Write("Cancel"); } } } }
protected void uiGridViewContacts_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EditContact") { DBLayer db = new DBLayer(); CurrentContact = Convert.ToInt32(e.CommandArgument); DataSet ds = db.GetContactContent(CurrentContact); uiTextBoxTitle.Text = ds.Tables[0].Rows[0]["Title"].ToString(); uiTextBoxLatitude.Text = ds.Tables[0].Rows[0]["Latitude"].ToString(); uiTextBoxLongitude.Text = ds.Tables[0].Rows[0]["Longitude"].ToString(); uiTextBoxContent.Text = Server.HtmlDecode(ds.Tables[0].Rows[0]["Content"].ToString()); uiTextBoxMail.Text = ds.Tables[0].Rows[0]["email"].ToString(); uiPanelViewContact.Visible = false; uiPanelEdit.Visible = true; } else if (e.CommandName == "DeleteContact") { DBLayer db = new DBLayer(); db.DeleteContact(Convert.ToInt32(e.CommandArgument)); CurrentContact = 0; BindData(); } }
public int INSERT_SO_Details_Modified_Rejected_SO_Details(DataTable SalesSum, DataTable SalesDet, String ADID, DataTable SalesTax, string BillingAddress, string ShippingAddress, string TermsOfDelivery, string SONum) { int Result; SqlCommand command = DBLayer.CreateSqlCommand(); command.CommandText = "USP_INSERT_SO_Details_Modified_Rejected_SO_Details"; command.CommandType = CommandType.StoredProcedure; command.Parameters.AddWithValue("@Salse_Summary", SalesSum); command.Parameters["@Salse_Summary"].TypeName = "Salse_Summary"; command.Parameters.AddWithValue("@Sales_Details", SalesDet); command.Parameters["@Sales_Details"].TypeName = "Sales_Details_New"; command.Parameters.AddWithValue("@IDListString", ADID); command.Parameters.AddWithValue("@Sales_Tax", SalesTax); command.Parameters["@Sales_Tax"].TypeName = "Sales_Tax"; command.Parameters.AddWithValue("@BillingAddress", BillingAddress); command.Parameters.AddWithValue("@ShippingAddress", ShippingAddress); command.Parameters.AddWithValue("@TermsOfDelivery", TermsOfDelivery); command.Parameters.AddWithValue("@SO_Number", SONum); Result = DBLayer.ExecuteNonQuery(command); return(Result); }
protected void uiGridViewBlocks_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EditBlock") { int id = Convert.ToInt32(e.CommandArgument.ToString()); CurrentBlock = id; DBLayer db = new DBLayer(); DataSet ds = new DataSet(); ds = db.GetBlockContent(id); if (ds.Tables[0].Rows.Count > 0) { uiTextBoxTitle.Text = ds.Tables[0].Rows[0]["Title"].ToString(); uiFCKeditor.Value = Server.HtmlDecode(ds.Tables[0].Rows[0]["Brief"].ToString()); if (!string.IsNullOrEmpty(ds.Tables[0].Rows[0]["Imagepath"].ToString())) { uiImageCurrent.ImageUrl = ds.Tables[0].Rows[0]["Imagepath"].ToString(); uiImageCurrent.Visible = true; } else { uiImageCurrent.Visible = false; } } uiPanelCurrentBlocks.Visible = false; uiPanelCurrent.Visible = true; } }
private void btnEdit_Click(object sender, RoutedEventArgs e) { DBLayer connectLayer = new DBLayer(); dgChanges.DataContext = null; dgChanges.DataContext = connectLayer.updateRows(); }
public static DataTable getCustomerOrders(int customer_id) { SqlCommand cmd = new SqlCommand("select * from [Orders].Order where cust_id= @customer_id"); cmd.Parameters.AddWithValue("@customer_id", customer_id); return(DBLayer.select(cmd)); }
//serch by location public static DataTable getByLocation(string location) { SqlCommand cmd = new SqlCommand("select * from users.Customers where location like '%@location%'"); cmd.Parameters.AddWithValue("@location", location); return(DBLayer.select(cmd)); }
protected void uiGridViewCats_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EditCat") { int id = Convert.ToInt32(e.CommandArgument.ToString()); CurrentCat = id; DBLayer db = new DBLayer(); DataSet ds = new DataSet(); ds = db.GetCategoryContent(id); if (ds.Tables[0].Rows.Count > 0) { uiTextBoxTitle.Text = ds.Tables[0].Rows[0]["CategoryName"].ToString(); uiTextBoxArTitle.Text = ds.Tables[0].Rows[0]["CategoryArName"].ToString(); } uiPanelCurrentPages.Visible = false; uiPanelCurrent.Visible = true; } else if (e.CommandName == "DeleteCat") { int id = Convert.ToInt32(e.CommandArgument.ToString()); CurrentCat = id; DBLayer db = new DBLayer(); db.DeleteCategory(id); BindData(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["SID"] != null && !string.IsNullOrEmpty(Request.QueryString["SID"])) { uiPanelAllServices.Visible = false; uiPanelViewService.Visible = true; int id = Convert.ToInt32(Request.QueryString["SID"].ToString()); DBLayer db = new DBLayer(); DataSet ds = new DataSet(); ds = db.GetServicesContent(id); uiImageService.ImageUrl = ds.Tables[0].Rows[0]["arImagePath"].ToString(); uiLabelTitle.Text = ds.Tables[0].Rows[0]["arTitle"].ToString(); uiLiteralBrief.Text = ds.Tables[0].Rows[0]["arBrief"].ToString(); uiLiteralContent.Text = Server.HtmlDecode(ds.Tables[0].Rows[0]["arContent"].ToString()); } else { uiPanelAllServices.Visible = true; uiPanelViewService.Visible = false; BindData(); } } RegisterStartupScript("menu", "<script type='text/javascript'>$(\"#m4\").addClass(\"selected\");</script>"); }
protected void uiLinkButtonUpdate_Click(object sender, EventArgs e) { DBLayer db = new DBLayer(); string imagepath = ""; if (uiFileUploadImage.HasFile) { uiFileUploadImage.SaveAs(Server.MapPath(ConfigurationManager.AppSettings["UserFilePath"] + "UploadedImages/" + uiFileUploadImage.FileName)); imagepath = ConfigurationManager.AppSettings["UserFilePath"] + "UploadedImages/" + uiFileUploadImage.FileName; } // update if (CurrentPackage != 0) { DataSet ds = new DataSet(); ds = db.GetPackageContent(CurrentPackage); string temp = ds.Tables[0].Rows[0]["arImagepath"].ToString(); if (temp != imagepath && string.IsNullOrEmpty(imagepath)) db.SetArabicPackageContent(CurrentPackage, uiTextBoxBrief.Text, Server.HtmlEncode(uiFCKeditorContent.Value), uiTextBoxTitle.Text, temp, Convert.ToInt32(uiTextBoxOrder.Text)); else db.SetArabicPackageContent(CurrentPackage, uiTextBoxBrief.Text, Server.HtmlEncode(uiFCKeditorContent.Value), uiTextBoxTitle.Text, imagepath, Convert.ToInt32(uiTextBoxOrder.Text)); } else // add new { db.AddArabicPackageContent(uiTextBoxBrief.Text, Server.HtmlEncode(uiFCKeditorContent.Value), uiTextBoxTitle.Text, imagepath, Convert.ToInt32(uiTextBoxOrder.Text)); } uiPanelViewPackages.Visible = true; uiPanelEditPackage.Visible = false; ClearFields(); CurrentPackage = 0; BindData(); }
public ActionResult CreateAccount(UserView model) { // this checks the models state if (!ModelState.IsValid) { return(View("CreateAccount", model)); } // this checks if the password matchs if (!model.Password.Equals(model.ConfrimPassword)) { ModelState.AddModelError("", "Passwords do not match."); return(View("CreateAccount", model)); } using (DBLayer db = new DBLayer()) { // thsi is used to make uure the username is unique if (db.Users.Any(x => x.Username.Equals(model.Username))) { ModelState.AddModelError("", "Username " + model.Username + " is taken."); model.Username = ""; return(View("CreateAccount", model)); } // Create userDTO UserDTO userDTO = new UserDTO() { Firstname = model.Firstname, Lastname = model.Lastname, EmailAddress = model.EmailAddress, Username = model.Username, Password = model.Password }; // Add the DTO db.Users.Add(userDTO); // Save db.SaveChanges(); // Add to UserRolesDTO int id = userDTO.Id; UserRoleDTO userRolesDTO = new UserRoleDTO() { UserId = id, RoleId = 2 }; db.UserRole.Add(userRolesDTO); db.SaveChanges(); } // Create a TempData message TempData["SM"] = "You are now registered and can login."; // Redirect return(Redirect("~/account/login")); }
protected void Page_Load(object sender, EventArgs e) { DBLayer dblayer = new DBLayer(); dblayer.CreateConnectionString(Server.MapPath(".")); String MAC = Request["P1"]; String EMail = Request["P2"]; String VAT = Request["P3"]; if ((MAC != null) && (MAC != "")) { if ((EMail != null) && (EMail != "")) { if ((VAT != null) && (VAT != "")) { MAC = DecodeFrom64(MAC); EMail = DecodeFrom64(EMail); VAT = DecodeFrom64(VAT); Company company = dblayer.GetCompanyByKey(EMail, MAC, VAT); //Response.Write(dblayer.ErrorList + "</br>"); if (company != null) { company.Active = true; dblayer.UpdateCompany(company); Label1.Visible = true; } } } } }
public static DataTable Get_ARDetails(Int64 SOID, string SoInvoiceNum) { DataTable table = null; try { // get a configured DbCommand object DbCommand comm = DBLayer.CreateCommand(); DbParameter param = comm.CreateParameter(); // set the stored procedure name comm.CommandText = "USB_Get_ArDetails"; // create a new parameter param = comm.CreateParameter(); param.ParameterName = "@So_ID"; param.Value = SOID; param.DbType = DbType.Int64; comm.Parameters.Add(param); // create a new parameter param = comm.CreateParameter(); param.ParameterName = "@SoInvoiceNum"; param.Value = SoInvoiceNum; param.DbType = DbType.String; comm.Parameters.Add(param); // execute the stored procedure and save the results in a DataTable table = DBLayer.ExecuteSelectCommand(comm); return(table); } finally { table.Dispose(); } }
public ActionResult Login(LoginUserView model) { //this cecks the model state if (!ModelState.IsValid) { return(View(model)); } // Check if the user is valid bool isValid = false; using (DBLayer db = new DBLayer()) { if (db.Users.Any(x => x.Username.Equals(model.Username) && x.Password.Equals(model.Password))) { isValid = true; } } if (!isValid) { ModelState.AddModelError("", "Invalid username or password."); return(View(model)); } else { FormsAuthentication.SetAuthCookie(model.Username, model.RememberMe); return(Redirect(FormsAuthentication.GetRedirectUrl(model.Username, model.RememberMe))); } }
protected void button1_Click(object sender, EventArgs e) { string adminUsername = txtAdminUsername.Text; string adminPassword = txtAdminPassword.Text; if ((adminUsername.Equals("")) || (adminPassword.Equals(""))) { MessageBox.Show("please enter mandatory fields !!!"); } else { objBAL = new BALayer(); objDAL = new DBLayer(); DataTable dtAdminBA = objBAL.adminLoginBA(txtAdminUsername.Text, txtAdminPassword.Text); if (dtAdminBA.Rows.Count == 1) { MessageBox.Show("Congratulations!!!Logged in successful.."); objDAL.closeConn(); this.Hide(); Admin_Control_Page admincontrol = new Admin_Control_Page(); admincontrol.Show(); } else { MessageBox.Show("Please Enter Valid Credentials!!!"); } } }
public static DataTable Get_PurchaseRegister(DateTime StartDate, DateTime EndDate) { DataTable table = null; try { // get a configured DbCommand object DbCommand comm = DBLayer.CreateCommand(); // set the stored procedure name comm.CommandText = "USP_Report_PurchaseRegister"; // create a new parameter DbParameter param = comm.CreateParameter(); param.ParameterName = "@StartDate"; param.Value = StartDate; param.DbType = DbType.DateTime; comm.Parameters.Add(param); // create a new parameter param = comm.CreateParameter(); param.ParameterName = "@EndDate"; param.Value = EndDate; param.DbType = DbType.DateTime; comm.Parameters.Add(param); // execute the stored procedure and save the results in a DataTable table = DBLayer.ExecuteSelectCommand(comm); return(table); } finally { table.Dispose(); } }
protected void Page_Load(object sender, EventArgs e) { DBLayer dblayer = new DBLayer(); dblayer.CreateConnectionString(Server.MapPath(".")); String LoginKey = Request["LoginKey"]; String CountryID = Request["CountryID"]; String CompanyVAT = Request["CompanyVAT"]; String TimeStamp = Request["TimeStamp"]; //634815800923593750 if ((LoginKey != null) && (LoginKey == "xezp3avnniqyjf45wso0ot45")) { if ((CountryID != null) && (CountryID != "")) { if ((CompanyVAT != null) && (CompanyVAT != "")) { if ((TimeStamp != null) && (TimeStamp != "")) { dblayer.DeleteData(long.Parse(CountryID), CompanyVAT, TimeStamp); } } } } }
public static DataTable Get_SoDetailsFor_MaterialDispatch(Int64 SOID) { DataTable table = null; try { // get a configured DbCommand object DbCommand comm = DBLayer.CreateCommand(); DbParameter param = comm.CreateParameter(); // set the stored procedure name comm.CommandText = "USB_Get_SoDetailsFor_MaterialDispatch"; // create a new parameter param = comm.CreateParameter(); param.ParameterName = "@ID"; param.Value = SOID; param.DbType = DbType.Int64; comm.Parameters.Add(param); // execute the stored procedure and save the results in a DataTable table = DBLayer.ExecuteSelectCommand(comm); return(table); } finally { table.Dispose(); } }
protected void Page_Load(object sender, EventArgs e) { DBLayer db = new DBLayer(); DataSet ds = new DataSet(); ds = db.GetPageContent(2); uiLabelTitle.Text = ds.Tables[0].Rows[0]["Title"].ToString(); uiLiteralContent.Text = Server.HtmlDecode(ds.Tables[0].Rows[0]["Content"].ToString()); }
private void LoadDDls() { DBLayer db = new DBLayer(); uiDropDownListCats.DataSource = db.GetAllCats(); uiDropDownListCats.DataTextField = "CategoryName"; uiDropDownListCats.DataValueField = "ID"; uiDropDownListCats.DataBind(); }
protected void uiDataListProductMedia_ItemCommand(object source, DataListCommandEventArgs e) { if (e.CommandName == "Delete") { DBLayer db = new DBLayer(); db.Deleteitem(Convert.ToInt32(e.CommandArgument)); LoadProjectPhotos(); } }
private void BindProducts() { DBLayer db = new DBLayer(); DataSet ds = new DataSet(); ds = db.GetAllProductByCatID(Convert.ToInt32(Request.QueryString["cid"].ToString())); uiRepeaterProducts.DataSource = ds; uiRepeaterProducts.DataBind(); }
public DataTable GetExistingData() { DataTable dtExistingData = new DataTable(); DBLayer dbLayerExistingData = new DBLayer(); dtExistingData = dbLayerExistingData.GetExistingData(); return dtExistingData; }
protected void Page_Load(object sender, EventArgs e) { DBLayer db = new DBLayer(); uiRepeaterCats.DataSource = db.GetAllCats(); uiRepeaterCats.DataBind(); uiRepeaterGallery.DataSource = db.GetAllProducts(); uiRepeaterGallery.DataBind(); }
protected void uiLinkButtonSubmit_Click(object sender, EventArgs e) { try { int id = Convert.ToInt32(Request.QueryString["TID"].ToString()); DBLayer db = new DBLayer(); DataSet ds = new DataSet(); ds = db.GetTourismlistContent(id); MailMessage msg = new MailMessage(); DataSet to = db.GetAllMails(); foreach (DataRow item in to.Tables[0].Rows) { msg.To.Add(item["Email"].ToString()); } //msg.To.Add("*****@*****.**"); msg.From = new MailAddress("*****@*****.**"); //msg.From = new MailAddress("*****@*****.**"); msg.Subject = " Email from booking page"; msg.IsBodyHtml = true; msg.BodyEncoding = System.Text.Encoding.Unicode; msg.Body = " الإسم : " + uiDropDownListTitle.Text + " " + uiTextBoxName.Text; msg.Body += "<br/> البريد الإلكترونى : " + uiTextBoxEmail.Text; msg.Body += "<br/> الشارع : " + uiTextBoxStreet.Text; msg.Body += "<br/> المدينة : " + uiTextBoxCity.Text; msg.Body += "<br/> الرقم البريدى : " + uiTextBoxPostalCode.Text; msg.Body += "<br/> البلد : " + uiTextBoxCountry.Text; msg.Body += "<br/> التليفون : " + uiTextBoxTelephone.Text; msg.Body += "<br/> الموبايل : " + uiTextBoxMobile.Text; msg.Body += "<br/> إسم الرحلة : " + ds.Tables[0].Rows[0]["Title"].ToString(); msg.Body += "<br/> تفاصيل الرحلة : " + Server.HtmlDecode(ds.Tables[0].Rows[0]["Content"].ToString()); msg.Body += "<br/> الرابط على الموقع : " + Request.Url; SmtpClient client = new SmtpClient("mail.obtravel-eg.com", 25); //SmtpClient client = new SmtpClient("smtp.gmail.com", 587); //client.EnableSsl = true; client.UseDefaultCredentials = false; //client.EnableSsl = true; client.Credentials = new System.Net.NetworkCredential("*****@*****.**", "obtravelmail"); //client.Credentials = new System.Net.NetworkCredential("*****@*****.**", "********"); client.Send(msg); uiLabelMessage.Visible = true; } catch (Exception ex) { uiLabelMessage.Visible = true; uiLabelMessage.Text = ex.Message; } }
protected void Page_Load(object sender, EventArgs e) { DBLayer db = new DBLayer(); DataSet ds = new DataSet(); ds = db.GetAllNews(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { uiLiteralTicker.Text += ds.Tables[0].Rows[i]["arContent"].ToString() + " | "; } uiLiteralTicker.Text = uiLiteralTicker.Text.Remove(uiLiteralTicker.Text.LastIndexOf("|")); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DBLayer db = new DBLayer(); DataSet ds = new DataSet(); ds = db.GetBlockContent(2); uiLiteralTitle.Text = ds.Tables[0].Rows[0]["arTitle"].ToString(); uiLiteralContent.Text = Server.HtmlDecode(ds.Tables[0].Rows[0]["arBrief"].ToString()); uiImageBlock.ImageUrl = ds.Tables[0].Rows[0]["arImagePath"].ToString(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DBLayer db = new DBLayer(); DataSet ds = new DataSet(); ds = db.GetPageContent(2); uiLiteralContent.Text = Server.HtmlDecode(ds.Tables[0].Rows[0]["arContent"].ToString()); } RegisterStartupScript("menu", "<script type='text/javascript'>$(\"#m5\").addClass(\"selected\");</script>"); }
protected void uiLinkButtonUpdate_Click(object sender, EventArgs e) { DBLayer db = new DBLayer(); if (uiFileUploadPhoto.HasFile) { if (!string.IsNullOrEmpty(uiDropDownListCats.SelectedValue)) { string path = "/UploadedFiles/gallery/" + DateTime.Now.ToString("ddMMyyyyhhmmss") + uiFileUploadPhoto.FileName; optimizePic("~" + path); db.AddProductContent(uiTextBoxTitle.Text, path, Convert.ToInt32(uiDropDownListCats.SelectedValue),"","","",""); BindData(); } } }
protected void uiLinkButtonSubmit_Click(object sender, EventArgs e) { DBLayer db = new DBLayer(); if (db.AddContactForm(uiTextBoxTelephone.Text, uiTextBoxMobile.Text, uiTextBoxEmail.Text, uiTextBoxSubject.Text, uiTextBoxName.Text, uiTextBoxStreet.Text, uiTextBoxCity.Text, uiTextBoxPostalCode.Text, uiTextBoxCountry.Text, uiDropDownListTitle.Text, Convert.ToInt32(uiDropDownListSection.SelectedValue))) { uiLabelSuccess.Visible = true; uiLabelFail.Visible = false; } else { uiLabelFail.Visible = true; uiLabelSuccess.Visible = false; } }
protected void uiGridViewPages_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EditPages") { DBLayer db = new DBLayer(); CurrentPage = Convert.ToInt32(e.CommandArgument); DataSet ds = db.GetPageContent(CurrentPage); uiTextBoxTitle.Text = ds.Tables[0].Rows[0]["Title"].ToString(); uiTextBoxContent.Text = Server.HtmlDecode(ds.Tables[0].Rows[0]["Content"].ToString()); uiPanelViewPages.Visible = false; uiPanelEdit.Visible = true; } }
protected void uiGridViewContactForms_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "ViewContact") { DBLayer db = new DBLayer(); int id = Convert.ToInt32(e.CommandArgument.ToString()); DataSet ds = new DataSet(); ds = db.GetContactForm(id); uiLabelTelephone.Text = ds.Tables[0].Rows[0]["Telephone"].ToString(); uiLabelMobile.Text = ds.Tables[0].Rows[0]["Mobile"].ToString(); uiLabelEmail.Text = ds.Tables[0].Rows[0]["Email"].ToString(); uiTextBoxSubject.Text = ds.Tables[0].Rows[0]["Subject"].ToString(); uiPanelContactForms.Visible = false; uiPanelViewForm.Visible = true; } }
protected void uiGridViewPages_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EditPage") { int id = Convert.ToInt32(e.CommandArgument.ToString()); CurrentPage = id; DBLayer db = new DBLayer(); DataSet ds = new DataSet(); ds = db.GetPageContent(id); if (ds.Tables[0].Rows.Count > 0) { uiTextBoxTitle.Text = ds.Tables[0].Rows[0]["arTitle"].ToString(); uiFCKeditorContent.Value = Server.HtmlDecode(ds.Tables[0].Rows[0]["arContent"].ToString()); } uiPanelCurrentPages.Visible = false; uiPanelCurrent.Visible = true; } }
protected void Page_Load(object sender, EventArgs e) { DBLayer dbLayer = new DBLayer(); DataTable dtFieldIds = new DataTable(); int updateFieldSuccess = 0; int countFieldUpdated = 0; dtFieldIds = dbLayer.GetFieldIds(); for (int i = 0; i < dtFieldIds.Rows.Count; i++) { updateFieldSuccess = UpdateFields(Convert.ToInt32(dtFieldIds.Rows[i]["FIEL_Id"])); if (updateFieldSuccess == 1) { countFieldUpdated += 1; } } Response.Write("<h2>Number of fields updated= " + countFieldUpdated.ToString() + "</h2><br/><br/>"); }
protected void uiLinkButtonLogin_Click(object sender, EventArgs e) { DBLayer db = new DBLayer(); DataSet ds = db.GetUser(uiTextBoxUserName.Text, uiTextBoxPassword.Text); uiLabelErrorLogin.Visible = false; if (ds != null) { if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { string user = ds.Tables[0].Rows[0]["UserName"].ToString(); Session["CurrentUser"] = user; Response.Redirect("~/Admin/AdminCP.aspx"); } else { uiLabelErrorLogin.Visible = true; } } else { uiLabelErrorLogin.Visible = true; } }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["PID"] != null && !string.IsNullOrEmpty(Request.QueryString["PID"].ToString())) { int id = Convert.ToInt32(Request.QueryString["PID"].ToString()); DBLayer db = new DBLayer(); DataSet ds = new DataSet(); ds = db.GetPageContent(id); if (ds.Tables[0].Rows.Count != 0) { uiLabelTitle.Text = ds.Tables[0].Rows[0]["Title"].ToString(); uiLiteralContent.Text = Server.HtmlDecode(ds.Tables[0].Rows[0]["Content"].ToString()); } else { Response.Redirect("Node.aspx?PID=2"); } } else { Response.Redirect("Node.aspx?PID=2"); } }
protected void uiGridViewDesigners_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EditDesigner") { DBLayer db = new DBLayer(); CurrentDesigner = Convert.ToInt32(e.CommandArgument); DataSet ds = db.GetDesignerContent(CurrentDesigner); uiTextBoxTitle.Text = ds.Tables[0].Rows[0]["Title"].ToString(); uiTextBoxBrief.Text = ds.Tables[0].Rows[0]["Brief"].ToString(); uiTextBoxName.Text = ds.Tables[0].Rows[0]["DesignerName"].ToString(); uiTextBoxContent.Text = Server.HtmlDecode(ds.Tables[0].Rows[0]["Content"].ToString()); uiPanelViewDesigners.Visible = false; uiPanelEdit.Visible = true; } else if (e.CommandName == "DeleteDesigner") { DBLayer db = new DBLayer(); db.DeleteDesigner(Convert.ToInt32(e.CommandArgument)); CurrentDesigner = 0; BindData(); } }
public MasterReportDao(DBLayer layer) : base(layer) { }
protected void Page_Load(object sender, EventArgs e) { DBLayer db = new DBLayer(); uiRepeaterCurrentServices.DataSource = db.GetEnglishServices(); uiRepeaterCurrentServices.DataBind(); }