Exemplo n.º 1
0
    private void GetRoleList()
    {
        int iCount     = 6;
        int iPageIndex = yeyRequest.Params("pageindex") == null ? 1 : Convert.ToInt32(yeyRequest.Params("pageindex"));
        int iPageCount = yeyRequest.Params("hPageNum") == null ? 0 : Convert.ToInt32(yeyRequest.Params("hPageNum"));

        ccWhere.Clear();
        //ccWhere.AddComponent("isdel", "0", SearchComponent.Equals, SearchPad.NULL);

        servComm.strOrderString = " ID desc ";
        IList <JX_USERS> scenerylist = servComm.GetList <JX_USERS>(JX_USERS.STRTABLENAME, "*", JX_USERS.STRKEYNAME, iCount, iPageIndex, iPageCount, ccWhere);

        if (iPageCount <= 1)
        {
            iPageCount = servComm.PageCount;
            iPageIndex = 1;
        }

        string backstr = Json.ListToJson("replyJson", scenerylist, string.Format("\"PageCount\":\"{0}\",", iPageCount)).Replace("\n", "<br/>").Replace("\r", "<br/>");

        if (backstr.IndexOf("\\") >= 0)
        {
            backstr = backstr.Replace("\\", "\\\\");
        }

        Response.Write(backstr);
        Response.End();
    }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(Request["hDelete"]))
        {
            servComm.ExecuteSql(" delete from JX_USERS where ID='" + Request["hDelete"] + "'");
        }

        ccWhere.Clear();
        if (!String.IsNullOrEmpty(Request["txtJGCName"]))
        {
            ccWhere.AddComponent("JGCName", Request["txtJGCName"], SearchComponent.Like, SearchPad.NULL);
        }

        hddpnumbers = Request["hpnumbers"];
        int iCount = 10;

        if (!string.IsNullOrEmpty(hddpnumbers))
        {
            iCount = Convert.ToInt32(hddpnumbers);
        }
        int iPageIndex = string.IsNullOrEmpty(Request["sPageID"]) ? 1 : Convert.ToInt32(Request["sPageID"]);
        int iPageCount = string.IsNullOrEmpty(Request["sPageNum"]) ? 0 : Convert.ToInt32(Request["sPageNum"]);

        servComm.strOrderString = " LastModifyTime desc ";
        IList <JX_USERS> ilist = servComm.GetList <JX_USERS>(JX_USERS.STRTABLENAME, "*", JX_USERS.STRKEYNAME, iCount, iPageIndex, iPageCount, ccWhere);

        repUserList.DataSource = ilist;
        repUserList.DataBind();
        pagecut1.iPageNum = servComm.PageCount;
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        servComm = new ServiceCommon(base.factoryConnectionString);
        if (!IsPostBack)
        {
        }

        ccWhere.Clear();
        hddpnumbers = Request["hpnumbers"];
        int iCount = 10;
        //if (!string.IsNullOrEmpty(hddpnumbers))
        //{
        //    iCount = Convert.ToInt32(hddpnumbers);
        //}
        int iPageIndex = string.IsNullOrEmpty(Request["sPageID"]) ? 1 : Convert.ToInt32(Request["sPageID"]);
        int iPageCount = string.IsNullOrEmpty(Request["sPageNum"]) ? 0 : Convert.ToInt32(Request["sPageNum"]);

        string txttxtPatient = Request["txtPatient"];

        if (!string.IsNullOrEmpty(txttxtPatient))
        {
            ccWhere.AddComponent("patient ", txttxtPatient, SearchComponent.Like, SearchPad.And);
        }

        string selectedID    = Request["selectedID"];
        string selectedLevel = Request["selectedLevel"];

        if (!String.IsNullOrEmpty(selectedLevel) && !String.IsNullOrEmpty(selectedID))
        {
            if (selectedLevel == "0")
            {
                ccWhere.AddComponent("sellerid ", selectedID, SearchComponent.Equals, SearchPad.And);
            }
            else if (selectedLevel == "1")
            {
                ccWhere.AddComponent("HospitalID ", selectedID, SearchComponent.Equals, SearchPad.And);
            }
            else if (selectedLevel == "2")
            {
                ccWhere.AddComponent("DoctorID ", selectedID, SearchComponent.Equals, SearchPad.And);
            }
        }

        GetFilterByKind(ref ccWhere, "orders");

        servComm.strOrderString = " regtime desc ";
        IList <ORDERSDETAIL> ilist = servComm.GetList <ORDERSDETAIL>(ORDERSDETAIL.STRTABLENAME, "regtime,Order_ID,seller,sellerid,hospital,hospitalid,doctor,patient,productName,Valid", ORDERSDETAIL.STRKEYNAME, iCount, iPageIndex, iPageCount, ccWhere);

        this.repOrderList.DataSource = ilist;
        repOrderList.DataBind();
        pagecut1.iPageNum = servComm.PageCount;
    }
Exemplo n.º 4
0
    private void BindList()
    {
        int iCount = 10;

        if (!string.IsNullOrEmpty(hddpnumbers))
        {
            iCount = Convert.ToInt32(hddpnumbers);
        }
        int iPageIndex = string.IsNullOrEmpty(Request["sPageID"]) ? 1 : Convert.ToInt32(Request["sPageID"]);
        int iPageCount = string.IsNullOrEmpty(Request["sPageNum"]) ? 0 : Convert.ToInt32(Request["sPageNum"]);

        if (!String.IsNullOrEmpty(Request["ModelNo"]))
        {
            ccWhere.Clear();
            ccWhere.AddComponent("ModelNo", Request["ModelNo"], SearchComponent.Equals, SearchPad.NULL);
            servComm.strOrderString = " CreateDate desc ";
            IList <WORDERSATTACHMENTS> ilist = servComm.GetList <WORDERSATTACHMENTS>(WORDERSATTACHMENTS.STRTABLENAME, "*", WORDERSATTACHMENTS.STRKEYNAME, iCount, iPageIndex, iPageCount, ccWhere);
            this.repOrderList.DataSource = ilist;
            this.pagecut1.iPageNum       = servComm.PageCount;
        }
        repOrderList.DataBind();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        string actiontype = Request["actiontype"];

        if (actiontype == "GetSaleList")
        {
            ConstructionCondition();

            int iPageCount = 0;
            int iPageIndex = int.Parse(Request["PageIndex"]) + 1;
            servComm.strOrderString = "CardNo";
            listObj = servComm.GetList <ModelOrders>("orders", "*", "CardNo", 10, iPageIndex, iPageCount, ccwhere);
            var timeConvert = new IsoDateTimeConverter();
            //timeConvert.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
            timeConvert.DateTimeFormat = "yyyy-MM-dd";
            string responseJson = JsonConvert.SerializeObject(listObj, Formatting.Indented, timeConvert);
            Response.Write("[{\"RowCount\":" + servComm.RowCount + ",\"JsonData\":" + responseJson + "}]");
            Response.End();
        }
        else if (actiontype == "ExportExcel")
        {
            ConstructionCondition();

            servComm.strOrderString = "CardNo";
            listObj = servComm.GetListTop <ModelOrders>(0, "*", "orders", ccwhere);
            string shortName = DateTime.Now.ToString("yyyyMMddHHmmsshhh") + ".xlsx";
            string fileName  = Request.PhysicalApplicationPath + "UploadFile\\" + shortName;
            using (NPOIHelper excelHelper = new NPOIHelper(fileName, Request.PhysicalApplicationPath + "UploadFile\\"))
            {
                DataTable dtTable = listObj.ToDataTable();
                int       count   = excelHelper.DataTableToExcel(dtTable, "工厂订单信息", true, "工厂订单信息.xlsx");
            }
            Response.Write("http://" + Request.Url.Authority + "//UploadFile//" + shortName);
            Response.End();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!String.IsNullOrEmpty(Request["customertype"]))
        {
            CustomerType = Request["customertype"];
        }
        string actiontype = Request["actiontype"];

        if (actiontype == "GetCustomerManageList")
        {
            string Serial = Request["Serial"];
            ccwhere.AddComponent("Class", "S", SearchComponent.UnEquals, SearchPad.And);
            if (!String.IsNullOrEmpty(Serial))
            {
                ccwhere.AddComponent("Serial", "%" + Serial + "%", SearchComponent.Like, SearchPad.And);
            }
            string Class = Request["Class"];
            if (!String.IsNullOrEmpty(Class))
            {
                ccwhere.AddComponent("Class", "%" + Class + "%", SearchComponent.Like, SearchPad.And);
            }

            string Client = Request["Client"];
            if (!String.IsNullOrEmpty(Client))
            {
                ccwhere.AddComponent("Client", "%" + Client + "%", SearchComponent.Like, SearchPad.And);
            }

            string linkman = Request["linkman"];
            if (!String.IsNullOrEmpty(linkman))
            {
                ccwhere.AddComponent("linkman", "%" + linkman + "%", SearchComponent.Like, SearchPad.And);
            }

            int iPageCount = 0;
            int iPageIndex = int.Parse(Request["PageIndex"]) + 1;
            servComm.strOrderString = "Id desc";
            listObj = servComm.GetList <ModelClient>("Client", "*", "Id", 10, iPageIndex, iPageCount, ccwhere);

            var timeConvert = new IsoDateTimeConverter();
            //timeConvert.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
            timeConvert.DateTimeFormat = "yyyy-MM-dd";
            string responseJson = JsonConvert.SerializeObject(listObj, Formatting.Indented, timeConvert);
            Response.Write("[{\"RowCount\":" + servComm.RowCount + ",\"JsonData\":" + responseJson + "}]");
            Response.End();
        }
        else if (actiontype == "ExportExcel")
        {
            string BillNo = Request["BillNo"];
            if (!String.IsNullOrEmpty(BillNo))
            {
                ccwhere.AddComponent("BillNo", "%" + BillNo + "%", SearchComponent.Like, SearchPad.And);
            }
            string Salesperson = Request["Salesperson"];
            if (!String.IsNullOrEmpty(Salesperson))
            {
                ccwhere.AddComponent("Salesperson", "%" + Salesperson + "%", SearchComponent.Like, SearchPad.And);
            }
            string IsDel = Request["IsDel"];
            if (!String.IsNullOrEmpty(IsDel))
            {
                ccwhere.AddComponent("IsDel", "1", SearchComponent.Equals, SearchPad.And);
            }
            else
            {
                ccwhere.AddComponent("Isnull(IsDel,0)", "1", SearchComponent.UnEquals, SearchPad.And);
            }

            servComm.strOrderString = "Id";
            listObj = servComm.GetListTop <ModelClient>(0, "[Id],[SaleDate],[seller],[Salesperson],[BillDate],[BillNo],[BillClass],[Reg],[RegTime]", "Sale", ccwhere);
            string shortName = DateTime.Now.ToString("yyyyMMddHHmmsshhh") + ".xlsx";
            string fileName  = Request.PhysicalApplicationPath + "UploadFile\\" + shortName;
            using (NPOIHelper excelHelper = new NPOIHelper(fileName, Request.PhysicalApplicationPath + "UploadFile\\"))
            {
                DataTable dtTable = listObj.ToDataTable();
                dtTable.Columns.Remove("IsDel");
                int count = excelHelper.DataTableToExcel(dtTable, "订单信息", true);
            }
            Response.Write("http://" + Request.Url.Authority + "//UploadFile//" + shortName);
            Response.End();
        }
        else if (Request["actiontype"] == "SaveCustomer")
        {
            int identityID = 0;
            try
            {
                ModelClient modelClient = new ModelClient();
                if (String.IsNullOrEmpty(Request["Id"]))
                {
                    modelClient.Class    = Request["Class"];
                    modelClient.Serial   = Request["Serial"];
                    modelClient.Client   = Request["Client"];
                    modelClient.linkman  = Request["linkman"];
                    modelClient.Tel      = Request["Tel"];
                    modelClient.Tel2     = Request["Tel2"];
                    modelClient.Country  = Request["Country"];
                    modelClient.Province = Request["Province"];
                    modelClient.City     = Request["City"];
                    modelClient.Email    = Request["Email"];
                    modelClient.Addr     = Request["Addr"];
                    modelClient.UserName = Request["UserName"];

                    if (servComm.ExecuteSqlDatatable("select ID from Client where UserName ='******'").Rows.Count > 0)
                    {
                        identityID = -1;
                    }
                    else
                    {
                        string password = CryptoHelper.StaticEncrypt("1");
                        //}
                        modelClient.Passwd = password;
                        identityID         = servComm.Add(modelClient);
                    }
                    //string password = Request["Passwd"];
                    //if (!String.IsNullOrEmpty(password))
                    //{
                }
                else
                {
                    if (String.IsNullOrEmpty(Request["Class"]))
                    {
                        identityID = servComm.ExecuteSql(" delete from Client where ID in (" + Request["Id"] + ");");
                    }
                    else
                    {
                        identityID           = int.Parse(Request["Id"]);
                        modelClient.Class    = Request["Class"];
                        modelClient.Serial   = Request["Serial"];
                        modelClient.Client   = Request["Client"];
                        modelClient.linkman  = Request["linkman"];
                        modelClient.Tel      = Request["Tel"];
                        modelClient.Tel2     = Request["Tel2"];
                        modelClient.Country  = Request["Country"];
                        modelClient.Province = Request["Province"];
                        modelClient.City     = Request["City"];
                        modelClient.Email    = Request["Email"];
                        modelClient.Addr     = Request["Addr"];
                        modelClient.UserName = Request["UserName"];

                        if (servComm.ExecuteSqlDatatable("select ID from Client where UserName ='******' and ID !=" + identityID).Rows.Count > 0)
                        {
                            identityID = -1;
                        }
                        else
                        {
                            string password = Request["Passwd"];
                            if (!String.IsNullOrEmpty(password))
                            {
                                password = CryptoHelper.StaticEncrypt("1");
                            }
                            modelClient.Passwd = password;
                            modelClient.ID     = identityID;
                            int result = servComm.Update(modelClient);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Response.Write(0);
                Response.End();
            }

            Response.Write(identityID);
            Response.End();
        }
    }
Exemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            listClassType = DataCache.findAllDict().Where(model => model.ClassID == "MaterialType").ToList();
            listClassType.Insert(0, new ModelDictDetail()
            {
            });
        }
        string actiontype = Request["actiontype"];

        if (actiontype == "GetSpecManageList")
        {
            string Bh = Request["Bh"];
            if (!String.IsNullOrEmpty(Bh))
            {
                ccwhere.AddComponent("Bh", "%" + Bh + "%", SearchComponent.Like, SearchPad.And);
            }
            string Class = Request["Class"];
            if (!String.IsNullOrEmpty(Class))
            {
                ccwhere.AddComponent("Class", Class, SearchComponent.Equals, SearchPad.And);
            }
            string OrderNo = Request["OrderNo"];
            if (!String.IsNullOrEmpty(OrderNo))
            {
                ccwhere.AddComponent("OrderNo", "%" + OrderNo + "%", SearchComponent.Like, SearchPad.And);
            }



            int iPageCount = 0;
            int iPageIndex = int.Parse(Request["PageIndex"]) + 1;
            servComm.strOrderString = "Id desc ";
            listObj = servComm.GetList <ModelSpec>("Spec", "*", "Id", 10, iPageIndex, iPageCount, ccwhere);
            listObj.ToList().ForEach(eo => eo.Class = (listClassType.Where(le => le.Code == eo.Class).Count() > 0 ? listClassType.Where(le => le.Code == eo.Class).FirstOrDefault().DictName : ""));


            var timeConvert = new IsoDateTimeConverter();
            //timeConvert.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
            timeConvert.DateTimeFormat = "yyyy-MM-dd";


            string responseJson = JsonConvert.SerializeObject(listObj, Formatting.Indented, timeConvert);
            responseJson = responseJson.Replace(": null", ": \"\"");
            Response.Write("[{\"RowCount\":" + servComm.RowCount + ",\"JsonData\":" + responseJson + "}]");
            Response.End();
        }
        else if (actiontype == "ExportExcel")
        {
            string BillNo = Request["BillNo"];
            if (!String.IsNullOrEmpty(BillNo))
            {
                ccwhere.AddComponent("BillNo", "%" + BillNo + "%", SearchComponent.Like, SearchPad.And);
            }
            string Salesperson = Request["Salesperson"];
            if (!String.IsNullOrEmpty(Salesperson))
            {
                ccwhere.AddComponent("Salesperson", "%" + Salesperson + "%", SearchComponent.Like, SearchPad.And);
            }
            string IsDel = Request["IsDel"];
            if (!String.IsNullOrEmpty(IsDel))
            {
                ccwhere.AddComponent("IsDel", "1", SearchComponent.Equals, SearchPad.And);
            }
            else
            {
                ccwhere.AddComponent("Isnull(IsDel,0)", "1", SearchComponent.UnEquals, SearchPad.And);
            }

            servComm.strOrderString = "Id";
            listObj = servComm.GetListTop <ModelSpec>(0, "[Id],[SaleDate],[seller],[Salesperson],[BillDate],[BillNo],[BillClass],[Reg],[RegTime]", "Sale", ccwhere);
            string shortName = DateTime.Now.ToString("yyyyMMddHHmmsshhh") + ".xlsx";
            string fileName  = Request.PhysicalApplicationPath + "UploadFile\\" + shortName;
            using (NPOIHelper excelHelper = new NPOIHelper(fileName, Request.PhysicalApplicationPath + "UploadFile\\"))
            {
                DataTable dtTable = listObj.ToDataTable();
                dtTable.Columns.Remove("IsDel");
                int count = excelHelper.DataTableToExcel(dtTable, "订单信息", true);
            }
            Response.Write("http://" + Request.Url.Authority + "//UploadFile//" + shortName);
            Response.End();
        }
        else if (Request["actiontype"] == "SaveSpec")
        {
            int identityID = 0;
            try
            {
                ModelSpec ModelSpec = new ModelSpec();
                if (String.IsNullOrEmpty(Request["Id"]))
                {
                    ModelSpec.Class       = Request["Class"];
                    ModelSpec.Bh          = Request["Bh"];
                    ModelSpec.ProductName = Request["ProductName"];
                    ModelSpec.Spec        = Request["Spec"];
                    ModelSpec.OrderNo     = Request["OrderNo"];
                    ModelSpec.Size        = Request["Size"];
                    ModelSpec.exterior    = Request["exterior"];
                    ModelSpec.Color       = Request["Color"];
                    ModelSpec.Remark      = Request["Remark"];
                    identityID            = servComm.Add(ModelSpec);
                }
                else
                {
                    if (String.IsNullOrEmpty(Request["Bh"]))
                    {
                        identityID = servComm.ExecuteSql(" delete from Spec where ID in (" + Request["Id"] + ");");
                    }
                    else
                    {
                        identityID            = int.Parse(Request["Id"]);
                        ModelSpec.Class       = Request["Class"];
                        ModelSpec.Bh          = Request["Bh"];
                        ModelSpec.ProductName = Request["ProductName"];
                        ModelSpec.Spec        = Request["Spec"];
                        ModelSpec.OrderNo     = Request["OrderNo"];
                        ModelSpec.Size        = Request["Size"];
                        ModelSpec.exterior    = Request["exterior"];
                        ModelSpec.Color       = Request["Color"];
                        ModelSpec.Remark      = Request["Remark"];
                        ModelSpec.ID          = identityID;
                        int result = servComm.Update(ModelSpec);
                    }
                }
                DataCache.dict = servComm.GetListTop <ModelDictDetail>(0, null).ToList();
            }
            catch (Exception ex)
            {
                Response.Write(0);
                Response.End();
            }

            Response.Write(identityID);
            Response.End();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request["type"] == "GetTrace")
        {
            MQueryParameter para = new MQueryParameter();
            para.TypeCom = "申通快递";
            para.OrderId = "3323401314893";
            MResultMsg msg = ExpressageHelper.GetExpressageMessage(para);
            Response.Write(msg.JsonMessage);
            Response.End();
        }


        if (!IsPostBack)
        {
            ((HtmlContainerControl)Master.FindControl("HTitle")).InnerText = IsCN ? "订单查询" : "Order Query";
        }

        string acetoken = GetAccessToken(Session["APPID"].ToString(), Session["APPSECRET"].ToString());

        timeStamp = TenpayUtil.getTimestamp();
        string      signal   = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=" + acetoken + "&type=jsapi";
        ReturnValue retValue = StreamReaderUtils.StreamReader(signal, Encoding.UTF8);

        string ticket = StringUtils.GetJsonValue(retValue.Message, "ticket").ToString();

        string url = "jsapi_ticket=" + ticket + "&noncestr=Wm3WZYTPz0wzccnW&timestamp=" + timeStamp + "&url=" + Request.Url.AbsoluteUri.ToString();

        signalticket = SHA1_Hash(url);

        try
        {
            servCommfac = new ServiceCommon(base.factoryConnectionString);
            if (!IsPostBack)
            {
                if (Request["returnValue"] == null)
                {
                    Session["returnValue"] = null;
                }
            }



            ccWhere.Clear();
            ccWhere = querycontrol.GetCondtion();
            //默认显示的是在厂的订单,不要显示已经出厂的订单

            servCommfac.strOrderString = querycontrol.OrderString == "" ? " regtime desc " : querycontrol.OrderString;

            hddpnumbers = yeyRequest.Params("hpnumbers");
            int iCount = 5;
            if (!string.IsNullOrEmpty(hddpnumbers))
            {
                iCount = Convert.ToInt32(hddpnumbers);
            }

            iPageIndex = string.IsNullOrEmpty(Request["sPageID"]) ? 1 : Convert.ToInt32(Request["sPageID"]);
            int iPageCount = string.IsNullOrEmpty(Request["sPageNum"]) ? 0 : Convert.ToInt32(Request["sPageNum"]);
            if (Request["submitflg"] != null && Request["submitflg"] == "1")
            {
                iPageIndex = 1;
                this.pagecutID.iPageIndex = 1;
                iPageCount = 0;
            }

            string sortList = Request["sortList"];


            if (Utils.IsNoSP == false)
            {
                ilist = servCommfac.GetList <ORDERS>(ORDERS.STRTABLENAME, "Order_ID,seller,sellerid,hospital,ModelNo,hospitalid,doctor,serial,patient,orderclass,indate,process," +
                                                     "case when Hurry = 'Y' then 0 else '1' end as Hurry,case when TryPut = 'Y' then 0 else '1' end as TryPut,case when Slow = 'Y' then 0 else '1' end as Slow,preoutDate,case when preoutDate > GETDATE()then 1 else 0 end as expire ", ORDERS.STRKEYNAME, iCount, iPageIndex, iPageCount, ccWhere);
                this.pagecutID.iPageNum = servCommfac.PageCount;
            }
            else
            {
                int       rowCount  = servCommfac.GetCount("ORDERS", ccWhere);
                string    filedshow = " row_number()over(order by Order_ID,serial) as rowIndex ,Order_ID, seller, sellerid, hospital, ModelNo, hospitalid, doctor, serial, patient, orderclass, indate, process,case when Hurry = 'Y' then 0 else '1' end as Hurry,case when TryPut = 'Y' then 0 else '1' end as TryPut,case when Slow = 'Y' then 0 else '1' end as Slow,preoutDate,case when preoutDate > GETDATE()then 1 else 0 end as expire";
                DataTable dt        = servCommfac.ExecuteSqlDatatable("select * from (select " + filedshow + " from ORDERS  where 1=1 and " + ccWhere.sbComponent + ") t where rowIndex>=" + ((iPageIndex - 1) * iCount + 1).ToString() + " and rowIndex <=" + iPageIndex * iCount);
                ilist = Utils.ConvertTo <ORDERS>(dt);
                servCommfac.RowCount    = rowCount;
                this.pagecutID.iPageNum = (rowCount - 1) / iCount + 1;
            }

            if (ilist.Count == 0)
            {
                servCommfac.PageCount = 0;
            }

            iPageAllCount = this.pagecutID.iPageNum;
        }
        catch (Exception ex) {
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        servCommfac = new ServiceCommon(base.factoryConnectionString);
        if (!IsPostBack)
        {
        }

        queryaction = Request["queryaction"];
        //产品进程与患者查询使用不同的过滤条件
        if (queryaction == "procedure")
        {
            searchboxpatient.Visible = false;
        }
        else
        {
            searchbox.Visible = false;
        }

        ccWhere.Clear();
        hddpnumbers = Request["hpnumbers"];
        int iCount = 10;

        if (!string.IsNullOrEmpty(hddpnumbers))
        {
            iCount = Convert.ToInt32(hddpnumbers);
        }
        int iPageIndex = string.IsNullOrEmpty(Request["sPageID"]) ? 1 : Convert.ToInt32(Request["sPageID"]);
        int iPageCount = string.IsNullOrEmpty(Request["sPageNum"]) ? 0 : Convert.ToInt32(Request["sPageNum"]);

        string txtDateFrom = Request["starttime"];
        string txtDateTo   = Request["endtime"];

        ccWhere.AddComponent("OutFlag ", "N", SearchComponent.Equals, SearchPad.NULL);
        if (!string.IsNullOrEmpty(txtDateFrom))
        {
            ccWhere.AddComponent("indate ", txtDateFrom, SearchComponent.GreaterOrEquals, SearchPad.And);
        }

        if (!string.IsNullOrEmpty(txtDateTo))
        {
            ccWhere.AddComponent("indate ", DateTime.Parse(txtDateTo).AddDays(1).ToString(), SearchComponent.Less, SearchPad.And);
        }

        string txtPatient = Request["txtPatient"];

        if (!string.IsNullOrEmpty(txtPatient))
        {
            ccWhere.AddComponent("patient ", txtPatient, SearchComponent.Like, SearchPad.And);
        }

        string txtOrderNo = Request["txtOrderNo"];

        if (!string.IsNullOrEmpty(txtOrderNo))
        {
            ccWhere.AddComponent("Order_ID ", txtOrderNo, SearchComponent.Like, SearchPad.And);
        }

        GetFilterByKind(ref ccWhere, "orders");

        servCommfac.strOrderString = " regtime desc ";
        IList <ORDERS> ilist = servCommfac.GetList <ORDERS>(ORDERS.STRTABLENAME, "Order_ID,seller,sellerid,hospital,ModelNo,hospitalid,doctor,serial,patient,orderclass,indate", ORDERS.STRKEYNAME, iCount, iPageIndex, iPageCount, ccWhere);

        this.repOrderList.DataSource = ilist;
        repOrderList.DataBind();
        pagecut1.iPageNum = servCommfac.PageCount;
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ccwhere.Clear();
            ccwhere.AddComponent("Class", "B", SearchComponent.Equals, SearchPad.NULL);
            listSeler   = servComm.GetListTop <ModelClient>(0, "*", "Client", ccwhere);
            BindingJson = JsonConvert.SerializeObject(listSeler, Formatting.Indented, new IsoDateTimeConverter());

            BindingJson = BindingJson.Replace("\r\n", "").Replace("Client", "NodeName");
        }
        string actiontype = Request["actiontype"];

        if (actiontype == "GetSaleList")
        {
            ConstructionCondition();

            int iPageCount = 0;
            int iPageIndex = int.Parse(Request["PageIndex"]) + 1;
            servComm.strOrderString = "CardNo";
            listObj = servComm.GetList <ModeRelatedOrderView>("ViewRelatedOrder", "*", "CardNo", 10, iPageIndex, iPageCount, ccwhere);
            var timeConvert = new IsoDateTimeConverter();
            //timeConvert.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
            timeConvert.DateTimeFormat = "yyyy-MM-dd";
            string responseJson = JsonConvert.SerializeObject(listObj, Formatting.Indented, timeConvert);
            Response.Write("[{\"RowCount\":" + servComm.RowCount + ",\"JsonData\":" + responseJson + "}]");
            Response.End();
        }
        else if (actiontype == "ExportExcel")
        {
            ConstructionCondition();

            servComm.strOrderString = "CardNo";
            listObj = servComm.GetListTop <ModeRelatedOrderView>(0, "[CardNo],[factoryBM],[Order_ID],[hospital],[doctor],[patient],[OutDate],[factoryValid],[a_teeth],[b_teeth],[c_teeth],[d_teeth],[Itemname],[Id],[Serial],[Bh],[orderid],[Qty],[OClass],[ObatchNo],[BatchNo],[ProdDate],[TestDate],[BtQty],[SRate],[Valid],[Addr],[receiver],[Tel],[distri],[distriNo],[NoStart],[NoEnd],[NoQty],[BillClass],[seller],[Salesperson]", "ViewRelatedOrder", ccwhere);
            string shortName = DateTime.Now.ToString("yyyyMMddHHmmsshhh") + ".xlsx";
            string fileName  = Request.PhysicalApplicationPath + "UploadFile\\" + shortName;
            using (NPOIHelper excelHelper = new NPOIHelper(fileName, Request.PhysicalApplicationPath + "UploadFile\\"))
            {
                DataTable dt = new DataTable();

                dt.Columns.Add("SaleDate");
                dt.Columns.Add("seller");
                dt.Columns.Add("Salesperson");
                dt.Columns.Add("BillDate");
                dt.Columns.Add("BillNo");
                dt.Columns.Add("BillClass");
                dt.Columns.Add("Qty");
                dt.Columns.Add("Bh");
                dt.Columns.Add("ProductName");
                dt.Columns.Add("orderid");
                dt.Columns.Add("BatchNo");
                dt.Columns.Add("OClass");
                dt.Columns.Add("ObatchNo");
                dt.Columns.Add("ProdDate");
                dt.Columns.Add("BtQty");
                dt.Columns.Add("SRate");
                dt.Columns.Add("Valid");
                dt.Columns.Add("receiver");
                dt.Columns.Add("Addr");
                dt.Columns.Add("Tel");
                dt.Columns.Add("distri");
                dt.Columns.Add("distriNo");
                dt.Columns.Add("NoStart");
                dt.Columns.Add("NoEnd");
                dt.Columns.Add("NoQty");
                dt.Columns.Add("factoryBM");
                dt.Columns.Add("Order_ID");
                dt.Columns.Add("hospital");
                dt.Columns.Add("doctor");
                dt.Columns.Add("patient");
                dt.Columns.Add("OutDate");
                dt.Columns.Add("Itemname");
                dt.Columns.Add("factoryValid");
                dt.Columns.Add("a_teeth");
                dt.Columns.Add("b_teeth");
                dt.Columns.Add("c_teeth");
                dt.Columns.Add("d_teeth");

                string templateName = "订单关联信息.xlsx";
                if (LoginUser.Class == "A")
                {
                    templateName = "订单关联信息A.xlsx";
                    dt.Columns.Remove("SaleDate");
                    dt.Columns.Remove("Salesperson");
                    dt.Columns.Remove("BillDate");
                    dt.Columns.Remove("BillNo");
                    dt.Columns.Remove("BillClass");
                    dt.Columns.Remove("Bh");
                    dt.Columns.Remove("OClass");
                    dt.Columns.Remove("ObatchNo");
                    dt.Columns.Remove("BtQty");
                    dt.Columns.Remove("distri");
                    dt.Columns.Remove("NoStart");
                    dt.Columns.Remove("NoEnd");

                    dt.Columns.Remove("factoryBM");
                    dt.Columns.Remove("Order_ID");
                    dt.Columns.Remove("hospital");
                    dt.Columns.Remove("doctor");
                    dt.Columns.Remove("patient");
                    dt.Columns.Remove("OutDate");
                    dt.Columns.Remove("Itemname");
                    dt.Columns.Remove("factoryValid");
                    dt.Columns.Remove("a_teeth");
                    dt.Columns.Remove("b_teeth");
                    dt.Columns.Remove("c_teeth");
                    dt.Columns.Remove("d_teeth");
                }
                else if (LoginUser.Class == "B")
                {
                    templateName = "订单关联信息B.xlsx";
                    dt.Columns.Remove("SaleDate");
                    dt.Columns.Remove("Salesperson");
                    dt.Columns.Remove("BillDate");
                    dt.Columns.Remove("BillNo");
                    dt.Columns.Remove("BillClass");
                    dt.Columns.Remove("Bh");
                    dt.Columns.Remove("OClass");
                    dt.Columns.Remove("ObatchNo");
                    dt.Columns.Remove("BtQty");
                    dt.Columns.Remove("distri");
                    dt.Columns.Remove("NoStart");
                    dt.Columns.Remove("NoEnd");
                }

                DataTable dtTable = listObj.ToDataTable(dt);
                int       count   = excelHelper.DataTableToExcel(dtTable, "订单关联信息", true, templateName);
            }
            Response.Write("http://" + Request.Url.Authority + "//UploadFile//" + shortName);
            Response.End();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request["action"] == "CompareTalkRecord")
        {
            string unReadOrderNo = "";
            if (Session["allOrder"] == null)
            {
                Response.Write("");
                Response.End();
            }
            else
            {
                string[] orderNumber = Session["allOrder"].ToString().Trim(',').Split(',');
                for (int i = 0; i < orderNumber.Length; i++)
                {
                    if (Request.Cookies[LoginUser.BelongFactory + orderNumber[i]] != null && Request.Cookies[LoginUser.BelongFactory + orderNumber[i]].Value != "")
                    {
                        unReadOrderNo = GetLastedTimeByOrder(unReadOrderNo, orderNumber[i]);
                    }
                    else
                    {
                        unReadOrderNo = unReadOrderNo + "," + orderNumber[i];
                    }
                }
                Response.Write(unReadOrderNo.Trim(','));
                Response.End();
            }
        }

        if (Request["action"] == "ReadTalkRecord")
        {
            string orderNumber = Request["orderNumber"];
            string modifyDate  = GetLastedTimeByOrder("", orderNumber, "1");
            Response.Write(modifyDate);
            Response.End();
        }

        if (!IsPostBack)
        {
        }
        if (!string.IsNullOrEmpty(Request["hDelete"]))
        {
            servComm.ExecuteSql(" delete from W_Orders where ModelNo='" + Request["hDelete"] + "' and BelongFactory='" + LoginUser.BelongFactory + "'");
        }

        ccWhere.Clear();
        hddpnumbers = Request["hpnumbers"];
        int iCount = 10;

        if (!string.IsNullOrEmpty(hddpnumbers))
        {
            iCount = Convert.ToInt32(hddpnumbers);
        }
        int iPageIndex = string.IsNullOrEmpty(Request["sPageID"]) ? 1 : Convert.ToInt32(Request["sPageID"]);
        int iPageCount = string.IsNullOrEmpty(Request["sPageNum"]) ? 0 : Convert.ToInt32(Request["sPageNum"]);


        string txtModelNumber = Request["txtModelNumber"];

        if (!string.IsNullOrEmpty(txtModelNumber))
        {
            ccWhere.AddComponent("ModelNo ", "%" + txtModelNumber + "%", SearchComponent.Like, SearchPad.And);
        }

        string selectedID    = Request["selectedID"];
        string selectedLevel = Request["selectedLevel"];

        if (!String.IsNullOrEmpty(selectedLevel) && !String.IsNullOrEmpty(selectedID))
        {
            if (selectedLevel == "0")
            {
                ccWhere.AddComponent("sellerid ", selectedID, SearchComponent.Equals, SearchPad.And);
                ccMessageWhere.AddComponent("sellerid ", selectedID, SearchComponent.Equals, SearchPad.And);
            }
            else if (selectedLevel == "1")
            {
                ccWhere.AddComponent("HospitalID ", selectedID, SearchComponent.Equals, SearchPad.And);
                ccMessageWhere.AddComponent("HospitalID ", selectedID, SearchComponent.Equals, SearchPad.And);
            }
            else if (selectedLevel == "2")
            {
                ccWhere.AddComponent("DoctorID ", selectedID, SearchComponent.Equals, SearchPad.And);
                ccMessageWhere.AddComponent("DoctorID ", selectedID, SearchComponent.Equals, SearchPad.And);
            }
        }

        //被接收的订单不展示
        //ccWhere.AddComponent("isnull(Auth,'0') ", "0", SearchComponent.Equals, SearchPad.And);

        GetFilterByKind(ref ccWhere);
        GetFilterByKind(ref ccMessageWhere);

        servComm.strOrderString = " regtime desc ";
        IList <WORDERS> ilist = servComm.GetList <WORDERS>(WORDERS.STRTABLENAME, "*", WORDERS.STRKEYNAME, iCount, iPageIndex, iPageCount, ccWhere);

        ccMessageWhere.AddComponent("ModelNo", "(select OrderNumber from OrderMessage )", SearchComponent.In, SearchPad.And);
        IList <WORDERS> alllist    = servComm.GetListTop <WORDERS>(0, ccMessageWhere);
        string          strModelNo = "";

        alllist.ToList().ForEach(item => strModelNo = strModelNo + "," + item.ModelNo);
        Session["allOrder"]          = strModelNo;
        this.repOrderList.DataSource = ilist;
        repOrderList.DataBind();
        pagecut1.iPageNum = servComm.PageCount;
    }
Exemplo n.º 12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string actiontype = Request["actiontype"];

        if (!IsPostBack)
        {
            servComm.strOrderString = "Client";
            ccwhere.Clear();
            ccwhere.AddComponent("Class", "A", SearchComponent.Equals, SearchPad.NULL);
            ccwhere.AddComponent("Class", "B", SearchComponent.Equals, SearchPad.Or);
            listSeler = servComm.GetListTop <ModelClient>(0, ccwhere);
        }
        if (actiontype == "GetSaleList")
        {
            string BillNo = Request["BillNo"];
            ccwhere.Clear();
            if (!String.IsNullOrEmpty(BillNo))
            {
                ccwhere.AddComponent("BillNo", "%" + BillNo.Trim() + "%", SearchComponent.Like, SearchPad.And);
            }
            string Salesperson = Request["Salesperson"];
            if (!String.IsNullOrEmpty(Salesperson))
            {
                ccwhere.AddComponent("Salesperson", "%" + Salesperson.Trim() + "%", SearchComponent.Like, SearchPad.And);
            }
            string IsDel = Request["IsDel"];
            if (!String.IsNullOrEmpty(IsDel))
            {
                ccwhere.AddComponent("IsDel", "1", SearchComponent.Equals, SearchPad.And);
            }
            else
            {
                ccwhere.AddComponent("Isnull(IsDel,0)", "1", SearchComponent.UnEquals, SearchPad.And);
            }
            int    iPageCount   = 0;
            string strPageIndex = Request["PageIndex"] == null ? "0" : Request["PageIndex"];
            int    iPageIndex   = int.Parse(strPageIndex) + 1;
            servComm.strOrderString = "Id desc";
            listObj = servComm.GetList <ModelSale>("Sale", "*", "Id", 10, iPageIndex, iPageCount, ccwhere);
            listObj.ToList().ForEach(eo => eo.Seller = (listSeler.Where(le => le.Serial == eo.Seller).Count() > 0 ? listSeler.Where(le => le.Serial == eo.Seller).FirstOrDefault().Client : ""));


            var timeConvert = new IsoDateTimeConverter();
            //timeConvert.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
            timeConvert.DateTimeFormat = "yyyy-MM-dd";
            string responseJson = JsonConvert.SerializeObject(listObj, Formatting.Indented, timeConvert);
            responseJson = responseJson.Replace(": null", ": \"\"");
            Response.Write("[{\"RowCount\":" + servComm.RowCount + ",\"JsonData\":" + responseJson + "}]");

            Response.End();
        }
        else if (actiontype == "DisableOrderAction")
        {
            string Ids    = Request["CheckOrder"];
            string result = "0";
            try
            {
                servComm.ExecuteSql("update Sale set IsDel = 1 where Id in (" + Ids + ")");
                result = "1";
            }
            catch (Exception ex)
            {
                result = "0";
            }
            Response.Write(result);
            Response.End();
        }
        else if (actiontype == "ReuseOrderAction")
        {
            string Ids    = Request["CheckOrder"];
            string result = "0";
            try
            {
                servComm.ExecuteSql("update Sale set IsDel = 0 where Id in (" + Ids + ")");
                result = "1";
            }
            catch (Exception ex)
            {
                result = "0";
            }
            Response.Write(result);
            Response.End();
        }
        else if (actiontype == "ExportExcel")
        {
            ccwhere.Clear();
            string BillNo = Request["BillNo"];
            if (!String.IsNullOrEmpty(BillNo))
            {
                ccwhere.AddComponent("BillNo", "%" + BillNo + "%", SearchComponent.Like, SearchPad.And);
            }
            string Salesperson = Request["Salesperson"];
            if (!String.IsNullOrEmpty(Salesperson))
            {
                ccwhere.AddComponent("Salesperson", "%" + Salesperson + "%", SearchComponent.Like, SearchPad.And);
            }
            string IsDel = Request["IsDel"];
            if (!String.IsNullOrEmpty(IsDel))
            {
                ccwhere.AddComponent("IsDel", "1", SearchComponent.Equals, SearchPad.And);
            }
            else
            {
                ccwhere.AddComponent("Isnull(IsDel,0)", "1", SearchComponent.UnEquals, SearchPad.And);
            }

            servComm.strOrderString = "Id";
            string fieldShow = "[Id],[SaleDate],[seller],[Salesperson],[BillDate],[BillNo],[BillClass],[Addr],[receiver],[Tel],[distri],[distriNo],[Reg],[RegTime]";
            listObj = servComm.GetListTop <ModelSale>(0, fieldShow, "Sale", ccwhere);
            string shortName = DateTime.Now.ToString("yyyyMMddHHmmsshhh") + ".xlsx";
            string fileName  = Request.PhysicalApplicationPath + "UploadFile\\" + shortName;
            using (NPOIHelper excelHelper = new NPOIHelper(fileName, Request.PhysicalApplicationPath + "UploadFile\\"))
            {
                DataTable dt         = new DataTable();
                string[]  splitField = fieldShow.Split(',');
                for (int i = 0; i < splitField.Length; i++)
                {
                    dt.Columns.Add(splitField[i].Trim('[').Trim(']'));
                }

                DataTable dtTable = listObj.ToDataTable(dt);
                //dtTable.Columns.Remove("IsDel");
                int count = excelHelper.DataTableToExcel(dtTable, "订单信息", true);
            }
            Response.Write("http://" + Request.Url.Authority + "//UploadFile//" + shortName);
            Response.End();
        }
    }
Exemplo n.º 13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.HttpMethod == "POST")
        {
            // 使用Dictionary保存参数
            Hashtable myMap = new Hashtable();

            NameValueCollection coll = Request.Form;

            string[] requestItem = coll.AllKeys;

            for (int i = 0; i < requestItem.Length; i++)
            {
                myMap.Add(requestItem[i], Request.Form[requestItem[i]]);
            }

            if (myMap.ContainsKey("MerId"))
            {
                chinapaysecure.SecssUtil obj = new chinapaysecure.SecssUtil();
                ccWhere.Clear();
                ccWhere.AddComponent("PayNoCardMerId", myMap["MerId"].ToString(), SearchComponent.Equals, SearchPad.NULL);
                int count = servComm.GetCount("JX_USERS", ccWhere);
                if (count > 0)
                {
                    obj.init(Request.PhysicalApplicationPath + "ChinaPay/" + myMap["MerId"].ToString() + "/security.properties"); //初始化安全控件:
                }
                else
                {
                    //B2C支付
                    //myMap.Add("BankInstNo", "700000000000010");
                    //myMap.Add("MerId", "481601512177911");
                    obj.init(Request.PhysicalApplicationPath + "ChinaPay/" + myMap["MerId"].ToString() + "/securityb2c.properties"); //初始化安全控件:
                }
                obj.verify(myMap);
                // 返回报文中不包含UPOG,表示Server端正确接收交易请求,则需要验证Server端返回报文的签名
                if ("00" == obj.getErrCode())
                {
                    servComm.ExecuteSql("update W_NetPay set PayDateTime = getdate() ,PayStatus = 2 where OrderID = '" + myMap["MerOrderNo"].ToString() + "'");


                    //Response.Write("商户端验证返回报文签名成功\n");

                    //商户端根据返回报文内容处理自己的业务逻辑 ,DEMO此处只输出报文结果
                    //StringBuilder builder = new StringBuilder();

                    //builder.Append("<tr><td align=\"center\" colspan=\"2\"><b>商户端接收银联返回报文并按照表格形式输出结果</b></td></tr>");

                    //for (int i = 0; i < requestItem.Length; i++)
                    //{
                    //    builder.Append("<tr><td width=\"30%\" align=\"right\">" + requestItem[i] + "</td><td style='word-break:break-all'>" + Request.Form[requestItem[i]] + "</td></tr>");
                    //}

                    //builder.Append("<tr><td width=\"30%\" align=\"right\">商户端验证银联返回报文结果</td><td>验证签名成功.</td></tr>");
                    //Response.Write(builder.ToString());
                }
                else
                {
                    servComm.ExecuteSql("update W_NetPay set PayDateTime = getdate() ,PayStatus = 9 where OrderID = '" + myMap["MerOrderNo"].ToString() + "'");

                    Response.Write("<tr><td width=\"30%\" align=\"right\">商户端验证银联返回报文结果</td><td>验证签名失败.</td></tr>");
                }
            }
        }

        ccWhere.Clear();
        ccWhere.AddComponent("UserID", CurrentUserID.ToString(), SearchComponent.Equals, SearchPad.NULL);
        if (!String.IsNullOrEmpty(Request["txtOrderNumner"]))
        {
            ccWhere.AddComponent("OrderID", Request["txtOrderNumner"], SearchComponent.Like, SearchPad.And);
        }

        hddpnumbers = Request["hpnumbers"];
        int iCount = 10;

        if (!string.IsNullOrEmpty(hddpnumbers))
        {
            iCount = Convert.ToInt32(hddpnumbers);
        }
        int iPageIndex = string.IsNullOrEmpty(Request["sPageID"]) ? 1 : Convert.ToInt32(Request["sPageID"]);
        int iPageCount = string.IsNullOrEmpty(Request["sPageNum"]) ? 0 : Convert.ToInt32(Request["sPageNum"]);

        servComm.strOrderString = " ID desc ";
        IList <WNetPay> ilist = servComm.GetList <WNetPay>(WNetPay.STRTABLENAME, "*", WNetPay.STRKEYNAME, iCount, iPageIndex, iPageCount, ccWhere);

        repUserList.DataSource = ilist;
        repUserList.DataBind();
        pagecut1.iPageNum = servComm.PageCount;
    }
Exemplo n.º 14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ccwhere.Clear();
            ccwhere.AddComponent("Class", "B", SearchComponent.Equals, SearchPad.NULL);
            listSeler   = servComm.GetListTop <ModelClient>(0, "*", "Client", ccwhere);
            BindingJson = JsonConvert.SerializeObject(listSeler, Formatting.Indented, new IsoDateTimeConverter());

            BindingJson = BindingJson.Replace("\r\n", "").Replace("Client", "NodeName");
        }
        string actiontype = Request["actiontype"];

        if (actiontype == "GetSaleList")
        {
            ConstructionCondition();

            int iPageCount = 0;
            int iPageIndex = int.Parse(Request["PageIndex"]) + 1;
            servComm.strOrderString = "CardNo";
            listObj = servComm.GetList <ModelOrders>("orders", "*", "CardNo", 10, iPageIndex, iPageCount, ccwhere);
            listObj.ToList().ForEach(eo => eo.Serial = (listSeler.Where(le => le.Serial == eo.Serial).Count() > 0 ? listSeler.Where(le => le.Serial == eo.Serial).FirstOrDefault().Client : ""));

            var timeConvert = new IsoDateTimeConverter();
            //timeConvert.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
            timeConvert.DateTimeFormat = "yyyy-MM-dd";
            string responseJson = JsonConvert.SerializeObject(listObj, Formatting.Indented, timeConvert);
            responseJson = responseJson.Replace(": null", ": \"\"");
            Response.Write("[{\"RowCount\":" + servComm.RowCount + ",\"JsonData\":" + responseJson + "}]");
            Response.End();
        }
        else if (actiontype == "GetOrderDetail")
        {
            servComm.strOrderString = "CardNo";
            ccwhere.Clear();
            string CardNo = Request["CardNo"];
            ccwhere.AddComponent("CardNo", CardNo, SearchComponent.Equals, SearchPad.NULL);
            IList <ModelOrdersDetail> listObj = servComm.GetListTop <ModelOrdersDetail>(0, "*", "OrdersDetail", ccwhere);
            var timeConvert = new IsoDateTimeConverter();
            //timeConvert.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
            timeConvert.DateTimeFormat = "yyyy-MM-dd";
            string responseJson = JsonConvert.SerializeObject(listObj, Formatting.Indented, timeConvert);
            responseJson = responseJson.Replace(": null", ": \"\"");
            responseJson = responseJson.Replace("\r\n", "");
            Response.Write(responseJson);
            Response.End();
        }
        else if (actiontype == "ExportExcel")
        {
            ConstructionCondition();

            servComm.strOrderString = "CardNo";
            DataTable dtTable   = servComm.GetListTop(0, "*", "ViewOrders", ccwhere);
            string    shortName = DateTime.Now.ToString("yyyyMMddHHmmsshhh") + ".xlsx";
            string    fileName  = Request.PhysicalApplicationPath + "UploadFile\\" + shortName;
            using (NPOIHelper excelHelper = new NPOIHelper(fileName, Request.PhysicalApplicationPath + "UploadFile\\"))
            {
                int count = excelHelper.DataTableToExcel(dtTable, "工厂订单信息", true, "工厂订单信息.xlsx");
            }
            Response.Write("http://" + Request.Url.Authority + "//UploadFile//" + shortName);
            Response.End();
        }
        else if (actiontype == "GetProductList")
        {
            ccwhere.Clear();
            ccwhere.AddComponent("Serial", LoginUser.Serial, SearchComponent.Equals, SearchPad.NULL);
            servComm.strOrderString = "itemname collate Chinese_PRC_CS_AS_KS_WS";
            // ccWhere.AddComponent("Serial", LoginUser.Serial, SearchComponent.Equals, SearchPad.NULL);
            DataTable dtProduct   = servComm.GetListTop(0, "products", ccwhere);
            var       timeConvert = new IsoDateTimeConverter();
            //timeConvert.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
            timeConvert.DateTimeFormat = "yyyy-MM-dd";
            string responseJson = JsonConvert.SerializeObject(dtProduct, Formatting.Indented, timeConvert);
            Response.Write("[{\"RowCount\":" + dtProduct.Rows.Count + ",\"JsonData\":" + responseJson + "}]");
            Response.End();
        }
        else if (actiontype == "SaveProduct")
        {
            int identityID = 1;
            try
            {
                string productID = Request["ProductID"];
                if (!String.IsNullOrEmpty(productID))
                {
                    servComm.ExecuteSql("update client set productID = '" + productID + "' where Serial = '" + LoginUser.Serial + "'");
                }
            }
            catch (Exception ex)
            {
                Response.Write(0);
                Response.End();
            }

            Response.Write(identityID);
            Response.End();
        }
    }