Commit a19705c5 by Sujitra

Create History log

parents
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="AnalyzeCall.aspx.vb" Inherits="AnalyzeCall" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
' Generated by MyGeneration Version # (1.3.0.3)
Public Class CallCenterLog
Inherits _CallCenterLog
Private par As New Specialized.ListDictionary
Public Function _Proc_LoadHistoryLogByDate(ByVal strDate As String) As Boolean
par.Clear()
par.Add("@strDate", strDate)
Return MyBase.LoadFromSql("[_Proc_LoadHistoryLogByDate]", par)
End Function
End Class
' Generated by MyGeneration Version # (1.3.0.3)
NameSpace MushroomTravel
Public Class M_User
Inherits _M_User
End Class
End NameSpace
' Generated by MyGeneration Version # (1.3.0.3)
Public Class MainBooking
Inherits _MainBooking
Private par As New Specialized.ListDictionary
'--- Get Agent --------
Public Function _HistoryLog_Agent_BookingDelete(ByVal strAgentID As String, ByVal strBookingDel As String) As Boolean
par.Clear()
par.Add("@AgentID", CInt(strAgentID))
par.Add("@DeleteDate", strBookingDel)
Return MyBase.LoadFromSql("[_HistoryLog_Agent_BookingDelete]", par)
End Function
Public Function _HistoryLog_AgentDetail_FindURL(ByVal strAgentID As String, ByVal strURLWebsite As String) As Boolean
par.Clear()
par.Add("@AgentID", CInt(strAgentID))
par.Add("@URLWebsite", strURLWebsite)
Return MyBase.LoadFromSql("[_HistoryLog_AgentDetail_FindURL]", par)
End Function
Public Function _HistoryLog_Agent_WebHomeProduct(ByVal strAgentID As String) As Boolean
par.Clear()
par.Add("@AgentID", CInt(strAgentID))
Return MyBase.LoadFromSql("[_HistoryLog_Agent_WebHomeProduct]", par)
End Function
Public Function _HistoryLog_AgentDetail(ByVal strAgentID As String) As Boolean
par.Clear()
par.Add("@AgentID", CInt(strAgentID))
Return MyBase.LoadFromSql("[_HistoryLog_AgentDetail]", par)
End Function
#Region "'-- Delete Data --" '
Public Function _HistoryLog_DelBookingByAgentID(ByVal strAgentID As String) As Boolean
par.Clear()
par.Add("@AgentID", CInt(strAgentID))
Return MyBase.LoadFromSql("[_HistoryLog_DelBookingByAgentID]", par)
End Function
Public Function _HistoryLog_DelProductByAgentID_byProductCode(ByVal strAgentID As String,byval strProductCodeNews As String ) As Boolean
par.Clear()
par.Add("@AgentID", CInt(strAgentID))
par.Add("@ProductCodeNews", strProductCodeNews)
Return MyBase.LoadFromSql("[_HistoryLog_DelProductByAgentID_byProductCode]", par)
End Function
Public Function _HistoryLog_DelProductByAgentID(ByVal strAgentID As String) As Boolean
par.Clear()
par.Add("@AgentID", CInt(strAgentID))
Return MyBase.LoadFromSql("[_HistoryLog_DelProductByAgentID]", par)
End Function
Public Function _HistoryLog_DelPassengerByAgentID(ByVal strAgentID As String) As Boolean
par.Clear()
par.Add("@AgentID", CInt(strAgentID))
Return MyBase.LoadFromSql("[_HistoryLog_DelPassengerByAgentID]", par)
End Function
Public Function _HistoryLog_DelCustomerCompanyByAgentID(ByVal strAgentID As String) As Boolean
par.Clear()
par.Add("@AgentID", CInt(strAgentID))
Return MyBase.LoadFromSql("[_HistoryLog_DelCustomerCompanyByAgentID]", par)
End Function
Public Function _HistoryLog_DelSupplierByAgentID(ByVal strAgentID As String) As Boolean
par.Clear()
par.Add("@AgentID", CInt(strAgentID))
Return MyBase.LoadFromSql("[_HistoryLog_DelSupplierByAgentID]", par)
End Function
#End Region
Public Function _HistoryLog_BookingDetail_Payment_Log(ByVal strPNRCode As String) As Boolean
par.Clear()
par.Add("@PNRCode", strPNRCode)
Return MyBase.LoadFromSql("[_HistoryLog_BookingDetail_Payment_Log]", par)
End Function
Public Function _HistoryLog_BookingDetail_Payment_Current(ByVal strPNRCode As String) As Boolean
par.Clear()
par.Add("@PNRCode", strPNRCode)
Return MyBase.LoadFromSql("[_HistoryLog_BookingDetail_Payment_Current]", par)
End Function
Public Function _HistoryLog_BookingDetail(ByVal strPNRCode As String) As Boolean
par.Clear()
par.Add("@PNRCode", strPNRCode)
Return MyBase.LoadFromSql("[_HistoryLog_BookingDetail]", par)
End Function
Public Function _HistoryLog_BookingDetail_ActivityLog(ByVal strPNRCode As String) As Boolean
par.Clear()
par.Add("@PNRCode", strPNRCode)
Return MyBase.LoadFromSql("[_HistoryLog_BookingDetail_ActivityLog]", par)
End Function
Public Function _HistoryLog_BookingDetail_StatusLog(ByVal strPNRCode As String) As Boolean
par.Clear()
par.Add("@PNRCode", strPNRCode)
Return MyBase.LoadFromSql("[_HistoryLog_BookingDetail_StatusLog]", par)
End Function
Public Function _HistoryLog_BookingDetail_BookingInPeriod(ByVal strPNRCode As String) As Boolean
par.Clear()
par.Add("@PNRCode", strPNRCode)
Return MyBase.LoadFromSql("[_HistoryLog_BookingDetail_Cancel_InPeriod]", par)
End Function
End Class
' Generated by MyGeneration Version # (1.3.0.3)
NameSpace MushroomTravel
Public Class Member
Inherits _Member
End Class
End NameSpace
' Generated by MyGeneration Version # (1.3.0.3)
Namespace MushroomTravel
Public Class Passenger
Inherits _Passenger
Private par As New Specialized.ListDictionary
Public Function _Proc_CheckCallerIDInBackOffice(ByVal strCallerID As String) As Boolean
par.Clear()
par.Add("@strCallerID", strCallerID)
Return MyBase.LoadFromSql("[_Proc_CheckCallerIDInBackOffice]", par)
End Function
Public Function _Proc_GetLastBookingInBackOffice(ByVal intPassengerID As Integer, ByVal intCustomerCompamyID As Integer) As Boolean
par.Clear()
par.Add("@intPassengerID", intPassengerID)
par.Add("@intCustomerCompamyID", intCustomerCompamyID)
Return MyBase.LoadFromSql("[_Proc_GetLastBookingInBackOffice]", par)
End Function
End Class
End Namespace
' Generated by MyGeneration Version # (1.3.0.3)
Public Class Product
Inherits _Product
Private par As New Specialized.ListDictionary
Public Function _HistoryLog_GetProductCodeNewOriginal_WH(ByVal strProductCode As String) As Boolean
par.Clear()
par.Add("@tourcode", strProductCode)
Return MyBase.LoadFromSql("[_HistoryLog_GetProductCodeNewOriginal_WH]", par)
End Function
Public Function _HistoryLog_ProductDetail_Country(ByVal strProductCode As String) As Boolean
par.Clear()
par.Add("@tourcode", strProductCode)
Return MyBase.LoadFromSql("[_HistoryLog_ProductDetail_Country]", par)
End Function
Public Function _HistoryLog_ProductDetail(ByVal strProductCode As String) As Boolean
par.Clear()
par.Add("@tourcode", strProductCode)
Return MyBase.LoadFromSql("[_HistoryLog_ProductDetail]", par)
End Function
Public Function _HistoryLog_ProductDetail_Period(ByVal strProductCode As String) As Boolean
par.Clear()
par.Add("@tourcode", strProductCode)
Return MyBase.LoadFromSql("[_HistoryLog_ProductDetail_Period]", par)
End Function
Public Function _HistoryLog_ProductDetail_PeriodDetailLog(ByVal strProductCode As String) As Boolean
par.Clear()
par.Add("@tourcode", strProductCode)
Return MyBase.LoadFromSql("[_HistoryLog_ProductDetail_PeriodDetailLog]", par)
End Function
Public Function _HistoryLog_ProductDetail_PeriodStatusLog(ByVal strProductCode As String) As Boolean
par.Clear()
par.Add("@tourcode", strProductCode)
Return MyBase.LoadFromSql("[_HistoryLog_ProductDetail_PeriodStatusLog]", par)
End Function
Public Function _Proc_LoadHistoryLog_ProductScrape(ByVal strProductnameSupplier As String) As Boolean
par.Clear()
par.Add("@strProductnameSupplier", strProductnameSupplier)
Return MyBase.LoadFromSql("[_Proc_LoadHistoryLog_ProductScrape]", par)
End Function
End Class
' Generated by MyGeneration Version # (1.3.0.3)
NameSpace CallCenter
Public Class Sale_Phonenumber
Inherits _Sale_Phonenumber
End Class
End NameSpace
' Generated by MyGeneration Version # (1.3.0.3)
NameSpace CallCenter
Public Class TypeProduct_QueueName
Inherits _TypeProduct_QueueName
End Class
End NameSpace
/* aea modify 30-05-2012 */
/*GridViewCSS*/
.GridViewStyle
{
font-family: Arial, Sans-Serif;
font-size:small;
table-layout: auto;
border-collapse: collapse;
border: #E4E4E4 2px solid;
}
.HeaderStyle, .PagerStyle /*Common Styles*/
{
background-image: url(../Image/HeaderGlassBlack.jpg); /* HeaderGlassBlack.jpg aea add */
background-position:center;
background-repeat:repeat-x;
background-color:#CCCCCC;}
.HeaderStyle th
{
padding: 5px;
color: #000000;}
.HeaderStyle a
{
text-decoration:none;
color:#666666;
display:block;
text-align:left;
/*font-weight:normal;*/
}
.PagerStyle table
{
text-align:Right;
margin:auto;}
.PagerStyle table td
{
border:0px;
padding:5px;}
.PagerStyle td
{
border-top: #CCCCCC 3px solid;}
.PagerStyle a
{
color:#666666;
text-decoration:none;
padding:2px 10px 2px 10px;
border-top:solid 1px #E2E2E2;
border-right:solid 1px #DDDDDD;
border-bottom:solid 1px #DDDDDD;
border-left:solid 1px #E2E2E2;}
.PagerStyle span
{
font-weight:bold;
color:#000000;
text-decoration:none;
padding:2px 10px 2px 10px;}/*RowStyles*/
.RowStyle td, .AltRowStyle td, .SelectedRowStyle td, .EditRowStyle td /*Common Styles*/
{
padding: 5px;
border-right: solid 1px #CCCCCC;}
.RowStyle td
{
background-color: #F8F8F8;}
.AltRowStyle td
{
background-color: #f0f0f0;}
.SelectedRowStyle td
{
background-color: #ffff66;}
/*CSS GridView for ListProduct2*/
.GridViewStyle2
{
font-family: Arial, Sans-Serif;
font-size:14px;
table-layout: auto;
border-collapse: collapse;
border: #E4E4E4 2px solid;
}
.HeaderStyle2
{
background-position:center;
background-color:#02288e;
color:#ffff66;
}
.RowStyle2 td
{
background-color: #091ade;
color:#ffffff;
}
.AltRowStyle2 td
{
background-color: #02288e;
color:#ffff66;
}
/*End CSS GridView for ListProduct2*/
This diff is collapsed. Click to expand it.
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>

Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
Dim strReturn As String = "OK,,,Default,D"
If Not (Page.IsPostBack) Then
'--- เป็นข้อมูลที่ทาง Plextel ส่งมาให้ ---
Dim strCallerID As String = Request.QueryString("CallerID")
Dim strUniqueID As String = Request.QueryString("UniqueID")
Dim strStepnumber As String = Request.QueryString("Stepnumber")
Dim strCustomerCall As String = Request.QueryString("CustomerCall")
If strStepnumber = "1" Then
If strCallerID = "0614131510" Then
strReturn = "OK,SIP/2412,15,Default,N"
ElseIf strCallerID = "0614174573" Then
strReturn = "OK,SIP/2412,15,Default,N"
Else
strReturn = "OK,,,Default,D"
End If
End If
If strStepnumber = "2" Then
strReturn = "OK,Queue_GIT,648000,Default,N"
End If
If strStepnumber = "check" Then
strReturn = "CallerID=" & strCallerID & "/UniqueID =" & strUniqueID & "/Stepnumber=" & strStepnumber & "/CustomerCall=" & strCustomerCall
End If
End If
Response.ContentType = "text/plain"
Response.Write(strReturn)
Response.End()
End Sub
End Class

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "CallCenter", ".", "{2AC86F95-7955-4E4D-AF68-4721C0F342B7}"
ProjectSection(WebsiteProperties) = preProject
TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0"
Debug.AspNetCompiler.VirtualPath = "/CallCenter"
Debug.AspNetCompiler.PhysicalPath = "..\CallCenter\"
Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\CallCenter\"
Debug.AspNetCompiler.Updateable = "true"
Debug.AspNetCompiler.ForceOverwrite = "true"
Debug.AspNetCompiler.FixedNames = "false"
Debug.AspNetCompiler.Debug = "True"
Release.AspNetCompiler.VirtualPath = "/CallCenter"
Release.AspNetCompiler.PhysicalPath = "..\CallCenter\"
Release.AspNetCompiler.TargetPath = "PrecompiledWeb\CallCenter\"
Release.AspNetCompiler.Updateable = "true"
Release.AspNetCompiler.ForceOverwrite = "true"
Release.AspNetCompiler.FixedNames = "false"
Release.AspNetCompiler.Debug = "False"
VWDPort = "5568"
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2AC86F95-7955-4E4D-AF68-4721C0F342B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2AC86F95-7955-4E4D-AF68-4721C0F342B7}.Debug|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Login.aspx.vb" Inherits="Login" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>History Log ( TOURPRO X )</title>
<link href="Css/font.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.LoginFrom{background:url(Image/Login_1.jpg) no-repeat;height:191px;width:408px;}
</style>
</head>
<body>
<form id="form1" runat="server">
<table width="100%" border="0" cellpadding="0" cellspacing="0"
style="height: 600px">
<tr>
<td align="center" bgcolor="#E8EBEF" style="padding-top: 100px;" valign="top">
<table bgcolor="White" class="LoginFrom" >
<tr>
<td align="right" valign="middle">
<table cellpadding="5" style="width: 330px;">
<tr>
<td align="right" style="height: 30px">
<asp:Label ID="lblloginHD" runat="server" BorderStyle="None" CssClass="AB1662854F"
Font-Bold="True" Text="History Log (TOURPRO X)"></asp:Label>
</td>
</tr>
<tr>
<td>
<table style="width: 330px;">
<tr>
<td style="width: 95px">
<span class="AB130077996">Username:</span>
</td>
<td align="left">
<asp:TextBox ID="txtlogin_user" runat="server" Font-Bold="False" Width="150px"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width: 95px">
<span class="AB130077996">Password:</span>
</td>
<td align="left">
<asp:TextBox ID="txtLogin_password" runat="server" Font-Bold="False" TextMode="Password"
Width="150px"></asp:TextBox>
</td>
</tr>
<tr>
<td style="width: 95px">
&nbsp;
</td>
<td align="center">
<asp:ImageButton ID="BtnLogin" runat="server" ImageUrl="~/Image/b_Eng.jpg" />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="right">
&nbsp;
<asp:Label ID="lblAlert" Visible="false" Font-Bold="true" ForeColor="Red" runat="server" Text=""></asp:Label>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>
\ No newline at end of file

Partial Class Login
Inherits System.Web.UI.Page
Protected Sub BtnLogin_Click(sender As Object, e As ImageClickEventArgs) Handles BtnLogin.Click
Dim strUserConfig As String = System.Configuration.ConfigurationSettings.AppSettings("UserName")
Dim strPasswordConfig As String = System.Configuration.ConfigurationSettings.AppSettings("Password")
Dim strUserConfig_SystemAdmin As String = System.Configuration.ConfigurationSettings.AppSettings("SystemAdminUserName")
Dim strPasswordConfig_SystemAdmin As String = System.Configuration.ConfigurationSettings.AppSettings("SystemAdminPassword")
Dim blnLoginSUC As Boolean = False
lblAlert.Visible = False
Session("CallCenterSystemAdmin") = Nothing
Session("TypeUserLogin") = ""
Try
Dim strUserLogin As String = txtlogin_user.Text
Dim strPasswordLogin As String = txtLogin_password.Text
If strUserLogin <> "" And strPasswordLogin <> "" Then
If strUserLogin = strUserConfig And strPasswordLogin = strPasswordConfig Then
blnLoginSUC = True
Session("TypeUserLogin") = "admin"
End If
If strUserLogin = strUserConfig_SystemAdmin And strPasswordLogin = strPasswordConfig_SystemAdmin Then
blnLoginSUC = True
Session("TypeUserLogin") = "systemadmin"
End If
End If
Catch ex As Exception
blnLoginSUC = False
End Try
If blnLoginSUC Then
Session("CallCenterSystemAdmin") = True
Response.Redirect("SystemAdmin/BookingDetail.aspx")
Else
lblAlert.Visible = True
lblAlert.Text = "ตรวจสอบ Username และ Password อีกครั้ง"
End If
End Sub
End Class
<%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
body
{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #000000;
}
#nav, #nav ul
{
list-style-type: none;
list-style-position: outside;
position: relative;
line-height: 30px;
margin: 0;
padding: 0;
}
#nav li > a
{
font-weight: bold;
display: block;
margin-top: -1px;
color: #000;
text-decoration: none;
background-color: #FFEFD7;
padding: 0 10px;
width: 99px;
border: 1px solid #FF9900;
}
#nav li > a:hover
{
background-color: #EAEAEA;
color: #000;
}
#nav li
{
float: left;
position: relative;
margin-right: 1px;
}
#nav ul
{
position: absolute;
display: none;
width: 12em;
top: 2.5em;
}
#nav li ul a
{
width: 160px;
height: auto;
float: left;
line-height: 30px;
font-size: 12px;
font-weight: normal;
}
#nav ul ul
{
top: auto;
}
#nav ul ul
{
height: 299px;
width: 652px;
margin: 0;
padding: 0;
background-color: #999999;
}
#nav ul ul li
{
padding: 20px;
}
#nav li.navblue a
{
background-color: #3398CC;
}
#nav li.navorange a
{
background-color: #FF9A02;
color: #FEFF00;
}
#nav li ul ul
{
left: 14.9em;
margin-left: -2px;
}
#nav li:hover ul ul, #nav li:hover ul ul ul, #nav li:hover ul ul ul ul
{
display: none;
}
#nav li:hover ul, #nav li li:hover ul, #nav li li li:hover ul, #nav li li li li:hover ul
{
display: block;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<div id="Menubar" style="margin: 10px;">
<div style="width: 4000px; float: left;">
<ul id="nav">
<li><a href="BookingDetail.aspx" style="text-align: center;">Booking</a></li>
<li><a href="PaymentDetail.aspx" style="text-align: center;">Payment</a></li>
<li><a href="ProductDetail.aspx" style="text-align: center;">Product</a></li>
<li><a href="AgentInfo.aspx" style="text-align: center;">Agent</a></li>
<li><asp:Label ID="lblClearData" runat="server" Visible ="False" Text="Clear Data" BackColor="#FFEFD7" BorderColor="#FF9900" BorderWidth="1px" Height="30px" style="text-align: center; font-weight: 700; color: #000000" Width="120px"></asp:Label></li>
<li><a href="../Login.aspx" style="text-align: center;">Log Out</a></li>
</ul>
</div>
</div>
<br>
<br />
<br>
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>

Partial Class MasterPage
Inherits System.Web.UI.MasterPage
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If IsNothing(Session("CallCenterSystemAdmin")) Then
Session("TypeUserLogin") = ""
Me.Page.Response.Redirect("~/Login.aspx")
Else
If Session("TypeUserLogin") = "systemadmin" Then
lblClearData.Text = "<a href='ClearDetail.aspx' style='text-align: center;'>Clear Data</a>"
lblClearData.Visible = True
End If
End If
End Sub
End Class
USE [TourProX_ALL]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
Alter PROCEDURE [dbo].[_HistoryLog_Agent_BookingDelete]
(
@AgentID int = 3574 ,
@DeleteDate varchar(20) ='2019-05-15'
)
AS
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
select M.FNameTH as NameDel , M.Email as EmailDel , convert(varchar,WD.DeleteDateTime,113) as DeleteDate , convert(varchar,WD.DateRegis,113) as BookingDate , WD.RowIDEmail , WD.StatusCode , P.ProductCodeNew , P.ProductNameTH , convert(varchar,TPD.ColStartDate,106) as PeriodStart
, convert(varchar,TPD.ColEndDate ,106) as PeriodEnd
from WebBookingDeleteLog WD
inner join Member M on WD.DeleteByUserID = M.MemberID
inner join Product P on P.ProductID = WD.ProductID
inner join T_ProductDetail TPD on TPD.Product_detailID = WD.Product_detailID
where WD.AgentID_Owner =@AgentID
and
( ( WD.DeleteDateTime between @DeleteDate+' 00:00:00' and @DeleteDate+' 23:59:59' and @DeleteDate <>'' )
or
( @DeleteDate ='' )
)
order by WD.DateRegis desc
USE [TourProX_ALL]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
Alter PROCEDURE [dbo].[_HistoryLog_Agent_WebHomeProduct]
(
@AgentID int = 112 -- 8280--
)
AS
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
select *
,
(
select
Stuff((select ProductCodeNew + ' ,'
from
(
select P.ProductCodeNew
from WebHomeProduct WP
inner join Product P on WP.ProductID = P.ProductID
where WP.TypeDisplay = tblMain.TypeDisplay and WP.CustomName = tblMain.CustomName and WP.AgentID_Owner = @AgentID and WP.IsActive ='1'
group by P.ProductCodeNew
)S
FOR XML PATH('')),1,0,'')
) as ProductCodeNewDetail
from (
select TypeDisplay , CustomName , count(*) as CountProduct
from WebHomeProduct
where AgentID_Owner = @AgentID and IsActive ='1'
group by TypeDisplay , CustomName
) tblMain
USE [TourProX_ALL]
GO
Alter PROCEDURE [dbo].[_HistoryLog_DelBookingByAgentID]
(
@AgentID int = 5093
)
AS
delete from MainBooking where AgentID_Owner = @AgentID
delete from T_Email where AgentID_Owner = @AgentID
delete from T_Paidby where AgentID_Owner = @AgentID
delete from T_Cost where AgentID_Owner = @AgentID
delete from T_Paidby_Log where AgentID_Owner = @AgentID
delete from TourRoomPassenger where AgentID_Owner = @AgentID
--select *
--,
--(
-- select count(*)
-- from MainBooking MB
-- where MB.AgentID_Owner = tblMain.AgentID
--) as CountBooking,
--(
-- select count(*)
-- from Product P
-- where P.AgentID_Owner = tblMain.AgentID
--) as CountProduct,
--(
-- select count(*)
-- from T_ProductDetail P
-- where P.AgentID_Owner = tblMain.AgentID
--) as CountPeriod ,
--(
-- select count(*)
-- from Passenger P
-- where P.AgentID_Owner = tblMain.AgentID
--) as CountPassenger ,
--(
-- select count(*)
-- from CustomerCompany P
-- where P.AgentID_Owner = tblMain.AgentID
--) as CountCustomerCompany ,
--(
-- select count(*)
-- from M_Agent P
-- where P.AgentID_Owner = tblMain.AgentID and P.Agent_Code <> tblMain.AgentCode
--) as CountSupplier
-- from
-- (
-- select AgentID , AgentCode , AgentName , AgentNameEN , LicenseNumber, AgentContactNickName as NickName , AgentContactTelephone as Tel
-- from Agent A
-- where AgentID = @AgentID
-- and AgentStatusID = 2
-- ) tblMain
USE [TourProX_ALL]
GO
Alter PROCEDURE [dbo].[_HistoryLog_DelProductByAgentID_byProductCode]
(
@AgentID int = 8280 ,
@ProductCodeNews varchar(4000)= '#DDSM190060#,#DDSM190061#,#DDSM190205#'
)
AS
--declare @sql_Product nvarchar(2000)
-- set @sql_Product = 'delete from Product where (Createby <> 152 or Createby is null) and AgentID_Owner = '+ convert(varchar,@AgentID) +' and ProductCodeNew in (' + @ProductCodeNews + ')'
-- + ' and ProductID not in ( select ProductID from T_Email where AgentID_Owner = '+ convert(varchar,@AgentID) +' group by ProductID ) '
--print '@sql_Product='+@sql_Product;
-- execute sp_executesql @sql_Product
--declare @sql_Period nvarchar(2000)
-- set @sql_Period = 'delete from T_ProductDetail where ( UpdateBy <> 152 or UpdateBy is null ) and ProductID in ( select ProductID from Product where AgentID_Owner = '+ convert(varchar,@AgentID) +' and ProductCodeNew in (' + @ProductCodeNews + ')'
-- + ' and ProductID not in ( select ProductID from T_Email where AgentID_Owner = '+ convert(varchar,@AgentID) +' group by ProductID )) '
--print '@sql_Period='+@sql_Period;
-- execute sp_executesql @sql_Period
--declare @sql_Flight nvarchar(2000)
-- set @sql_Flight = 'delete from ProductFlight where ( CreateByUserID <> 152 or CreateByUserID is null ) and Product_detailID in ( select Product_detailID from T_ProductDetail where ProductID in ( select ProductID from Product where AgentID_Owner = '+ convert(varchar,@AgentID) +' and ProductCodeNew in (' + @ProductCodeNews + ')'
-- + ' and ProductID not in ( select ProductID from T_Email where AgentID_Owner = '+ convert(varchar,@AgentID) +' group by ProductID ))) '
--print '@sql_Flight='+@sql_Flight;
-- execute sp_executesql @sql_Flight
set @ProductCodeNews = replace(@ProductCodeNews,'#','''');
declare @sql_Product nvarchar(2000)
set @sql_Product = 'delete from Product where (Createby <> 152 or Createby is null) and AgentID_Owner = '+ convert(varchar,@AgentID) +' and ProductCodeNew in (' + @ProductCodeNews + ')'
+ ' and ProductID not in ( select ProductID from T_Email where AgentID_Owner = '+ convert(varchar,@AgentID) +' group by ProductID ) '
print '@sql_Product='+@sql_Product;
EXEC(@sql_Product);
declare @sql_Period nvarchar(2000)
set @sql_Period = 'delete from T_ProductDetail where ( UpdateBy <> 152 or UpdateBy is null ) and ProductID in ( select ProductID from Product where AgentID_Owner = '+ convert(varchar,@AgentID) +' and ProductCodeNew in (' + @ProductCodeNews + ')'
+ ' and ProductID not in ( select ProductID from T_Email where AgentID_Owner = '+ convert(varchar,@AgentID) +' group by ProductID )) '
print '@sql_Period='+@sql_Period;
EXEC(@sql_Period);
declare @sql_Flight nvarchar(2000)
set @sql_Flight = 'delete from ProductFlight where ( CreateByUserID <> 152 or CreateByUserID is null ) and Product_detailID in ( select Product_detailID from T_ProductDetail where ProductID in ( select ProductID from Product where AgentID_Owner = '+ convert(varchar,@AgentID) +' and ProductCodeNew in (' + @ProductCodeNews + ')'
+ ' and ProductID not in ( select ProductID from T_Email where AgentID_Owner = '+ convert(varchar,@AgentID) +' group by ProductID ))) '
print '@sql_Flight='+@sql_Flight;
EXEC(@sql_Flight);
USE [TourProX_ALL]
GO
Alter PROCEDURE [dbo].[_HistoryLog_DelSupplierByAgentID]
(
@AgentID int = 5093
)
AS
delete M_Agent
where AgentID_Owner = @AgentID
and Agent_Code <>(select AgentCode from Agent where AgentID= @AgentID)
USE [TourProX_ALL]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
Alter PROCEDURE [dbo].[_HistoryLog_GetProductCodeNewOriginal_WH]
(
-- เคสนี้ จะไปหา Product ตั้งต้นของ Wholesale Connect
@tourcode varchar(1000) = 'SPLT191502'
)
AS
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
select P_WH.ProductCodeNew as ProductCodeNew_WH , P_WH.ProductNameTH , P_SUB.ProductCodeNew
from Product P_SUB
inner join Product P_WH on P_SUB.ProductNameSupplier = P_WH.ProductNameTH Collate Thai_CI_AS
where P_WH.Createby <> 152
and P_SUB.ProductCodeNew = @tourcode
and P_WH.ProductID in ( select ProductID from T_ProductDetail where ColStartDate >= GetDate() and PeriodStatusCode ='PRDisplay' group by ProductID )

Imports System.Data
Partial Class SystemAdmin_ClearDetail
Inherits System.Web.UI.Page
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
If txtDateDel.Text = "" Then txtDateDel.Text = Now.Year.ToString() + "-" + Now.Month.ToString("00") + "-" + Now.Day.ToString("00")
lblBookingDel.Text = "Booking ที่ถูกลบ " & txtDateDel.Text
End If
End Sub
Sub LoadAgentData()
'--- Get Data ----
Dim strAgentIDGetURL As String = ""
Dim strAgentID As String = RTrim(LTrim(txtAgentID.Text))
Dim strURLWebsite As String = RTrim(LTrim(txtURLWebsite.Text))
Dim strBookingDate As String = RTrim(LTrim(txtDateDel.Text))
If strAgentID <> "" Or strURLWebsite <> "" Then
strAgentIDGetURL = LoadHistoryLog(strAgentID, strURLWebsite)
If strAgentIDGetURL <> "" Then
strAgentID = strAgentIDGetURL
LoadTourByType(strAgentID)
LoadBookingDel(strAgentID, strBookingDate)
End If
End If
End Sub
Sub LoadTourByType(ByVal strAgentID As String) ' format yyyy-MM-dd
Try
Dim DtProductDetail As New DataTable
DtProductDetail = getTourByType(strAgentID)
If DtProductDetail.DefaultView.Count > 0 Then
'DtBookingDetail.DefaultView.Sort = ViewState("SortExpression") & " " & ViewState("SortDirection")
GVLoadTourbyType.DataSource = DtProductDetail
GVLoadTourbyType.DataBind()
txtLoadTourByType.Text = " " & DtProductDetail.DefaultView.Count & " items."
Else
GVLoadTourbyType.DataSource = Nothing
GVLoadTourbyType.DataBind()
txtLoadTourByType.Text = " 0 items."
End If
Catch ex As Exception
writeErrorLog("LoadTourByType", ex.Message.ToString())
End Try
End Sub
Sub LoadBookingDel(ByVal strAgentID As String, ByVal strBookingDel As String) ' format yyyy-MM-dd
Try
Dim DtProductDetail As New DataTable
DtProductDetail = getBookingDel(strAgentID, strBookingDel)
If DtProductDetail.DefaultView.Count > 0 Then
'DtBookingDetail.DefaultView.Sort = ViewState("SortExpression") & " " & ViewState("SortDirection")
GVBookingDel.DataSource = DtProductDetail
GVBookingDel.DataBind()
lblResultBookingDel.Text = " " & DtProductDetail.DefaultView.Count & " items."
Else
GVBookingDel.DataSource = Nothing
GVBookingDel.DataBind()
lblResultBookingDel.Text = " 0 items."
End If
Catch ex As Exception
writeErrorLog("LoadTourByType", ex.Message.ToString())
End Try
End Sub
Function LoadHistoryLog(ByVal strAgentID As String, ByVal strURLWebsite As String) As String ' format yyyy-MM-dd
Dim strAgentID_Return As String = ""
Try
If strAgentID <> "" Then strAgentID_Return = strAgentID
If strAgentID = "" Then strAgentID = 0
Dim DtProductDetail As New DataTable
DtProductDetail = getAgentDetail(strAgentID, strURLWebsite)
If DtProductDetail.DefaultView.Count > 0 Then
'DtBookingDetail.DefaultView.Sort = ViewState("SortExpression") & " " & ViewState("SortDirection")
strAgentID_Return = DtProductDetail.DefaultView(0)("AgentID").ToString()
GvHistoryLog.DataSource = DtProductDetail
GvHistoryLog.DataBind()
lblResult.Text = " " & DtProductDetail.DefaultView.Count & " items."
Else
GvHistoryLog.DataSource = Nothing
GvHistoryLog.DataBind()
lblResult.Text = " 0 items."
End If
Catch ex As Exception
writeErrorLog("LoadHistoryLog", ex.Message.ToString())
End Try
Return strAgentID_Return
End Function
Function getAgentDetail(ByVal strAgentID As String, ByVal strURLWebsite As String) As DataTable
Dim Dt As New DataTable
Dim ClsMainBooking As New MainBooking
Try
With ClsMainBooking
.Where.WhereClauseReset()
._HistoryLog_AgentDetail_FindURL(strAgentID, strURLWebsite)
If .DefaultView.Count > 0 Then
Dt = .DefaultView.ToTable
End If
End With
Catch ex As Exception
Dt = Nothing
Finally
ClsMainBooking = Nothing
End Try
Return Dt
End Function
Function getTourByType(ByVal strAgentID As String) As DataTable
Dim Dt As New DataTable
Dim ClsMainBooking As New MainBooking
Try
With ClsMainBooking
.Where.WhereClauseReset()
._HistoryLog_Agent_WebHomeProduct(strAgentID)
If .DefaultView.Count > 0 Then
Dt = .DefaultView.ToTable
End If
End With
Catch ex As Exception
Dt = Nothing
Finally
ClsMainBooking = Nothing
End Try
Return Dt
End Function
Function getBookingDel(ByVal strAgentID As String, ByVal strBookingDel As String) As DataTable
Dim Dt As New DataTable
Dim ClsMainBooking As New MainBooking
Try
With ClsMainBooking
.Where.WhereClauseReset()
._HistoryLog_Agent_BookingDelete(strAgentID, strBookingDel)
If .DefaultView.Count > 0 Then
Dt = .DefaultView.ToTable
End If
End With
Catch ex As Exception
Dt = Nothing
Finally
ClsMainBooking = Nothing
End Try
Return Dt
End Function
Sub writeErrorLog(ByVal strFunctionName As String, ByVal strError As String)
lblError.Visible = True
lblError.Text = "[" & strFunctionName & "] Err=" & strError
End Sub
Protected Sub btSearch_Click(sender As Object, e As EventArgs) Handles btSearch.Click
Dim strText As String = txtDateDel.Text
If txtDateDel.Text = "" Then strText = "ทั้งหมด"
lblBookingDel.Text = "Booking ที่ถูกลบ " & strText
LoadAgentData()
End Sub
End Class

Imports System.Data
Partial Class SystemAdmin_ClearDetail
Inherits System.Web.UI.Page
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Session("TypeUserLogin") <> "systemadmin" Then
Session("TypeUserLogin") = ""
Session("CallCenterSystemAdmin") = Nothing
Me.Page.Response.Redirect("~/Login.aspx")
End If
fnSwtichShowDelControl(False)
LoadAgentData()
End Sub
Sub LoadAgentData()
'--- Get Data ----
Dim strAgentID As String = RTrim(LTrim(txtAgentID.Text))
If Len(strAgentID) > 2 Then
If strAgentID <> "" Then LoadHistoryLog(strAgentID)
End If
End Sub
Sub fnSwtichShowDelControl(ByVal bln As Boolean)
btDeleteBooking.Visible = bln
btDeleteProduct.Visible = bln
btDeletePassenger.Visible = bln
btDeleteCustomerCompany.Visible = bln
btDeleteCountSupplier.Visible = bln
End Sub
Sub LoadHistoryLog(ByVal strAgentID As String) ' format yyyy-MM-dd
Try
Dim DtProductDetail As New DataTable
DtProductDetail = getAgentDetail(strAgentID)
If DtProductDetail.DefaultView.Count > 0 Then
'DtBookingDetail.DefaultView.Sort = ViewState("SortExpression") & " " & ViewState("SortDirection")
GvHistoryLog.DataSource = DtProductDetail
GvHistoryLog.DataBind()
lblResult.Text = " " & DtProductDetail.DefaultView.Count & " items."
If DtProductDetail.DefaultView.Count > 0 Then fnSwtichShowDelControl(True)
Else
GvHistoryLog.DataSource = Nothing
GvHistoryLog.DataBind()
lblResult.Text = " 0 items."
End If
Catch ex As Exception
writeErrorLog("LoadHistoryLog", ex.Message.ToString())
End Try
End Sub
Function getAgentDetail(ByVal strAgentID As String) As DataTable
Dim Dt As New DataTable
Dim ClsMainBooking As New MainBooking
Try
With ClsMainBooking
.Where.WhereClauseReset()
._HistoryLog_AgentDetail(strAgentID)
If .DefaultView.Count > 0 Then
Dt = .DefaultView.ToTable
End If
End With
Catch ex As Exception
Dt = Nothing
Finally
ClsMainBooking = Nothing
End Try
Return Dt
End Function
Sub writeErrorLog(ByVal strFunctionName As String, ByVal strError As String)
lblError.Visible = True
lblError.Text = "[" & strFunctionName & "] Err=" & strError
End Sub
Protected Sub btDeleteBooking_Click(sender As Object, e As EventArgs) Handles btDeleteBooking.Click
Dim strAgentID As String = RTrim(LTrim(txtAgentID.Text))
Dim ClsMainBooking As New MainBooking
Try
With ClsMainBooking
.Where.WhereClauseReset()
._HistoryLog_DelBookingByAgentID(strAgentID)
End With
LoadAgentData()
Catch ex As Exception
Finally
ClsMainBooking = Nothing
End Try
End Sub
Protected Sub btDeleteProduct_Click(sender As Object, e As EventArgs) Handles btDeleteProduct.Click
Dim strAgentID As String = RTrim(LTrim(txtAgentID.Text))
Dim ClsMainBooking As New MainBooking
Try
With ClsMainBooking
.Where.WhereClauseReset()
._HistoryLog_DelProductByAgentID(strAgentID)
End With
LoadAgentData()
Catch ex As Exception
Finally
ClsMainBooking = Nothing
End Try
End Sub
Protected Sub btDeletePassenger_Click(sender As Object, e As EventArgs) Handles btDeletePassenger.Click
Dim strAgentID As String = RTrim(LTrim(txtAgentID.Text))
Dim ClsMainBooking As New MainBooking
Try
With ClsMainBooking
.Where.WhereClauseReset()
._HistoryLog_DelPassengerByAgentID(strAgentID)
End With
LoadAgentData()
Catch ex As Exception
Finally
ClsMainBooking = Nothing
End Try
End Sub
Protected Sub btDeleteCustomerCompany_Click(sender As Object, e As EventArgs) Handles btDeleteCustomerCompany.Click
Dim strAgentID As String = RTrim(LTrim(txtAgentID.Text))
Dim ClsMainBooking As New MainBooking
Try
With ClsMainBooking
.Where.WhereClauseReset()
._HistoryLog_DelCustomerCompanyByAgentID(strAgentID)
End With
LoadAgentData()
Catch ex As Exception
Finally
ClsMainBooking = Nothing
End Try
End Sub
Protected Sub btDeleteCountSupplier_Click(sender As Object, e As EventArgs) Handles btDeleteCountSupplier.Click
Dim strAgentID As String = RTrim(LTrim(txtAgentID.Text))
Dim ClsMainBooking As New MainBooking
Try
With ClsMainBooking
.Where.WhereClauseReset()
._HistoryLog_DelSupplierByAgentID(strAgentID)
End With
LoadAgentData()
Catch ex As Exception
Finally
ClsMainBooking = Nothing
End Try
End Sub
Protected Sub btDelProductCodeNew_Click(sender As Object, e As EventArgs) Handles btDelProductCodeNew.Click
Dim strProductCodeNewDel As String = RTrim(LTrim(txtMultiProduct.Text))
Dim strAgentID As String = RTrim(LTrim(txtAgentID.Text))
If strProductCodeNewDel <> "" And IsNumeric(strAgentID) Then
Dim ClsMainBooking As New MainBooking
Try
With ClsMainBooking
.Where.WhereClauseReset()
._HistoryLog_DelProductByAgentID_byProductCode(strAgentID, strProductCodeNewDel)
End With
LoadAgentData()
Catch ex As Exception
lblError.Visible = True
lblError.Text = "[btDelProductCodeNew_Click] Err=" & ex.Message.ToString()
Finally
ClsMainBooking = Nothing
End Try
End If
End Sub
End Class
<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="HistoryLog.aspx.vb" Inherits="SystemAdmin_HistoryLog" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<link href="../Css/CssGrid.css" rel="stylesheet" type="text/css" />
<br />
<asp:Label ID="Label1" runat="server" Text="ค้นหาข้อมูลการโทรศัพท์ของลูกค้า <b>วันที่</b>: "></asp:Label>
<asp:TextBox ID="txtDate" runat="server" MaxLength="10" Width="80px"></asp:TextBox>
<asp:Button ID="btSearch" runat="server" Text="ค้นหา" />
&nbsp;
<asp:Label ID="Label2" runat="server" Font-Italic="true" ForeColor="Gray" Text="** หมายเหตุ ให้กรอกข้อมูลรูปแบบ yyyy-MM-dd เช่น 2013-11-05 "></asp:Label>
<br /><br />
<asp:Label ID="lblHeader" runat="server" Text="History Customer Call Log By"></asp:Label>
<b><asp:Label ID="lblHeaderDate" runat="server" Text=""></asp:Label></b> :
<asp:Label ID="lblResult" runat="server" Text=" 0 items."></asp:Label>
<br />
<br />
<asp:GridView ID="GvHistoryLog" runat="server" AllowSorting="True"
AutoGenerateColumns="False" CssClass="GridViewStyle" GridLines="None" Width="100%"
>
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:TemplateField HeaderText="No." HeaderStyle-Width="20px">
<ItemTemplate>
<asp:Label ID="lblNo" runat="server"></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="History DateTime" SortExpression="HistoryDateTime">
<ItemTemplate>
<asp:Label ID="lblHistoryDate" runat="server" Text='<%#Eval("HistoryDateTime")%>'></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Customer Mobile" SortExpression="CallerID">
<ItemTemplate>
<asp:Label ID="lblCallerID" runat="server" Text='<%#Eval("CallerID")%>'></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField HeaderText="ReturnCall" SortExpression="ReturnCall">
<ItemTemplate>
<asp:Label ID="lblReturnCall" runat="server" Text='<%#Eval("ReturnCall")%>'></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField HeaderText="ReturnValueText" SortExpression="ReturnValueText">
<ItemTemplate>
<asp:Label ID="lblReturnValueText" runat="server" Text='<%#Eval("ReturnValueText")%>'></asp:Label>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" />
</asp:TemplateField>
</Columns>
<RowStyle CssClass="RowStyle" />
<EmptyDataRowStyle CssClass="EmptyRowStyle" />
<PagerStyle CssClass="PagerStyle" />
<SelectedRowStyle CssClass="SelectedRowStyle" />
<HeaderStyle CssClass="HeaderStyle" />
<EditRowStyle CssClass="EditRowStyle" />
<AlternatingRowStyle CssClass="AltRowStyle" />
</asp:GridView>
<asp:Label ID="lblError" runat="server" Text=""></asp:Label>
</asp:Content>

Imports System.Data
Partial Class SystemAdmin_HistoryLog
Inherits System.Web.UI.Page
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
ViewState("SortExpression") = "HistoryDateTime"
ViewState("SortDirection") = "ASC"
txtDate.Text = getCurrentDate()
LoadHistoryLog(txtDate.Text)
End If
End Sub
Function getCurrentDate() As String
Dim strDate As String = ""
strDate = Date.Now.ToString("yyyy-MM-dd")
Return strDate
End Function
Protected Sub btSearch_Click(sender As Object, e As EventArgs) Handles btSearch.Click
Dim strDateSearch As String = txtDate.Text
LoadHistoryLog(strDateSearch)
End Sub
Sub LoadHistoryLog(ByVal strDate As String) ' format yyyy-MM-dd
Try
Dim DtCustomerLog As New DataTable
DtCustomerLog = getCustomerLog(strDate)
lblHeaderDate.Text = ConvertDateString(strDate)
If DtCustomerLog.DefaultView.Count > 0 Then
DtCustomerLog.DefaultView.Sort = ViewState("SortExpression") & " " & ViewState("SortDirection")
GvHistoryLog.DataSource = DtCustomerLog
GvHistoryLog.DataBind()
lblResult.Text = " " & DtCustomerLog.DefaultView.Count & " items."
Else
GvHistoryLog.DataSource = Nothing
GvHistoryLog.DataBind()
lblResult.Text = " 0 items."
End If
Catch ex As Exception
writeErrorLog("LoadHistoryLog", ex.Message.ToString())
End Try
End Sub
Sub writeErrorLog(ByVal strFunctionName As String, ByVal strError As String)
lblError.Visible = True
lblError.Text = "[" & strFunctionName & "] Err=" & strError
End Sub
Function ConvertDateString(ByVal strDate As String) As String
'strDate => yyyy-mm-dd
'output => dd/mm/yyyy
Dim strDateReturn As String = ""
Dim ArrDate() As String
Try
ArrDate = Split(strDate, "-")
strDateReturn = ArrDate(2) & "/" & ArrDate(1) & "/" & ArrDate(0)
Catch ex As Exception
strDateReturn = strDate
End Try
Return strDateReturn
End Function
Protected Sub GvHistoryLog_Sorting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewSortEventArgs) Handles GvHistoryLog.Sorting
Try
If ViewState("SortExpression") = e.SortExpression Then ' กรณีที่เป็นฟิลด์เดิม
If ViewState("SortDirection") = "ASC" Then
ViewState("SortDirection") = "DESC"
Else
ViewState("SortDirection") = "ASC"
End If
Else
ViewState("SortExpression") = e.SortExpression
ViewState("SortDirection") = "ASC"
End If
Dim strDateSearch As String = txtDate.Text
LoadHistoryLog(strDateSearch)
Catch ex As Exception
writeErrorLog("GvHistoryLog_Sorting", ex.Message.ToString())
End Try
End Sub
#Region "get Database MushroomTravel"
Function getSaleMushroom() As DataTable
Dim Dt As New DataTable
Dim ClsMUser As New MushroomTravel.M_User
ClsMUser.ConnectionString = System.Configuration.ConfigurationSettings.AppSettings("MushroomTravel")
Try
With ClsMUser
.Where.WhereClauseReset()
.LoadAll()
If .DefaultView.Count > 0 Then
Dt = .DefaultView.ToTable
End If
End With
Catch ex As Exception
Dt = Nothing
Finally
ClsMUser = Nothing
End Try
Return Dt
End Function
#End Region
#Region "get Database CallCenter"
Function getCustomerLog(ByVal strDate As String) As DataTable
Dim Dt As New DataTable
Dim ClsCallLog As New CallCenterLog
Try
With ClsCallLog
.Where.WhereClauseReset()
._Proc_LoadHistoryLogByDate(strDate)
If .DefaultView.Count > 0 Then
Dt = .DefaultView.ToTable
End If
End With
Catch ex As Exception
Dt = Nothing
Finally
ClsCallLog = Nothing
End Try
Return Dt
End Function
#End Region
Protected Sub GvHistoryLog_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvHistoryLog.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.Cells(0).Text = e.Row.DataItemIndex + 1
End If
End Sub
End Class
Imports System.Data
Partial Class SystemAdmin_PaymentDetail
Inherits System.Web.UI.Page
Protected Sub btSearch_Click(sender As Object, e As EventArgs) Handles btSearch.Click
Dim strPNRCode As String = RTrim(LTrim(txtPNRCode.Text)) ' Trim(Replace(txtPNRCode.Text, " ", ""))
If Len(strPNRCode) > 5 Then
If strPNRCode <> "" Then LoadHistoryLog(strPNRCode)
If strPNRCode <> "" Then LoadHistoryLog_Log(strPNRCode) 'GDActivityLog
End If
End Sub
Sub LoadHistoryLog(ByVal strPNRCode As String) ' format yyyy-MM-dd
Try
Dim DtProductDetail As New DataTable
DtProductDetail = getProductDetail(strPNRCode)
If DtProductDetail.DefaultView.Count > 0 Then
'DtBookingDetail.DefaultView.Sort = ViewState("SortExpression") & " " & ViewState("SortDirection")
GvHistoryLog.DataSource = DtProductDetail
GvHistoryLog.DataBind()
lblResult.Text = " " & DtProductDetail.DefaultView.Count & " items."
Else
GvHistoryLog.DataSource = Nothing
GvHistoryLog.DataBind()
lblResult.Text = " 0 items."
End If
Catch ex As Exception
writeErrorLog("LoadHistoryLog", ex.Message.ToString())
End Try
End Sub
Sub LoadHistoryLog_Log(ByVal strPNRCode As String) ' format yyyy-MM-dd
Try
Dim DtProductDetail As New DataTable
DtProductDetail = getBookingDetail_ActivityLog(strPNRCode)
If DtProductDetail.DefaultView.Count > 0 Then
'DtBookingDetail.DefaultView.Sort = ViewState("SortExpression") & " " & ViewState("SortDirection")
GDActivityLog.DataSource = DtProductDetail
GDActivityLog.DataBind()
lblResult_ActivityLog.Text = " " & DtProductDetail.DefaultView.Count & " items."
Else
GDActivityLog.DataSource = Nothing
GDActivityLog.DataBind()
lblResult_ActivityLog.Text = " 0 items."
End If
Catch ex As Exception
writeErrorLog("LoadHistoryLog_Log", ex.Message.ToString())
End Try
End Sub
Sub writeErrorLog(ByVal strFunctionName As String, ByVal strError As String)
lblError.Visible = True
lblError.Text = "[" & strFunctionName & "] Err=" & strError
End Sub
#Region "get Booking Detail"
Function getProductDetail(ByVal strPNRCode As String) As DataTable
Dim Dt As New DataTable
Dim ClsMainBooking As New MainBooking
Try
With ClsMainBooking
.Where.WhereClauseReset()
._HistoryLog_BookingDetail_Payment_Current(strPNRCode)
If .DefaultView.Count > 0 Then
Dt = .DefaultView.ToTable
End If
End With
Catch ex As Exception
Dt = Nothing
Finally
ClsMainBooking = Nothing
End Try
Return Dt
End Function
Function getBookingDetail_ActivityLog(ByVal strPNRCode As String) As DataTable
Dim Dt As New DataTable
Dim ClsMainBooking As New MainBooking
Try
With ClsMainBooking
.Where.WhereClauseReset()
._HistoryLog_BookingDetail_Payment_Log(strPNRCode)
If .DefaultView.Count > 0 Then
Dt = .DefaultView.ToTable
End If
End With
Catch ex As Exception
Dt = Nothing
Finally
ClsMainBooking = Nothing
End Try
Return Dt
End Function
#End Region
Protected Sub GvHistoryLog_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GvHistoryLog.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.Cells(0).Text = e.Row.DataItemIndex + 1
End If
End Sub
Protected Sub GDActivityLog_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GDActivityLog.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.Cells(0).Text = e.Row.DataItemIndex + 1
End If
End Sub
End Class
<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="TestFunction.aspx.vb" Inherits="SystemAdmin_TestFunction" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<style type="text/css">
.auto-style2
{
text-decoration: none;
}
</style>
URL :
<asp:TextBox ID="txtURL" runat="server" Height="58px" TextMode="MultiLine" Width="400px"></asp:TextBox>
&nbsp;<asp:Button ID="BtGetData" runat="server" Text="Get Data" Width="80px" />
&nbsp;<asp:Button ID="BtClear" runat="server" Text="Clear" Width="80px" />
<br />
<br />
<asp:Label ID="Label1" runat="server" Font-Size="Medium" Text="&lt;b&gt;1. Show User All&lt;/b&gt; : http://192.168.1.3/PlexMI/?action=showuserall&amp;username=admin&plexpass=4p*plextel" ForeColor="#FF3300"></asp:Label>
<br />
<asp:Label ID="Label2" runat="server" Font-Size="Medium" Text="&lt;b&gt;2. Show Sip&lt;/b&gt; : http://192.168.1.3/PlexMI/?action=showusersip&amp;username=admin&plexpass=4p*plextel"></asp:Label>
<br />
<asp:Label ID="Label3" runat="server" Font-Size="Medium" Text="&lt;b&gt;3. Show dahdi&lt;/b&gt; : http://192.168.1.3/PlexMI/?action=showusersip&amp;username=admin&plexpass=4p*plextel"></asp:Label>
<br />
<asp:Label ID="Label4" runat="server" Font-Size="Medium" Text="&lt;b&gt;4. Show agent&lt;/b&gt; : http://192.168.1.3/PlexMI/?action=showuseragent&amp;username=admin&plexpass=4p*plextel"></asp:Label>
<br />
<asp:Label ID="Label5" runat="server" Font-Size="Medium" Text="&lt;b&gt;5. Show iax&lt;/b&gt; : http://192.168.1.3/PlexMI/?action=showuseriax&amp;username=admin&plexpass=4p*plextel"></asp:Label>
<br />
<asp:Label ID="Label6" runat="server" Font-Size="Medium" Text="&lt;b&gt;6. Show Queue&lt;/b&gt; : http://192.168.1.3/PlexMI/?action=showqueue&amp;username=admin&plexpass=4p*plextel" ForeColor="#FF3300"></asp:Label>
<br />
<asp:Label ID="Label8" runat="server" Font-Size="Medium" Text="&lt;b&gt;7. Show music on hold&lt;/b&gt; : http://192.168.1.3/PlexMI/?action=showmoh&amp;username=admin&plexpass=4p*plextel"></asp:Label>
<br />
<asp:Label ID="Label12" runat="server" Font-Size="Medium" ForeColor="Black" Text="&lt;b&gt;8. โทรออก&lt;/b&gt; : http://192.168.1.3/PlexMI/?action=dialcall&amp;value=%3Csource%3E,%3Cdestination%3E&amp;username=admin&plexpass=4p*plextel&amp;username=admin&plexpass=4p*plextel"></asp:Label>
<br />
<b>9. Show Call Record : ใช้ได้ 2 วิธี</b> <br />
&nbsp;&nbsp;&nbsp; 9.1 อ้างอิงจาก UniqueID ให้ใส่ค่าเพียงค่าเดียว <br />
&nbsp;&nbsp;&nbsp;
<a href="http://192.168.1.3/PlexMI/?action=showcallrecord&amp;value=1371096856.1&amp;username=admin&plexpass=4p*plextel">http://192.168.1.3/PlexMI/?action=showcallrecord&value=1371096856.1&username=PlexMItest&plexpass=PlexMItest</a>
<br />
&nbsp;&nbsp;&nbsp; 9.2 <a href="http://192.168.1.3/PlexMI/?action=showcallrecord&amp;value=2013-06-12,2013-06-13,6000,6001&amp;username=admin&plexpass=4p*plextel (วันที่เริ่มต้น,วันที่สิ้นสุด,เบอร์ต้นทาง,เบอร์ปลายทาง) ;วันที่ 2013-12-31 (ปี-เดือน-วัน">http://192.168.1.3/PlexMI/?action=showcallrecord&value=2013-06-12,2013-06-13,6000,6001&username=PlexMItest&plexpass=PlexMItest</a><br />
&nbsp;&nbsp;&nbsp; <a href="http://192.168.1.3/PlexMI/?action=showcallrecord&amp;value=2013-06-12,2013-06-13,6000,6001&amp;username=admin&plexpass=4p*plextel (วันที่เริ่มต้น,วันที่สิ้นสุด,เบอร์ต้นทาง,เบอร์ปลายทาง) ;วันที่ 2013-12-31 (ปี-เดือน-วัน" class="auto-style2"></a>(วันที่เริ่มต้น,วันที่สิ้นสุด,เบอร์ต้นทาง,เบอร์ปลายทาง) ;วันที่ 2013-12-31 (ปี-เดือน-วัน)
<br />
<b>10. Show Call Detail Record : ใช้ได้ 2</b> วิธี<br />
&nbsp;&nbsp;&nbsp; 10.1 อ้างอิงจาก UniqueID ให้ใส่ค่าเพียงค่าเดียว<br />
&nbsp;&nbsp;&nbsp;
<a href="http://192.168.1.3/PlexMI/?action=cdr&amp;value=1371094226.0&amp;username=admin&plexpass=4p*plextel">http://192.168.1.3/PlexMI/?action=cdr&value=1371094226.0&username=PlexMItest&plexpass=PlexMItest</a>
<br />
&nbsp;&nbsp;&nbsp; 10.2 <a href="http://192.168.1.3//PlexMI/?action=cdr&amp;value=2013-06-12,2013-06-13,6000,6001,Internal&amp;username=admin&plexpass=4p*plextel">http://192.168.1.3//PlexMI/?action=cdr&value=2013-06-12,2013-06-13,6000,6001,Internal&username=PlexMItest&plexpass=PlexMItest</a>
<br />
&nbsp;&nbsp;&nbsp;
(วันที่เริ่มต้น,วันที่สิ้นสุด,เบอร์ต้นทาง,เบอร์ปลายทาง,ค่าdirectionInternal/Outgoing/Incoming)
<br />
<b>11. การฟังเสียง </b><br />
<a href="http://192.168.1.3/listen_sound.php?fileok=callrecord/USR_IN-from-23022-to-23026@2013-02-20-13:40:03.gsm">http://192.168.1.3/listen_sound.php?fileok=callrecord/USR_IN-from-23022-to-23026@2013-02-20-13:40:03.gsm</a>
<br />
<a href="http://192.168.1.3/listen_sound.php?fileok=callrecord/USR_IN-from-23022-to-23026@2013-02-20-13:40:03.gsm">http://192.168.1.3/listen_sound.php?fileok=callrecord/USR_IN-from-23022-to-23026@2013-02-20-13:40:03.gsm</a>
<br />
<br />
<asp:Label ID="lblInformation" runat="server"></asp:Label>
<asp:GridView ID="GvData" runat="server">
</asp:GridView>
<asp:Label ID="lblError" ForeColor="#0000cc" Visible="false" runat="server" Text=""></asp:Label>
<br />
<br /> <br />
<br />
<br />
<br />
</div>
</asp:Content>
Imports MyGeneration.dOOdads
Imports System.Data
Imports System.Configuration
'----------------------------------------------------------
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports System.Net
Imports Newtonsoft.Json
Imports System.Web.Script.Serialization
Imports System.IO
Partial Class SystemAdmin_TestFunction
Inherits System.Web.UI.Page
Function getDataFromPlexTel(ByVal strURLGet As String) As DataTable
Dim DTable As New DataTable
Try
Dim objSURL As New StringBuilder
Dim objURL As Uri
Dim strURL As String
strURL = strURLGet
objSURL.Append(strURL)
objURL = New Uri(objSURL.ToString())
Dim request As HttpWebRequest = HttpWebRequest.Create(objURL)
Dim response As HttpWebResponse = request.GetResponse
Dim reader As New StreamReader(response.GetResponseStream())
If Not IsNothing(reader) Then
Dim strResponse = reader.ReadToEnd
DTable = JsonConvert.DeserializeObject(Of DataTable)(strResponse)
End If
reader.Close()
response.Close()
Catch ex As Exception
DTable = New DataTable
WriteErrorLog("getDataFromPlexTel", ex.Message.ToString(), strURLGet)
End Try
Return DTable
End Function
Protected Sub BtGetData_Click(sender As Object, e As EventArgs) Handles BtGetData.Click
Dim Dtable As New DataTable
Dim strURL As String = txtURL.Text
Try
Dtable = getDataFromPlexTel(Trim(strURL))
GvData.DataSource = Nothing
GvData.DataBind()
If Dtable.Rows.Count > 0 Then
GvData.DataSource = Dtable
GvData.DataBind()
End If
lblInformation.Text = "Result Data : " & Dtable.Rows.Count & " item."
Catch ex As Exception
WriteErrorLog("BtGetData_Click", ex.Message.ToString(), strURL)
End Try
End Sub
Sub WriteErrorLog(ByVal strFunctionName As String, ByVal strErrorName As String, ByVal strDetail As String)
lblError.Visible = True
lblError.Text = "<br>[<b>" & strFunctionName & "</b>] <b>Err</b>=" & strErrorName & "<br><b>Detail</b>:" & strDetail
End Sub
Protected Sub BtClear_Click(sender As Object, e As EventArgs) Handles BtClear.Click
lblInformation.Text = ""
txtURL.Text = ""
GvData.DataSource = Nothing
GvData.DataBind()
lblError.Visible = False
End Sub
End Class
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="TestFunction.aspx.vb" Inherits="TestFunction" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
URL :
<asp:TextBox ID="txtURL" runat="server" Height="58px" TextMode="MultiLine" Width="400px"></asp:TextBox>
&nbsp;<asp:Button ID="BtGetData" runat="server" Text="Get Data" Width="80px" />
&nbsp;<asp:Button ID="BtClear" runat="server" Text="Clear" Width="80px" />
<br />
<br />
<br />
<asp:Label ID="lblInformation" runat="server"></asp:Label>
<asp:GridView ID="GvData" runat="server">
</asp:GridView>
<asp:Label ID="lblError" ForeColor="#0000cc" Visible="false" runat="server" Text=""></asp:Label>
<br />
<br /> <br />
<br />
<br />
<br />
</div>
</form>
</body>
</html>
Imports MyGeneration.dOOdads
Imports System.Data
Imports System.Configuration
'----------------------------------------------------------
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports System.Net
Imports Newtonsoft.Json
Imports System.Web.Script.Serialization
Imports System.IO
Partial Class TestFunction
Inherits System.Web.UI.Page
Function getDataFromPlexTel(ByVal strURLGet As String) As DataTable
Dim DTable As New DataTable
Try
Dim objSURL As New StringBuilder
Dim objURL As Uri
Dim strURL As String
strURL = strURLGet
objSURL.Append(strURL)
objURL = New Uri(objSURL.ToString())
Dim request As HttpWebRequest = HttpWebRequest.Create(objURL)
Dim response As HttpWebResponse = request.GetResponse
Dim reader As New StreamReader(response.GetResponseStream())
If Not IsNothing(reader) Then
Dim strResponse = reader.ReadToEnd
DTable = JsonConvert.DeserializeObject(Of DataTable)(strResponse)
End If
reader.Close()
response.Close()
Catch ex As Exception
DTable = New DataTable
WriteErrorLog("getDataFromPlexTel", ex.Message.ToString(), strURLGet)
End Try
Return DTable
End Function
Protected Sub BtGetData_Click(sender As Object, e As EventArgs) Handles BtGetData.Click
Dim Dtable As New DataTable
Dim strURL As String = txtURL.Text
Try
Dtable = getDataFromPlexTel(Trim(strURL))
GvData.DataSource = Nothing
GvData.DataBind()
If Dtable.Rows.Count > 0 Then
GvData.DataSource = Dtable
GvData.DataBind()
End If
lblInformation.Text = "Result Data : " & Dtable.Rows.Count & " item."
Catch ex As Exception
WriteErrorLog("BtGetData_Click", ex.Message.ToString(), strURL)
End Try
End Sub
Sub WriteErrorLog(ByVal strFunctionName As String, ByVal strErrorName As String, ByVal strDetail As String)
lblError.Visible = True
lblError.Text = "<br>[<b>" & strFunctionName & "</b>] <b>Err</b>=" & strErrorName & "<br><b>Detail</b>:" & strDetail
End Sub
Protected Sub BtClear_Click(sender As Object, e As EventArgs) Handles BtClear.Click
lblInformation.Text = ""
txtURL.Text = ""
GvData.DataSource = Nothing
GvData.DataBind()
lblError.Visible = False
End Sub
End Class
<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings>
<add key="dbConnection" value="server=a.tourprox.com;uid=historylog;password=WXpQjpmCtHs1H844SKcN;database=TourProX_LastUpdate;Max Pool size=400;Connect Timeout=120;Connection Lifetime=1200;" />
<!--<add key="dbConnection" value="server=a.tourprox.com;uid=historylog;password=WXpQjpmCtHs1H844SKcN;database=TourProX_ALL;Max Pool size=400;Connect Timeout=120;Connection Lifetime=1200;"/>-->
<add key="UserName" value="admin" />
<add key="Password" value="admin1234" />
<add key="SystemAdminUserName" value="systemadmin" />
<add key="SystemAdminPassword" value="areyouready" />
</appSettings>
<system.web>
<sessionState mode="InProc" cookieless="false" timeout="20" />
<compilation debug="true" targetFramework="4.0">
</compilation>
<authentication mode="Windows" />
<globalization fileEncoding="windows-874" requestEncoding="utf-8" responseEncoding="utf-8" uiCulture="th-TH" culture="en-US" />
</system.web>
</configuration>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment