You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWebMobile/Handler/Consignation.ashx.cs

503 lines
29 KiB
C#

2 years ago
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
using DSWeb.MvcShipping.DAL.MsOpSeaeDAL;
using DSWeb.MvcShipping.Models.MsOpSeae;
using DSWebComponent;
using DSWebMobileService;
using Newtonsoft.Json;
using DSWebMobileService.Common;
namespace DSWebMobile.Handler
{
/// <summary>
/// Consignation 的摘要说明
/// </summary>
public class Consignation : IHttpHandler, System.Web.SessionState.IRequiresSessionState
{
public void ProcessRequest(HttpContext context)
{
string action = context.Request.QueryString["action"].ToString();
switch (action)
{
case "0":
GetDataListByUser(context);
break;
case "1":
GetDataInfo(context);
break;
}
}
private void GetDataInfo(HttpContext context)
{
string relBSNO = "";
string bsno = Encrypt.DesDecrypt("#7c&e@63", context.Request.QueryString["b"].ToString());
string pattern = "\0";
string replacement = "";
Regex rgx = new Regex(pattern);
relBSNO = rgx.Replace(bsno, replacement);
pattern = "\t";
Regex rgx2 = new Regex(pattern);
relBSNO = rgx2.Replace(relBSNO, replacement);
MsOpSeae head = MsOpSeaeDAL.GetData("BSNO='" + relBSNO + "'");
string BSNO = head.BSNO;
string BSSTATUSREF = head.BSSTATUSREF; //业务锁定
string FEESTATUSREF = head.FEESTATUSREF; //费用锁定
string ACCDATE = head.ACCDATE; //会计期间
string BLTYPE = head.BLTYPE; //装运方式
string CUSTOMERNAME = head.CUSTOMERNAME; //委托单位
string BSSOURCE = head.BSSOURCE; //业务来源
string BSSOURCEDETAIL = head.BSSOURCEDETAIL; //来源明细
string SALEDEPT = head.SALEDEPT; //所属部门
string OP = head.OP; //操作员
string SALE = head.SALE; //揽货人
string DOC = head.DOC; //单证
string CUSTSERVICE = head.CUSTSERVICE; //客服员
string CUSTNO = head.CUSTNO; //委托编号
string ORDERNO = head.ORDERNO; //订舱编号
string MBLNO = head.MBLNO; //主提单号
string HBLNO = head.HBLNO; //分提单号
//
bool ISFUMIGATION = head.ISFUMIGATION; //熏蒸:服务项目
bool ISSTORAGE = head.ISSTORAGE; //仓储:服务项目
bool ISLAND = head.ISLAND; //陆运:服务项目
bool ISCUSTOMS = head.ISCUSTOMS; //报关:服务项目
bool ISINSPECTION = head.ISINSPECTION; //报检:服务项目
bool ISBOOKING = head.ISBOOKING; //订舱:服务项目
bool ISAGENT = head.ISAGENT; //使用代理:服务项目
bool ISHBLNO = head.ISHBLNO; //分单签单:服务项目
//
string STLNAME = head.STLNAME; //结算方式
string STLDATE = head.STLDATE; //结算时间
string CONTRACTNO = head.CONTRACTNO; //服务合同号
string OPERATORCODE = head.OPERATORCODE; //客户操作代码
string OPERATOR = head.OP; //客户操作名称
string FINANCIALSTAFFCODE = head.FINANCIALSTAFFCODE; //客户财务代码
string FINANCIALSTAFF = head.FINANCIALSTAFF; //客户财务名称
string OPERATOREMAIL = head.OPERATOREMAIL; //操作电子邮箱
string OPERATORTEL = head.OPERATORTEL; //操作电话
string OPERATORFAX = head.OPERATORFAX; //操作传真
string FINANCIALSTAFFEMAIL = head.FINANCIALSTAFFEMAIL; //财务电子邮箱
string FINANCIALSTAFFTEL = head.FINANCIALSTAFFTEL; //财务电话
string FINANCIALSTAFFFAX = head.FINANCIALSTAFFFAX; //财务传真
//货物
string MANIFESTSTATUSREF = head.MANIFESTSTATUS; //舱单状态
string OPSTATUS = head.OPSTATUS; //费用状态
string BSDATE = head.BSDATE.ToString(); //接单日期
if (BSDATE.IndexOf("1900") == -1)
{
BSDATE = BSDATE.Substring(0, BSDATE.IndexOf(" "));
BSDATE = BSDATE.Replace("/", "-");
}
else
{
BSDATE = "";
}
string INPUTBY = head.INPUTBY; //录入人
string CORPID = head.CORPID; //分公司代码
string VESSEL = head.VESSEL; //船名
string VOYNO = head.VOYNO; //航次
string ETD = head.ETD; //到港日期
//ETD = ETD.Substring(0, ETD.IndexOf(" "));
//ETD = ETD.Replace("/", "-");
string PORTLOAD = head.PORTLOAD; //装货港
string PORTDISCHARGE = head.PORTDISCHARGE; //卸货港
string CNTRNO = head.CNTRTOTAL; //集装箱大写
string TEU = head.TEU.ToString(); //箱TEU
string CNTRTOTAL = head.CNTRTOTAL; //集装箱全部内容
string GOODSNAME = head.GOODSNAME; //品名
string KGS = head.KGS.ToString(); //毛重
KGS = KGS.Substring(0, KGS.Length - 2);
string CUSTOMSER = head.CUSTOMSER; //报关行
string PKGS = head.PKGS.ToString(); //件数
string KINDPKGS = head.KINDPKGS; //件数包装
string REMARK = head.REMARK; //备注
REMARK = REMARK.Replace("\n", " ");
REMARK = REMARK.Replace("/", "-");
REMARK = REMARK.Replace("\"", "'");
string YARD = head.YARD; //场站 靠泊码头
string CBM = head.CBM.ToString(); //立方数/尺码
CBM = CBM.Substring(0, CBM.Length - 2);
string SHIPAGENCY = head.SHIPAGENCY; //船代
//CNTRSEALNO = head.CNTRSEALNO; //箱号封号
string CARRIER = head.CARRIER; //船公司
string TRUCKER = head.TRUCKER; //承运车队
string CUSTOMSNUM = head.CUSTOMSNUM.ToString(); //报关票数
string NOPKGS = head.NOPKGS; //件数包装
string GROSSWEIGHT = head.GROSSWEIGHT; //货物毛重
string MEASUREMENT = head.MEASUREMENT; //货物尺码
string DESCRIPTION = head.DESCRIPTION; //货物描述
DESCRIPTION = DESCRIPTION.Replace("\n", " ");
DESCRIPTION = DESCRIPTION.Replace("/", "-");
DESCRIPTION = DESCRIPTION.Replace("\"", "'");
string TOTALNO = head.TOTALNO; //件数大写
string TRANSNO = head.TRANSNO; //运单号
string SHIPPERID = head.SHIPPERID; //发货人
string CONSIGNEEID = head.CONSIGNEEID; //收货人
string NOTIFYPARTYID = head.NOTIFYPARTYID; //通知人
string SHIPPER = head.SHIPPER; //发货人内容
SHIPPER = SHIPPER.Replace("\n", " ");
SHIPPER = SHIPPER.Replace("/", "-");
SHIPPER = SHIPPER.Replace("\"", "'");
string CONSIGNEE = head.CONSIGNEE; //收货人内容
CONSIGNEE = CONSIGNEE.Replace("\n", " ");
CONSIGNEE = CONSIGNEE.Replace("/", "-");
CONSIGNEE = CONSIGNEE.Replace("\"", "'");
string NOTIFYPARTY = head.NOTIFYPARTY; //通知人内容
NOTIFYPARTY = NOTIFYPARTY.Replace("\n", " ");
NOTIFYPARTY = NOTIFYPARTY.Replace("/", "-");
NOTIFYPARTY = NOTIFYPARTY.Replace("\"", "'");
string AGENTID = head.AGENTID; //国外代理
string AGENT = head.AGENT; //国外代理内容
AGENT = AGENT.Replace("\n", " ");
AGENT = AGENT.Replace("/", "-");
AGENT = AGENT.Replace("\"", "'");
//其它
string CLOSINGDATE = head.CLOSINGDATE; //截港日期
if (CLOSINGDATE != null && CLOSINGDATE != "")
{
if (CLOSINGDATE.IndexOf("1900") == -1)
{
CLOSINGDATE = CLOSINGDATE.Substring(0, CLOSINGDATE.IndexOf(" "));
CLOSINGDATE = CLOSINGDATE.Replace("/", "-");
}
else
{
CLOSINGDATE = "";
}
}
string ETA = head.ETA; //预抵日期
if (ETA != null && ETA != "")
{
if (ETA.IndexOf("1900") == -1)
{
//ETA = ETA.Substring(0, ETA.IndexOf(" "));
//ETA = ETA.Replace("/", "-");
}
else
{
ETA = "";
}
}
string PlACERECEIPT = head.PLACERECEIPT; //收货地
string PLACEDELIVERY = head.PLACEDELIVERY; //交货地
string DESTINATION = head.DESTINATION; //目的地
string NOBILL = head.NOBILL; //提单份数
string ISSUETYPE = head.ISSUETYPE; //签单方式
string ISSUEDATE = head.ISSUEDATE; //签单日期
if (ISSUEDATE != null && ISSUEDATE != "")
{
if (ISSUEDATE.IndexOf("1900") == -1)
{
//ISSUEDATE = ISSUEDATE.Substring(0, ISSUEDATE.IndexOf(" "));
//ISSUEDATE = ISSUEDATE.Replace("/", "-");
}
else
{
ISSUEDATE = "";
}
}
string ISSUEPLACE = head.ISSUEPLACE; //签单地点
string BLFRT = head.BLFRT; //付费方式
string PREPARDAT = head.PREPARDAT; //预付地点
string PAYABLEAT = head.PAYABLEAT; //到付地点
string SERVICE = head.SERVICE; //运输条款
string MARKS = head.MARKS; //唛头
MARKS = MARKS.Replace("\n", " ");
MARKS = MARKS.Replace("/", "-");
MARKS = MARKS.Replace("\"", "'");
string LANE = head.LANE; //航线
string FORWARDER = head.FORWARDER; //订舱公司
string INVNO = head.INVNO; //发票号
string CARGOID = head.CARGOID; //货物标识
string DCLASS = head.DCLASS; //危险品分类/等级
string DUNNO = head.DUNNO; //危险品编号
string REEFERF = head.REEFERF; //冷藏通风量
string TEMPID = head.TEMPID; //温度单位
string TEMPSET = head.TEMPSET; //设置温度
string PACKINGTYPE = head.PACKINGTYPE; //装箱类型
string WAREHOUSE = head.WAREHOUSE; //仓库
string CLOSEDOCDATE = head.CLOSEDOCDATE; //截单日期
if (CLOSEDOCDATE != null && CLOSEDOCDATE != "")
{
if (CLOSEDOCDATE.IndexOf("1900") == -1)
{
CLOSEDOCDATE = CLOSEDOCDATE.Substring(0, CLOSEDOCDATE.IndexOf(" "));
CLOSEDOCDATE = CLOSEDOCDATE.Replace("/", "-");
}
else
{
CLOSEDOCDATE = "";
}
}
string INTOPORTDATE = head.INTOPORTDATE; //集港日期
if (INTOPORTDATE != null && INTOPORTDATE != "")
{
if (INTOPORTDATE.IndexOf("1900") == -1)
{
INTOPORTDATE = INTOPORTDATE.Substring(0, INTOPORTDATE.IndexOf(" "));
INTOPORTDATE = INTOPORTDATE.Replace("/", "-");
}
else
{
INTOPORTDATE = "";
}
}
string MBLFRT = head.MBLFRT; //MBL付费方式
string SOURCECODE = head.SOURCECODE; //集装箱(器)来源代码
string DPAGE = head.DPAGE; //危险品页号
string DLABEL = head.DLABEL; //危险品标签
string LINKMAN = head.LINKMAN; //危险品联系人
string VESSELID = head.VESSELID; //船舶呼号
string ISSUEPLACEID = head.ISSUEPLACEID; //提单签发地代码
string HSCODE = head.HSCODE; //HS编码
//var json = JsonConvert.SerializeObject(head);
string json = "";
json += "{";
json += "\"BSNO\" : \"" + BSNO + "\", "; //业务编号
json += "\"BSSTATUSREF\" : \"" + BSSTATUSREF + "\", "; //业务锁定
json += "\"FEESTATUSREF\" : \"" + FEESTATUSREF + "\", "; //费用锁定
json += "\"ACCDATE\" : \"" + ACCDATE + "\", "; //会计期间
json += "\"BLTYPE\" : \"" + BLTYPE + "\", "; //装运方式
json += "\"CUSTOMERNAME\" : \"" + CUSTOMERNAME + "\", "; //委托单位
json += "\"BSSOURCE\" : \"" + BSSOURCE + "\", "; //业务来源
json += "\"BSSOURCEDETAIL\" : \"" + BSSOURCEDETAIL + "\", "; //来源明细
json += "\"SALEDEPT\" : \"" + SALEDEPT + "\", "; //所属部门
json += "\"OP\" : \"" + OP + "\", "; //操作员
json += "\"SALE\" : \"" + SALE + "\", "; //揽货人
json += "\"DOC\" : \"" + DOC + "\", "; //单证
json += "\"CUSTSERVICE\" : \"" + CUSTSERVICE + "\", "; //客服员
json += "\"CUSTNO\" : \"" + CUSTNO + "\", "; //委托编号
json += "\"ORDERNO\" : \"" + ORDERNO + "\", "; //订舱编号
json += "\"MBLNO\" : \"" + MBLNO + "\", "; //主提单号
json += "\"HBLNO\" : \"" + HBLNO + "\", "; //分提单号
json += "\"ISFUMIGATION\" : \"" + ISFUMIGATION + "\", "; //熏蒸: \"" + 服务项目
json += "\"ISSTORAGE\" : \"" + ISSTORAGE + "\", "; //仓储: \"" + 服务项目
json += "\"ISLAND\" : \"" + ISLAND + "\", "; //陆运: \"" + 服务项目
json += "\"ISCUSTOMS\" : \"" + ISCUSTOMS + "\", "; //报关: \"" + 服务项目
json += "\"ISINSPECTION\" : \"" + ISINSPECTION + "\", "; //报检: \"" + 服务项目
json += "\"ISBOOKING\" : \"" + ISBOOKING + "\", "; //订舱: \"" + 服务项目
json += "\"ISAGENT\" : \"" + ISAGENT + "\", "; //使用代理: \"" + 服务项目
json += "\"ISHBLNO\" : \"" + ISHBLNO + "\", "; //分单签单: \"" + 服务项目
json += "\"STLNAME\" : \"" + STLNAME + "\", "; //结算方式
json += "\"STLDATE\" : \"" + STLDATE + "\", "; //结算时间
json += "\"CONTRACTNO\" : \"" + CONTRACTNO + "\", "; //服务合同号
json += "\"OPERATORCODE\" : \"" + OPERATORCODE + "\", "; //客户操作代码
json += "\"OPERATOR\" : \"" + OPERATOR + "\", "; //客户操作名称
json += "\"FINANCIALSTAFFCODE\" : \"" + FINANCIALSTAFFCODE + "\", "; //客户财务代码
json += "\"FINANCIALSTAFF\" : \"" + FINANCIALSTAFF + "\", "; //客户财务名称
json += "\"OPERATOREMAIL\" : \"" + OPERATOREMAIL + "\", "; //操作电子邮箱
json += "\"OPERATORTEL\" : \"" + OPERATORTEL + "\", "; //操作电话
json += "\"OPERATORFAX\" : \"" + OPERATORFAX + "\", "; //操作传真
json += "\"FINANCIALSTAFFEMAIL\" : \"" + FINANCIALSTAFFEMAIL + "\", "; //财务电子邮箱
json += "\"FINANCIALSTAFFTEL\" : \"" + FINANCIALSTAFFTEL + "\", "; //财务电话
json += "\"FINANCIALSTAFFFAX\" : \"" + FINANCIALSTAFFFAX + "\", "; //财务传真
json += "\"MANIFESTSTATUSREF\" : \"" + MANIFESTSTATUSREF + "\", "; //舱单状态
json += "\"OPSTATUS\" : \"" + OPSTATUS + "\", "; //费用状态
json += "\"BSDATE\" : \"" + BSDATE + "\", "; //接单日期
json += "\"INPUTBY\" : \"" + INPUTBY + "\", "; //录入人
json += "\"CORPID\" : \"" + CORPID + "\", "; //分公司代码
json += "\"VESSEL\" : \"" + VESSEL + "\", "; //船名
json += "\"VOYNO\" : \"" + VOYNO + "\", "; //航次
json += "\"ETD\" : \"" + ETD + "\", "; //到港日期
json += "\"PORTLOAD\" : \"" + PORTLOAD + "\", "; //装货港
json += "\"PORTDISCHARGE\" : \"" + PORTDISCHARGE + "\", "; //卸货港
json += "\"CNTRNO\" : \"" + CNTRNO + "\", "; //集装箱大写
json += "\"TEU\" : \"" + TEU + "\", "; //箱TEU
json += "\"CNTRTOTAL\" : \"" + CNTRTOTAL + "\", "; //集装箱全部内容
json += "\"GOODSNAME\" : \"" + GOODSNAME + "\", "; //品名
json += "\"KGS\" : \"" + KGS + "\", "; //毛重
json += "\"CUSTOMSER\" : \"" + CUSTOMSER + "\", "; //报关行
json += "\"PKGS\" : \"" + PKGS + "\", "; //件数
json += "\"KINDPKGS\" : \"" + KINDPKGS + "\", "; //件数包装
json += "\"REMARK\" : \"" + REMARK + "\", "; //备注
json += "\"YARD\" : \"" + YARD + "\", "; //场站 靠泊码头
json += "\"CBM\" : \"" + CBM + "\", "; //立方数/尺码
json += "\"SHIPAGENCY\" : \"" + SHIPAGENCY + "\", "; //船代
json += "\"CARRIER\" : \"" + CARRIER + "\", "; //船公司
json += "\"TRUCKER\" : \"" + TRUCKER + "\", "; //承运车队
json += "\"CUSTOMSNUM\" : \"" + CUSTOMSNUM + "\", "; //报关票数
json += "\"NOPKGS\" : \"" + NOPKGS + "\", "; //件数包装
json += "\"GROSSWEIGHT\" : \"" + GROSSWEIGHT + "\", "; //货物毛重
json += "\"MEASUREMENT\" : \"" + MEASUREMENT + "\", "; //货物尺码
json += "\"DESCRIPTION\" : \"" + DESCRIPTION + "\", "; //货物描述
json += "\"TOTALNO\" : \"" + TOTALNO + "\", "; //件数大写
json += "\"TRANSNO\" : \"" + TRANSNO + "\", "; //运单号
json += "\"SHIPPERID\" : \"" + SHIPPERID + "\", "; //发货人
json += "\"CONSIGNEEID\" : \"" + CONSIGNEEID + "\", "; //收货人
json += "\"NOTIFYPARTYID\" : \"" + NOTIFYPARTYID + "\", "; //通知人
json += "\"SHIPPER\" : \"" + SHIPPER + "\", "; //发货人内容
json += "\"CONSIGNEE\" : \"" + CONSIGNEE + "\", "; //收货人内容
json += "\"NOTIFYPARTY\" : \"" + NOTIFYPARTY + "\", "; //通知人内容
json += "\"AGENTID\" : \"" + AGENTID + "\", "; //国外代理
json += "\"AGENT\" : \"\", "; //" + AGENT + "国外代理内容
json += "\"CLOSINGDATE\" : \"" + CLOSINGDATE + "\", "; //截港日期
json += "\"ETA\" : \"" + ETA + "\", "; //预抵日期
json += "\"PlACERECEIPT\" : \"" + PlACERECEIPT + "\", "; //收货地
json += "\"PLACEDELIVERY\" : \"" + PLACEDELIVERY + "\", "; //交货地
json += "\"DESTINATION\" : \"" + DESTINATION + "\", "; //目的地
json += "\"NOBILL\" : \"" + NOBILL + "\", "; //提单份数
json += "\"ISSUETYPE\" : \"" + ISSUETYPE + "\", "; //签单方式
json += "\"ISSUEDATE\" : \"" + ISSUEDATE + "\", "; //签单日期
json += "\"ISSUEPLACE\" : \"" + ISSUEPLACE + "\", "; //签单地点
json += "\"BLFRT\" : \"" + BLFRT + "\", "; //付费方式
json += "\"PREPARDAT\" : \"" + PREPARDAT + "\", "; //预付地点
json += "\"PAYABLEAT\" : \"" + PAYABLEAT + "\", "; //到付地点
json += "\"SERVICE\" : \"" + SERVICE + "\", "; //运输条款
json += "\"MARKS\" : \"" + MARKS + "\", "; //唛头
json += "\"LANE\" : \"" + LANE + "\", "; //航线
json += "\"FORWARDER\" : \"" + FORWARDER + "\", "; //订舱公司
json += "\"INVNO\" : \"" + INVNO + "\", "; //发票号
json += "\"CARGOID\" : \"" + CARGOID + "\", "; //货物标识
json += "\"DCLASS\" : \"" + DCLASS + "\", "; //危险品分类/等级
json += "\"DUNNO\" : \"" + DUNNO + "\", "; //危险品编号
json += "\"REEFERF\" : \"" + REEFERF + "\", "; //冷藏通风量
json += "\"TEMPID\" : \"" + TEMPID + "\", "; //温度单位
json += "\"TEMPSET\" : \"" + TEMPSET + "\", "; //设置温度
json += "\"PACKINGTYPE\" : \"" + PACKINGTYPE + "\", "; //装箱类型
json += "\"WAREHOUSE\" : \"" + WAREHOUSE + "\", "; //仓库
json += "\"CLOSEDOCDATE\" : \"" + CLOSEDOCDATE + "\", "; //截单日期
json += "\"INTOPORTDATE\" : \"" + INTOPORTDATE + "\", "; //集港日期
json += "\"MBLFRT\" : \"" + MBLFRT + "\", "; //MBL付费方式
json += "\"SOURCECODE\" : \"" + SOURCECODE + "\", "; //集装箱(器)来源代码
json += "\"DPAGE\" : \"" + DPAGE + "\", "; //危险品页号
json += "\"DLABEL\" : \"" + DLABEL + "\", "; //危险品标签
json += "\"LINKMAN\" : \"" + LINKMAN + "\", "; //危险品联系人
json += "\"VESSELID\" : \"" + VESSELID + "\", "; //船舶呼号
json += "\"ISSUEPLACEID\" : \"" + ISSUEPLACEID + "\", "; //提单签发地代码
json += "\"HSCODE\" : \"" + HSCODE + "\" "; //HS编码 /**/
json += "}";
string result = "[" + json + "]";
//string result = "[{\" BSNO \":\"111\"}]";
context.Response.ContentType = "text/plain";
context.Response.Write(result.ToString());
context.Response.End();
}
private void GetDataListByUser(HttpContext context)
{
string relStrCondition = "";
string relETDFromDate = "";
string relETDToDate = "";
string relAccFromDate = "";
string relAccToDate = "";
string aaa = context.Request.Form["ef"].ToString();
string strCondition = Encrypt.DesDecrypt("#7c&e@63", context.Request.Form["s"].ToString());
string etdFromDate = Encrypt.DesDecrypt("#7c&e@63", context.Request.Form["ef"].ToString());
string etdToDate = Encrypt.DesDecrypt("#7c&e@63", context.Request.Form["et"].ToString());
string accFromDate = Encrypt.DesDecrypt("#7c&e@63", context.Request.Form["af"].ToString());
string accToDate = Encrypt.DesDecrypt("#7c&e@63", context.Request.Form["at"].ToString());
string pattern = "\0";
string replacement = "";
int start = int.Parse(context.Request.QueryString["t"].ToString());
int limit = int.Parse(context.Request.QueryString["l"].ToString());
Regex rgx = new Regex(pattern);
relStrCondition = rgx.Replace(strCondition, replacement);
relETDFromDate = rgx.Replace(etdFromDate, replacement);
relETDToDate = rgx.Replace(etdToDate, replacement);
relAccFromDate = rgx.Replace(accFromDate, replacement);
relAccToDate = rgx.Replace(accToDate, replacement);
pattern = "\t";
Regex rgx2 = new Regex(pattern);
relStrCondition = rgx2.Replace(relStrCondition, replacement);
relETDFromDate = rgx.Replace(relETDFromDate, replacement);
relETDToDate = rgx.Replace(relETDToDate, replacement);
relAccFromDate = rgx.Replace(relAccFromDate, replacement);
relAccToDate = rgx.Replace(relAccToDate, replacement);
if (strCondition != "")
{
if (relStrCondition[0] == ',') { relStrCondition = relStrCondition.Substring(1, relStrCondition.Length - 1); }
}
if (relStrCondition != "" && relETDFromDate != "")
{
relStrCondition += " and ETD>='" + relETDFromDate + " 00:00:00'";
}
else if (relStrCondition != "" && relETDFromDate == "")
{
//relStrCondition += " and B.ETD>='" + DateTime.Today.Year.ToString() + "-" + DateTime.Today.Month.ToString() + "-01 00:00:00'";
}
else if (relStrCondition == "" && relETDFromDate != "")
{
relStrCondition += " ETD>='" + relETDFromDate + " 00:00:00'";
}
else if (relStrCondition == "" && relETDFromDate == "")
{
relStrCondition += " ETD>='" + DateTime.Today.Year.ToString() + "-" + DateTime.Today.Month.ToString() + "-01 00:00:00'";
}
if (relETDFromDate != "" && relETDToDate != "") { relStrCondition += " and ETD<='" + relETDToDate + " 23:59:59'"; }
else if (relStrCondition.IndexOf("ETD") != -1 && relETDToDate == "")
{
if (DateTime.Today.Month.ToString() == "01" || DateTime.Today.Month.ToString() == "03" || DateTime.Today.Month.ToString() == "05" || DateTime.Today.Month.ToString() == "07" || DateTime.Today.Month.ToString() == "08" || DateTime.Today.Month.ToString() == "10" || DateTime.Today.Month.ToString() == "12") { relStrCondition += " and ETD<='" + DateTime.Today.Year.ToString() + "-" + DateTime.Today.Month.ToString() + "-31 23:59:59'"; }
else if (DateTime.Today.Month.ToString() == "04" || DateTime.Today.Month.ToString() == "06" || DateTime.Today.Month.ToString() == "09" || DateTime.Today.Month.ToString() == "11") { relStrCondition += " and ETD<='" + DateTime.Today.Year.ToString() + "-" + DateTime.Today.Month.ToString() + "-30 23:59:59'"; }
else if (DateTime.Today.Month.ToString() == "02") { relStrCondition += " and ETD<='" + DateTime.Today.Year.ToString() + "-" + DateTime.Today.Month.ToString() + "-29 23:59:59'"; }
}
if (relStrCondition != "" && relAccFromDate != "") { relStrCondition += " and ACCDATE>='" + relAccFromDate.Substring(0, 7) + "'"; }
else if (relStrCondition == "" && relAccFromDate != "") { relStrCondition += " ACCDATE>='" + relAccFromDate.Substring(0, 7) + "'"; }
if (relAccToDate != "") { relStrCondition += " and ACCDATE<='" + relAccToDate.Substring(0,7) + "'"; }
var dataList = DSWebMobileService.MsOpSeaeServer.GetDataList(relStrCondition, SessionUtil.Session["USERID"].ToString(), SessionUtil.Session["SHOWNAME"].ToString(), SessionUtil.Session["COMPANYID"].ToString(), "", "true");
//var list = dataList.Skip(start).Take(limit);
string json = JsonConvert.SerializeObject(dataList);
StringBuilder sb = new StringBuilder();
context.Response.ContentType = "text/plain";
context.Response.Write(json);
context.Response.End();
}
public bool IsReusable
{
get
{
return false;
}
}
}
}