protected void Page_Load(object sender, EventArgs e) { main_function PPHfunction = new main_function(); PPHfunction.QueryExecuteNonQuery("delete from User_Profile WHERE UserID='" + PPHfunction.decodeBase64(Request.QueryString["Param"].ToString()) + "'"); Response.Write("<script>alert('Delete Success');window.location.href='../../../.." + PPHfunction.decodeBase64(Request.QueryString["url"].ToString()) + "';</script>"); }
protected void Page_Load(object sender, EventArgs e) { main_function PPHfunction = new main_function(); PPHfunction.QueryExecuteNonQuery("delete from Vendor_Group where VendorID='" + Request.QueryString["vdID"].ToString() + "'"); PPHfunction.QueryExecuteNonQuery("delete from Vendor_Info where VendorID='" + Request.QueryString["vdID"].ToString() + "'"); Response.Write("<script>alert('Delete Success !!');document.location.href='./master_vender.aspx?r=" + Request.QueryString["r"].ToString() + "&id=" + Request.QueryString["id"].ToString() + "&seName=" + Request.QueryString["seName"].ToString() + "&seCode=" + Request.QueryString["seCode"].ToString() + "';</script>"); }
protected void Page_Load(object sender, EventArgs e) { main_function PPHfunction = new main_function(); PPHfunction.QueryExecuteNonQuery("update User_Profile set Passwd_Expired_Date='" + DateTime.Now + "', Passwd='" + PH_EncrptHelper.MD5Encryp("P@ssw0rd") + "' WHERE UserID='" + PPHfunction.decodeBase64(Request.QueryString["Param"].ToString()) + "'"); Response.Write("<script>alert('Password Reset Already');window.location.href='../../../.." + PPHfunction.decodeBase64(Request.QueryString["url"].ToString()) + "';</script>"); }
private bool InsertData(string path) { DataTable dt = new DataTable(); dt.Columns.AddRange(new DataColumn[] { new DataColumn("Year"), new DataColumn("Tesco_WK"), new DataColumn("Period_StartDate"), new DataColumn("Period_EndDate"), new DataColumn("Tesco_FY"), new DataColumn("Tesco_Period") }); //Response.Write(path); main_function PPHfunction = new main_function(); string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " + path + " ; Extended Properties=Excel 8.0;"; string connectionStringXLSX = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source= " + path + " ; Extended Properties=\"Excel 12.0;IMEX=1;HDR=Yes;TypeGuessRows=0;ImportMixedTypes=Text\""; connectionString = (path.IndexOf("xlsx") > 0) ? connectionStringXLSX : connectionString; OleDbConnection conn = new OleDbConnection(connectionString); if (conn.State == ConnectionState.Open) { conn.Close(); } conn.Open(); try { #region Insert string sql = "select * from [DateWeek$]"; OleDbCommand cmd = new OleDbCommand(sql, conn); OleDbDataReader drRead = cmd.ExecuteReader(); while (drRead.Read()) { if (drRead[0].ToString() != "" && drRead[1].ToString() != "") { string strBetweenS, strBetweenE, strBetween; string[] arrSDate = drRead[2].ToString().Split('/'); strBetweenS = arrSDate[1] + " " + PPHfunction.chrShortMonth(arrSDate[0]) + " " + arrSDate[2].Substring(2, 2); string[] arrESDate = drRead[3].ToString().Split('/'); strBetweenE = arrESDate[1] + " " + PPHfunction.chrShortMonth(arrESDate[0]) + " " + arrESDate[2].Substring(2, 2); string insert_dayweek = drRead[1].ToString(); if (insert_dayweek.Length == 1) { insert_dayweek = "0" + insert_dayweek; } strBetween = strBetweenS + " - " + strBetweenE; PPHfunction.QueryExecuteNonQuery("insert into Date_Week_Info (Tesco_Year, Tesco_Week, Period_StartDate, Period_EndDate, Between_Date, Tesco_FY, Tesco_Period) values ('" + drRead[0] + "','" + insert_dayweek + "','" + drRead[2] + "','" + drRead[3] + "','" + strBetween + "', '" + drRead[4] + "', '" + drRead[5] + "')"); } } conn.Close(); return(true); #endregion } catch (Exception ex) { conn.Close(); PrimaryHaul_WS.PH_ExceptionManager.WriteError(ex.Message); return(false); } }
protected void Page_Load(object sender, EventArgs e) { if (!string.IsNullOrEmpty(Request.Form["varType"])) { if (Request.Form["varType"].ToString() == "delete") { main_function PPHfunction = new main_function(); PPHfunction.QueryExecuteNonQuery("delete from DC_Info where DC_NO='" + Request.Form["varID"].ToString() + "'"); } } }
protected void Page_Load(object sender, EventArgs e) { main_function PPHfunction = new main_function(); if (Request.Form["var02"].ToString() != "") { string inID = Request.Form["var02"].ToString().Replace("||", "','"); inID = inID.Replace("|", "'"); string inIDCO = Request.Form["var03"].ToString().Replace("||", "','"); inIDCO = inIDCO.Replace("|", "'"); //Response.Write("update Vendor_Group set Vendor_UserName='******' where VendorID in (" + inID + ") and Vendor_Code in (" + inIDCO + ")"); PPHfunction.QueryExecuteNonQuery("update Vendor_Group set Vendor_UserName='******' where VendorID in (" + inID + ") and Vendor_Code in (" + inIDCO + ")"); } }
protected void Page_Load(object sender, EventArgs e) { main_function PPHfunction = new main_function(); string varDelete = Request.Form["var01"].ToString(); //Response.Write(varDelete); string[] arrDelete = varDelete.Split('|'); //Response.Write(arrDelete.Length); for (int i = 1; i < arrDelete.Length; i++) { string[] sqlDelete = arrDelete[i].Split('-'); PPHfunction.QueryExecuteNonQuery("delete From Vendor_Group Where VendorID='" + sqlDelete[0] + "' and Vendor_Code='" + sqlDelete[1] + "'"); //Response.Write("delete From Vendor_Group Where VendorID='" + sqlDelete[0] + "' and Vendor_Code='" + sqlDelete[1] + "'"); } }
protected void Page_Load(object sender, EventArgs e) { main_function PPHfunction = new main_function(); //Response.Write(Request.QueryString["force"].ToString()); if (Request.QueryString["force"].ToString() == "Y") { PPHfunction.QueryExecuteNonQuery("update User_Profile set User_Status='" + Request.QueryString["status"].ToString() + "', Passwd_Expired_Date='" + DateTime.Now + "', Passwd='" + PH_EncrptHelper.MD5Encryp("P@ssw0rd") + "' WHERE UserID='" + Request.QueryString["id"].ToString() + "'"); } else { PPHfunction.QueryExecuteNonQuery("update User_Profile set User_Status='" + Request.QueryString["status"].ToString() + "' WHERE UserID='" + Request.QueryString["id"].ToString() + "'"); } Response.Write("<script>alert('Status Updated Success');window.location.href='../../../.." + PPHfunction.decodeBase64(Request.QueryString["url"].ToString()) + "';</script>"); }
protected void Page_Load(object sender, EventArgs e) { main_function PPHfunction = new main_function(); string dateEndUse; if (!string.IsNullOrEmpty(Request.Form["var03"] as string)) { string[] arrDate = Request.Form["var03"].ToString().Split('/'); dateEndUse = "'" + arrDate[2] + "-" + arrDate[1] + "-" + arrDate[0] + "'"; } else { dateEndUse = "NULL"; } //Response.Write("update DC_Info set DC_Name='" + Request.Form["var02"].ToString() + "', EndDate='" + dateEndUse + "' where DC_NO='" + Request.Form["var01"].ToString() + "'"); PPHfunction.QueryExecuteNonQuery("update DC_Info set DC_Name='" + Request.Form["var02"].ToString() + "', EndDate=" + dateEndUse + ", dc_abbr='" + Request.Form["var04"].ToString() + "', DC_Flag='" + Request.Form["var05"].ToString() + "' where DC_NO='" + Request.Form["var01"].ToString() + "'"); }
protected void btnSubmit_Click(object sender, EventArgs e) { try { main_function PPHfunction = new main_function(); if (PPHfunction.QueryExecuteNonQuery("update VAT_Default set VAT_Rate='" + txtVatRate.Text + "'")) { lblErr.Text = ""; Response.Write("<script>alert('Save Success');</script>"); } } catch (Exception ex) { lblErr.Text = ex.Message; PH_ExceptionManager.WriteError(ex.Message); } }
protected void Page_Load(object sender, EventArgs e) { main_function PPHfunction = new main_function(); cs_checkFiled getLast = new cs_checkFiled(); string vnID = getLast.sql_getAjaxAnswer("SELECT VendorID FROM Vendor_Info order by VendorID desc"); int m = Int32.Parse(vnID); string vendor_type = ""; if (Request.Form["var04"].ToString().Substring(0, 1) == "B") { vendor_type = "BH"; } else if (Request.Form["var04"].ToString().Substring(0, 1) == "F") { vendor_type = "FZ"; } else { vendor_type = "VD"; } PPHfunction.QueryExecuteNonQuery("insert into Vendor_Info (VendorID, Vendor_TaxID, Vendor_Name_En, Vendor_Name_Th, StampTime, vendor_type) values ('" + (m + 1) + "', '" + Request.Form["var01"].ToString() + "','" + Request.Form["var02"].ToString() + "','" + Request.Form["var03"].ToString() + "','" + DateTime.Now + "','" + vendor_type + "')"); }
protected void Page_Load(object sender, EventArgs e) { objConn = new SqlConnection(); objConn.ConnectionString = strConnString; objConn.Open(); main_function PPHfunction = new main_function(); int i = 0; string istring = "|"; string sql_list = "select Distinct vendor_code,vendor_name, (select top 1 count(Vendor_Download_Log.DownloadLogID) from Vendor_Download_Log where Vendor_Download_Log.Tesco_Year_Week=transportation.year_week_upload and Vendor_Download_Log.Vendor_UserID=" + Request.Form["var01"] + " and Vendor_Download_Log.File_Name=vendor_code+'_" + Request.Form["var02"].ToString() + ".xls') as statusDownload from transportation where year_week_upload='" + Request.Form["var02"] + "' and calc_date is not null and vendor_code in (select vendor_code from vendor_group where Vendor_UserName= (select UserName from User_Profile where UserID=" + Request.Form["var01"] + ") )"; SqlCommand rs_list = new SqlCommand(sql_list, objConn); SqlDataReader obj_list = rs_list.ExecuteReader(); while (obj_list.Read()) { i++; PPHfunction.QueryExecuteNonQuery("insert into Vendor_Download_Log (Vendor_UserID,Tesco_Year_Week,File_Name, Status,Download_DateTime) values ('" + Request.Form["var01"].ToString() + "','" + Request.Form["var02"].ToString() + "','" + obj_list["vendor_code"].ToString() + "_" + Request.Form["var01"].ToString() + ".xls', 'Y', '" + DateTime.Now + "')"); istring = istring + "" + obj_list["vendor_code"].ToString() + "|"; } obj_list.Close(); Response.Write(i + "-" + istring); }
protected void Page_Load(object sender, EventArgs e) { main_function PPHfunction = new main_function(); cs_checkFiled getLast = new cs_checkFiled(); //string vnID = getLast.sql_getAjaxAnswer("SELECT VendorID FROM Vendor_Info where Vendor_TaxID ='" + Request.Form["var02"].ToString() + "'"); string vendor_type = ""; if (Request.Form["var04"].ToString().Substring(0, 1) == "B") { vendor_type = "BH"; } else if (Request.Form["var04"].ToString().Substring(0, 1) == "F") { vendor_type = "FZ"; } else { vendor_type = "VD"; } string vnID = Request.Form["var02"].ToString(); PPHfunction.QueryExecuteNonQuery("insert into Vendor_Group (VendorID, Vendor_Code, vendor_type) values ('" + vnID + "', '" + Request.Form["var01"].ToString() + "', '" + vendor_type + "')"); }
protected void connect() { try { SqlConnection cnn = new SqlConnection(Class.connection.conStr); Class.main_function cM = new main_function(); DataTable Dt = new DataTable(); Dt = cM.getAllData("sever", null, null, null, null); txtServer.Text = Dt.Rows[0]["serverName"].ToString(); txtDB.Text = Dt.Rows[0]["dbName"].ToString(); txtPort.Text = Dt.Rows[0]["portName"].ToString(); txtUser.Text = Dt.Rows[0]["userName"].ToString(); txtPass.Text = Dt.Rows[0]["password"].ToString(); sever = txtServer.Text; port = txtPort.Text; db = txtDB.Text; user = txtUser.Text; pass = txtPass.Text; } catch { } }
protected void Page_Load(object sender, EventArgs e) { main_function PPHfunction = new main_function(); string strS, strE, strBetweenS, strBetweenE, strBetween; if (!string.IsNullOrEmpty(Request.Form["var01"] as string)) { string[] arrSDate = Request.Form["var01"].ToString().Split('/'); strS = "'" + arrSDate[2] + "-" + arrSDate[1] + "-" + arrSDate[0] + "'"; strBetweenS = arrSDate[0] + " " + PPHfunction.chrShortMonth(arrSDate[1]) + " " + arrSDate[2].Substring(2, 2); } else { strS = "NULL"; strBetweenS = ""; } if (!string.IsNullOrEmpty(Request.Form["var02"] as string)) { string[] arrESDate = Request.Form["var02"].ToString().Split('/'); strE = "'" + arrESDate[2] + "-" + arrESDate[1] + "-" + arrESDate[0] + "'"; strBetweenE = arrESDate[0] + " " + PPHfunction.chrShortMonth(arrESDate[1]) + " " + arrESDate[2].Substring(2, 2); } else { strE = "NULL"; strBetweenE = ""; } strBetween = strBetweenS + " - " + strBetweenE; PPHfunction.QueryExecuteNonQuery("update Date_Week_Info set Period_StartDate=" + strS + ", Period_EndDate=" + strE + ", Between_Date='" + strBetween + "', Tesco_Year='" + Request.Form["var04"].ToString() + "', Tesco_Week='" + Request.Form["var05"].ToString() + "', Tesco_FY='" + Request.Form["var06"].ToString() + "', Tesco_Period='" + Request.Form["var07"].ToString() + "' where Wk_ID='" + Request.Form["var03"].ToString() + "'"); }
protected void Page_Load(object sender, EventArgs e) { main_function PPHfunction = new main_function(); PPHfunction.QueryExecuteNonQuery("insert into Haulier_Info (Haulier_TaxID, Haulier_Name_En, Haulier_Abbr, StampTime) values ('" + Request.Form["var01"].ToString() + "','" + Request.Form["var02"].ToString() + "','" + Request.Form["var03"].ToString() + "','" + DateTime.Now + "')"); }
protected void Page_Load(object sender, EventArgs e) { main_function PPHfunction = new main_function(); PPHfunction.QueryExecuteNonQuery("update Vendor_Info set Vendor_TaxID='" + Request.Form["var01"].ToString() + "', Vendor_Name_En='" + Request.Form["var02"].ToString() + "', Vendor_Name_Th='" + Request.Form["var03"].ToString() + "', StampTime='" + DateTime.Now + "' where VendorID='" + Request.Form["var04"].ToString() + "'"); }
protected void Page_Load(object sender, EventArgs e) { main_function PPHfunction = new main_function(); PPHfunction.QueryExecuteNonQuery("insert into DC_Info (DC_NO,DC_Name, dc_abbr, DC_Flag) values ('" + Request.Form["var01"].ToString() + "','" + Request.Form["var02"].ToString() + "','" + Request.Form["var03"].ToString() + "','" + Request.Form["var04"].ToString() + "')"); }
protected void Page_Load(object sender, EventArgs e) { main_function PPHfunction = new main_function(); PPHfunction.QueryExecuteNonQuery("insert into Vendor_Download_Log (Vendor_UserID,Tesco_Year_Week,File_Name, Status,Download_DateTime, vendor_Code) values ('" + Request.Form["var01"].ToString() + "','" + Request.Form["var02"].ToString() + "','" + Request.Form["var03"].ToString() + "_" + Request.Form["var02"].ToString() + ".xls', 'Y', '" + DateTime.Now + "','" + Request.Form["var03"].ToString() + "')"); }