protected void Page_Load(object sender, EventArgs e) { modelBase = servComm.GetEntity <ModelBase>("1"); string actiontype = Request["actiontype"]; if (actiontype == "ValidCardNo") { string CardNo = Request["CardNo"]; string PatientName = Request["PatientName"]; ccwhere.Clear(); ccwhere.AddComponent("CardNo", CardNo, SearchComponent.Equals, SearchPad.NULL); ccwhere.AddComponent("patient", PatientName, SearchComponent.Equals, SearchPad.And); DataTable dtOrders = servComm.GetListTop(0, "(select a.*,b.Client from orders a left join Client b on a.Serial = b.Serial) c", ccwhere); var timeConvert = new IsoDateTimeConverter(); //timeConvert.DateTimeFormat = "yyyy-MM-dd HH:mm:ss"; timeConvert.DateTimeFormat = "yyyy-MM-dd"; string responseJson = JsonConvert.SerializeObject(dtOrders, Formatting.Indented, timeConvert); ccwhere.Clear(); ccwhere.AddComponent("CardNo", CardNo, SearchComponent.Equals, SearchPad.NULL); DataTable dtOrdersDetail = servComm.GetListTop(0, "ordersdetail", ccwhere); string detailJson = JsonConvert.SerializeObject(dtOrdersDetail, Formatting.Indented, timeConvert); if (dtOrders.Rows.Count > 0) { servComm.ExecuteSql("insert into Visitor values ( getdate())"); } Response.Write("[{\"RowCount\":" + dtOrders.Rows.Count + ",\"JsonData\":" + responseJson + ",\"JsonDetail\":" + detailJson + "}]"); Response.End(); } }
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(); ccWhere.Clear(); if (!String.IsNullOrEmpty(Request["txtJGCName"])) { ccWhere.AddComponent("JGCName", Request["txtJGCName"], SearchComponent.Like, SearchPad.NULL); } hddpnumbers = Request["hpnumbers"]; int iCount = 20; 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 <JX_USERS> ilist = servComm.GetList <JX_USERS>(JX_USERS.STRTABLENAME, "*", JX_USERS.STRKEYNAME, iCount, iPageIndex, iPageCount, ccWhere); //DataTable dt = servComm.GetListTop(0, "W_MANAGER_ROLE", null); repRoleList.DataSource = ilist; repRoleList.DataBind(); pagecut1.iPageNum = servComm.PageCount; }
protected void Page_Init(object sender, EventArgs e) { if (Session["factoryConnectionString"] == null) { Response.Redirect(Request.Url.GetLeftPart(UriPartial.Authority) + "//Weixinclient//WXLogin.aspx"); } facComm = new ServiceCommon(Session["factoryConnectionString"].ToString()); ccWhere.Clear(); ccWhere.AddComponent("ClassID", "OrderClass", SearchComponent.Equals, SearchPad.NULL); dtCategory = facComm.GetListTop(0, " Code,DictName ", "DictDetail", ccWhere); }
private void GetAPPInfo(string loginUser) { ccWhere.Clear(); ccWhere.AddComponent("JGCBM", "(select BelongFactory from W_USERS where UserName='******')", SearchComponent.In, SearchPad.NULL); ccWhere.AddComponent("APPID", null, SearchComponent.ISNOT, SearchPad.And); ccWhere.AddComponent("APPSECRET", null, SearchComponent.ISNOT, SearchPad.And); DataTable dtFactory = servComm.GetListTop(1, "JX_USERS", ccWhere); if (dtFactory.Rows.Count > 0) { Session["APPID"] = dtFactory.Rows[0]["APPID"]; Session["APPSECRET"] = dtFactory.Rows[0]["APPSECRET"]; } //Session["NickName"] = "kaka"; if (Session["APPID"] != null && Session["APPSECRET"] != null) { //try //{ string accessToken = ""; ReturnValue retValue = GetUserInfo(ref accessToken, Session["APPID"].ToString(), Session["APPSECRET"].ToString()); if (retValue == null) { GeeStar.Workflow.Common.Log.LogError("空引用"); Response.Redirect(Request.Url.GetLeftPart(UriPartial.Authority) + "//Weixinclient//WXLogin.aspx"); Response.End(); } GeeStar.Workflow.Common.Log.LogError(retValue.Message); if (StringUtils.GetJsonValue(retValue.Message, "nickname") != null) { string nickName = StringUtils.GetJsonValue(retValue.Message, "nickname").ToString(); string headUrl = StringUtils.GetJsonValue(retValue.Message, "headimgurl").ToString(); picture = headUrl; string strWeixin_OpenID = StringUtils.GetJsonValue(retValue.Message, "openid").ToString(); WriteCookie(UserConstant.COOKIE_SAVEDOPENID, strWeixin_OpenID); Session["WeixinOpenID"] = strWeixin_OpenID; Session["NickName"] = nickName; Session["HeadUrl"] = headUrl; } else { Response.Redirect(Request.Url.GetLeftPart(UriPartial.Authority) + "//Weixinclient//WXLogin.aspx"); Response.End(); } //} //catch (Exception ex) //{ // GeeStar.Workflow.Common.Log.LogError(ex.Message, ex); // Response.Redirect(Request.Url.GetLeftPart(UriPartial.Authority) + "//Weixinclient//WXLogin.aspx"); // Response.End(); //} } }
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; }
protected void Page_Load(object sender, EventArgs e) { servCommfac = new ServiceCommon(base.factoryConnectionString); if (Request["type"] == "GetBatch") { string batchOrderID = Request["BatchOrderID"]; string batchSerialID = Request["BatchSerialID"]; string batchProductID = Request["BatchProductID"]; string zBatchNodes = ""; ccWhere.Clear(); ccWhere.AddComponent("Order_ID", batchOrderID, SearchComponent.Equals, SearchPad.And); ccWhere.AddComponent("serial", batchSerialID, SearchComponent.Equals, SearchPad.And); ccWhere.AddComponent("Productid", batchProductID, SearchComponent.Equals, SearchPad.And); DataTable dt = servCommfac.GetListTop(0, "isnull(Name,'') as Name,isnull(Maker,'') as Maker,isnull(batchNo,'') as batchNo", "OrdersElement", ccWhere); foreach (DataRow dr in dt.Rows) { zBatchNodes = zBatchNodes + "{" + "\"ElementName\":" + "\"" + dr["Name"].ToString() + "\"" + ",\"ElementMaker\":" + "\"" + dr["Maker"].ToString() + "\"" + ",\"BatchNo\":" + "\"" + dr["batchNo"].ToString() + "\"},"; } zBatchNodes = zBatchNodes.Trim(','); if (zBatchNodes == "") { zBatchNodes = "{}"; } else { zBatchNodes = "[" + zBatchNodes + "]"; } Response.Write(zBatchNodes); Response.End(); } else { orderID = Request["orderID"]; serialID = Request["serial"]; ccWhere.Clear(); ccWhere.AddComponent("Order_ID", orderID, SearchComponent.Equals, SearchPad.NULL); ccWhere.AddComponent("serial", serialID, SearchComponent.Equals, SearchPad.And); IList <ORDERS> listOrder = servCommfac.GetListTop <ORDERS>(0, "hospital,doctor,Patient,Order_ID,indate,preoutDate,OutDate,Sex,Age", "orders", ccWhere); if (listOrder.Count > 0) { orderModel = listOrder[0]; } GetProcedureList(orderID, serialID); } }
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(); }
protected void Page_Load(object sender, EventArgs e) { if (IsCN == false) { FinanceReportViewer.LocalReport.ReportPath = FinanceReportViewer.LocalReport.ReportPath.Replace("En", "").Replace(".rdlc", "En.rdlc"); } if (!IsPostBack) { string Order_ID = Request["Order_ID"]; string serial = Request["serial"]; facservComm = new ServiceCommon(base.factoryConnectionString); ccWhere.Clear(); ccWhere.AddComponent("EquipRec.Order_ID", Order_ID, SearchComponent.Equals, SearchPad.NULL); ccWhere.AddComponent("EquipRec.serial", serial, SearchComponent.Equals, SearchPad.And); //DataTable dtEquipRec = facservComm.GetListTop(0, "* ", "VWEquipRec", ccWhere); DataTable dtEquipRec = facservComm.ExecuteSqlDatatable(VWEquipRec + " where " + ccWhere.sbComponent); //this.FinanceReportViewer.LocalReport.SetParameters(new ReportParameter("paraIndate", "2015年01月01日")); //this.FinanceReportViewer.LocalReport.SetParameters(new ReportParameter("paraOutDate", DateTime.Now.Year.ToString() + "年" + DateTime.Now.Month.ToString() + "月" + DateTime.Now.Day + "日")); this.FinanceReportViewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dtEquipRec)); } }
private void BindProductPrice() { this.FinanceReportViewer.LocalReport.DataSources.Clear(); string HospitalList = Request["HospitalList"]; string hospitalName = Request["HidHospitalName"]; string BalanceClass = ""; DataTable dt = facservComm.ExecuteSqlDatatable("SELECT BalanceClass FROM [Hospital] where id =" + HospitalList.Trim(':')); if (dt.Rows.Count > 0) { BalanceClass = dt.Rows[0][0].ToString(); } DataTable dtPrice; if (BalanceClass == "产品模板") { dtPrice = facservComm.ExecuteSqlDatatable(VWPriceByTemplate + " and hospitalid = " + HospitalList.Trim(':') + " order by Sortno,id "); } else { facservComm.strOrderString = " Sortno,id "; ccWhere.Clear(); ccWhere.AddComponent("Serial", BalanceClass.Substring(0, 1), SearchComponent.Equals, SearchPad.NULL); // dtPrice = facservComm.GetListTop(0, "'"+hospitalName+"' as hospital ,* ", "VWPrice", ccWhere); dtPrice = facservComm.ExecuteSqlDatatable(VWPrice + " and " + ccWhere.sbComponent); } this.FinanceReportViewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dtPrice)); }
protected void Page_Load(object sender, EventArgs e) { Log.LogInfo("OrderList"); facservComm = new ServiceCommon(base.factoryConnectionString); ccWhere.Clear(); if (LoginUser.Kind == "B") { ccWhere.AddComponent("sellerid", LoginUser.AssocNo.ToString(), SearchComponent.Equals, SearchPad.NULL); } else if (LoginUser.Kind == "C") { ccWhere.AddComponent("hospitalid", LoginUser.AssocNo.ToString(), SearchComponent.Equals, SearchPad.NULL); } else if (LoginUser.Kind == "D") { ccWhere.AddComponent("doctorid", LoginUser.AssocNo.ToString(), SearchComponent.Equals, SearchPad.NULL); } if (ccWhere.sbComponent.ToString() == "") { ccWhere.AddComponent("1", "1", SearchComponent.Equals, SearchPad.NULL); } facservComm.strOrderString = IsCN ? " NameCN " : " NameEN "; // DataTable dtSeller = facservComm.GetListTop(0, " distinct sellerid as id,Seller as NameCN,Seller as NameEN ", "vieworganization", ccWhere); DataTable dtSeller = facservComm.ExecuteSqlDatatable("select distinct sellerid as id,Seller as NameCN,Seller as NameEN from " + vieworganizationorigin + " where " + ccWhere.sbComponent); facservComm.strOrderString = IsCN ? " NameCN " : " NameEN "; //DataTable dtHospital = facservComm.GetListTop(0, " distinct hospitalid as id,hospital as NameCN,hospital as NameEN,sellerid ", "vieworganization", ccWhere); DataTable dtHospital = facservComm.ExecuteSqlDatatable("select distinct hospitalid as id,hospital as NameCN,hospital as NameEN,sellerid from " + vieworganizationorigin + " where " + ccWhere.sbComponent); facservComm.strOrderString = IsCN ? " NameCN " : " NameEN "; //DataTable dtDoctor = facservComm.GetListTop(0, " distinct doctorid as id,doctor as NameCN,doctor as NameEN,Hospitalid", "vieworganization", ccWhere); DataTable dtDoctor = facservComm.ExecuteSqlDatatable("select distinct doctorid as id,doctor as NameCN,doctor as NameEN,Hospitalid from " + vieworganizationorigin + " where " + ccWhere.sbComponent); for (int i = 0; i < dtSeller.Rows.Count; i++) { string sellid = dtSeller.Rows[i]["id"].ToString(); zNodes = zNodes + ",{" + "\"id\":" + sellid + ",\"pId\":0" + ",\"name\":" + "\"" + (IsCN ? dtSeller.Rows[i]["NameCN"] : dtSeller.Rows[i]["NameEN"]) + "\",\"open\": true,\"icon\":" + "\"../zTree_v3/css/zTreeStyle/img/diy/seller.png\"" + "}"; DataRow[] drHospital = dtHospital.Select("sellerid='" + sellid + "'"); foreach (DataRow itemHosptal in drHospital) { string hospitalID = itemHosptal["id"].ToString(); zNodes = zNodes + ",{" + "\"id\":" + hospitalID + ",\"pId\":" + sellid + ",\"name\":" + "\"" + (IsCN?itemHosptal["NameCN"]:itemHosptal["NameEN"]) + "\",\"icon\":" + "\"../zTree_v3/css/zTreeStyle/img/diy/hospital.png\"" + "}"; DataRow[] drDoctor = dtDoctor.Select("Hospitalid='" + hospitalID + "'"); foreach (DataRow itemDoctor in drDoctor) { zNodes = zNodes + ",{" + "\"id\":" + itemDoctor["id"].ToString() + ",\"pId\":" + hospitalID + ",\"name\":" + "\"" + (IsCN?itemDoctor["NameCN"]: itemDoctor["NameEN"]) + "\",\"icon\":" + "\"../zTree_v3/css/zTreeStyle/img/diy/doctor.png\"" + "}"; } } } zNodes = zNodes.Length > 0 ? zNodes.Substring(1) : zNodes; zNodes = "[" + zNodes + "]"; // zNodes = "[{ \"id\":1, \"pId\":0, \"name\": \"父节点1 - 展开\", \"open\": true }" + //",{ \"id\":11, \"pId\":1, \"name\": \"父节点11 - 折叠\" }]"; }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { ((HtmlContainerControl)Master.FindControl("HTitle")).InnerText = "产品详细"; } servCommfac = new ServiceCommon(base.factoryConnectionString); orderID = Request["orderID"]; serialID = Request["serial"]; productid = Request["productid"]; ccWhere.Clear(); ccWhere.AddComponent("Order_ID", orderID, SearchComponent.Equals, SearchPad.NULL); ccWhere.AddComponent("serial", serialID, SearchComponent.Equals, SearchPad.And); IList <ORDERS> listOrder = servCommfac.GetListTop <ORDERS>(0, "*", "Orders", ccWhere); if (listOrder.Count > 0) { preOutDate = listOrder[0].preoutDate.ToShortDateString(); } //ccWhere.AddComponent("productid", productid, SearchComponent.Equals, SearchPad.And); ccWhere.AddComponent("ProductID", productid, SearchComponent.Equals, SearchPad.And); DataTable dtProduct = servCommfac.ExecuteSqlDatatable("SELECT itemname FROM products b where id = '" + productid + "'"); IList <ORDERSDETAIL> listProducts = servCommfac.GetListTop <ORDERSDETAIL>(0, "*", "OrdersDetail", ccWhere); if (listProducts.Count > 0) { productsModel.ItemName = dtProduct.Rows.Count > 0?dtProduct.Rows[0]["itemname"].ToString():""; productsModel.Number = listProducts[0].Qty.ToString(); productsModel.righttop = listProducts[0].a_teeth.ToString().Trim(); productsModel.lefttop = listProducts[0].b_teeth.ToString().Trim(); productsModel.rightbottom = listProducts[0].c_teeth.ToString().Trim(); productsModel.leftbottom = listProducts[0].d_teeth.ToString().Trim(); // listProducts[0].pr } GetProcedureList(orderID, serialID, productid); } catch (Exception ex) { } }
protected void loginBtn_Click(object sender, EventArgs e) { string username = Request["username"]; string password = Request["password"]; ccWhere.Clear(); //condComponent.AddComponent("UPPER(Alias)", strUserName.ToUpper(), SearchComponent.Equals, SearchPad.Ex); ccWhere.AddComponent("UPPER(UserName)", username.ToUpper(), SearchComponent.Equals, SearchPad.NULL); ccWhere.AddComponent("Passwd", CryptoHelper.StaticEncrypt(password), SearchComponent.Equals, SearchPad.And); ModelClient objUser = servComm.GetEntity <ModelClient>(null, ccWhere); if (objUser != null && objUser.ID > 0) { Session["UserName"] = username; Session["objUser"] = objUser; Session["UserName"] = objUser.Client; //servComm.ExecuteSql("insert into Visitor values ( getdate())"); if (objUser.Class == "S") { Session["AccessMenu"] = "S"; } else { DataTable dtRole = servComm.ExecuteSqlDatatable("select Role" + objUser.Class + " from base"); if (dtRole.Rows.Count > 0) { Session["AccessMenu"] = dtRole.Rows[0][0].ToString(); } if (Session["AccessMenu"] == null) { Session["AccessMenu"] = ""; } } Response.Redirect("index.aspx"); } else { Page.ClientScript.RegisterStartupScript(GetType(), "sucess", "layer.msg('用户名或密码错误');", true); } }
private void GetPatientList(string orderID) { int iCount = 1; 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("Order_ID", orderID, SearchComponent.Equals, SearchPad.NULL); servCommfac.strOrderString = "id"; string countsql = "select count(1) FROM orders a inner join OrdersDetail b on a.Order_ID = b.Order_ID and a.serial = b.serial inner join products c on b.ProductId = c.id where a.outflag = 'N' and a.Order_ID = '" + orderID + "' and a.serial = 0 "; DataTable dtCount = servCommfac.ExecuteSqlDatatable(countsql); int AllRowCount = int.Parse(dtCount.Rows[0][0].ToString()); string sqlview = "select * from ( select ROW_NUMBER() over(order by a.Order_ID) as rowIndex ,a.Order_ID,a.serial,a.ModelNo,a.seller,a.sellerid,a.hospital,a.hospitalid,a.doctor,a.patient,b.subId,c.itemname as productName,c.Valid,b.a_teeth,b.b_teeth,b.c_teeth,b.d_teeth,a.regtime,a.Area,b.bColor,a.OutDate,a.tel,a.QlyName,a.QlyTime,c.LinkCard as Element " + " FROM orders a inner join OrdersDetail b on a.Order_ID = b.Order_ID and a.serial = b.serial inner join products c on b.ProductId = c.id where a.outflag = 'N' and a.Order_ID = '" + orderID + "' and a.serial = '" + 0 + "' ) t where rowindex between '" + ((iPageIndex - 1) * iCount + 1).ToString() + "' and '" + (iPageIndex * iCount).ToString() + "'"; DataTable dtZhujian = servCommfac.ExecuteSqlDatatable(sqlview); dtZhujian.TableName = "DataPatient"; if (iPageCount <= 1 && dtZhujian.Rows.Count > 0) { iPageCount = ((AllRowCount - 1) / iCount) + 1; iPageIndex = 1; } string backstr = Json.DataTable2Json(dtZhujian, ",\"PageCount\":" + iPageCount.ToString()); if (backstr.IndexOf("\\") >= 0) { backstr = backstr.Replace("\\", "\\\\"); } Response.Write(backstr); Response.End(); }
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(); }
private void BindFinanceView() { this.FinanceReportViewer.LocalReport.DataSources.Clear(); string Order_ID = Request["Order_ID"]; string serial = Request["serial"]; facservComm = new ServiceCommon(base.factoryConnectionString); ccWhere.Clear(); ccWhere.AddComponent("Order_ID", Order_ID, SearchComponent.Equals, SearchPad.NULL); ccWhere.AddComponent("serial", serial, SearchComponent.Equals, SearchPad.And); facservComm.strOrderString = "cast(qsserial as int)"; ccWhere.AddComponent("class", this.ItemClass.SelectedValue, SearchComponent.Equals, SearchPad.And); //DataTable dtProductCheckReport = facservComm.GetListTop(0, "* ", "VWProductCheckReport", ccWhere); DataTable dtProductCheckReport = facservComm.ExecuteSqlDatatable(VWProductCheckReport + " where " + ccWhere.sbComponent); //this.FinanceReportViewer.LocalReport.SetParameters(new ReportParameter("paraIndate", "2015年01月01日")); //this.FinanceReportViewer.LocalReport.SetParameters(new ReportParameter("paraOutDate", DateTime.Now.Year.ToString() + "年" + DateTime.Now.Month.ToString() + "月" + DateTime.Now.Day + "日")); this.FinanceReportViewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dtProductCheckReport)); }
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { ((HtmlContainerControl)Master.FindControl("HTitle")).InnerText = "订单详细"; } servCommfac = new ServiceCommon(base.factoryConnectionString); orderID = Request["orderID"]; serialID = Request["serial"]; ccWhere.Clear(); ccWhere.AddComponent("Order_ID", orderID, SearchComponent.Equals, SearchPad.NULL); ccWhere.AddComponent("serial", serialID, SearchComponent.Equals, SearchPad.And); IList <ORDERS> listOrder = servCommfac.GetListTop <ORDERS>(0, "seller,hospital,doctor,Patient,Order_ID,indate,preoutDate,OutDate,Sex,Age,Fenge,Require,Courier,CourierNo,OutSay,ModelNo", "orders", ccWhere); if (listOrder.Count > 0) { orderModel = listOrder[0]; } DataTable dtProduct = servCommfac.ExecuteSqlDatatable("SELECT Order_ID,serial,ProductId,itemname FROM OrdersDetail a left join products b on a.productid = b.id where Order_ID = '" + orderID + "' and serial = '" + serialID + "'"); for (int i = 0; i < dtProduct.Rows.Count; i++) { ProductId = dtProduct.Rows[i]["ProductId"].ToString(); itemname = dtProduct.Rows[i]["itemname"].ToString(); itemnamelist.Add(itemname); ProductIdlist.Add(ProductId); for (int j = 0; j < itemnamelist.Count(); j++) { itemname = dtProduct.Rows[i]["itemname"].ToString(); ProductId = dtProduct.Rows[i]["ProductId"].ToString(); } } } catch (Exception ex) { } }
private void GetProcedureList(string orderID) { 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("Order_ID", orderID, SearchComponent.Equals, SearchPad.NULL); servCommfac.strOrderString = "id"; DataTable dtZhujian1 = servCommfac.ExecuteSqlDatatable("exec SPZhijian " + orderID + "," + ((iPageIndex - 1) * iCount + 1).ToString() + "," + (iPageIndex * iCount).ToString()); string zhijiansql = "SELECT b.itemname as ProductName,a.Order_ID,a.itemQty,a.dept,a.producer,a.getin,isnull(a.Finish, a.PreTime) as finishTime,c.name as procedureName,isnull(itemQty, 0) as itemQty,productid,a.Gserial" + ",case when a.Id = (select MIN(id) from[zhijian] zj where a.productid = zj.productid and zj.Order_ID = @oderID and zj.serial = 0 and zj.overflag <> 'F' ) then 'M' else a.overflag end overflag,rtrim(a.a_teeth) + ',' + rtrim(a.b_teeth) + ',' + rtrim(a.c_teeth) + ',' + rtrim(a.d_teeth) as teethPosition, " + " case when a.Upweb = 'Y' then '传完' else '未传' end Upweb,a_teeth, b_teeth, c_teeth, d_teeth FROM [zhijian] a inner join products b on a.productid = b.id inner join working_procedure c on a.Gserial = c.serial where a.Order_ID = '" + orderID + "' and a.serial = 0 order by ProductName,Gserial"; DataTable dtZhujian = servCommfac.ExecuteSqlDatatable(zhijiansql); dtZhujian.TableName = "DataZhiJian"; if (iPageCount <= 1 && dtZhujian.Rows.Count > 0) { int AllRowCount = int.Parse(dtZhujian.Rows[0]["AllRowCout"].ToString()); iPageCount = ((AllRowCount - 1) / iCount) + 1; iPageIndex = 1; } string backstr = Json.DataTable2Json(dtZhujian, ",\"PageCount\":" + iPageCount.ToString()); if (backstr.IndexOf("\\") >= 0) { backstr = backstr.Replace("\\", "\\\\"); } Response.Write(backstr); Response.End(); }
private void BindModelProcessingSummary(bool initFlg = false) { this.FinanceReportViewer.LocalReport.DataSources.Clear(); if (initFlg == true) { this.FinanceReportViewer.Visible = false; } else { this.FinanceReportViewer.Visible = true; string HospitalList = Request["HospitalList"]; ccWhere.Clear(); if (!String.IsNullOrEmpty(this.seller.SelectedValue)) { ccWhere.AddComponent("sellerid", this.seller.SelectedValue, SearchComponent.Equals, SearchPad.NULL); } if (!String.IsNullOrEmpty(HospitalList)) { ccWhere.AddComponent("hospitalid", "(" + HospitalList.Replace(":", ",") + ")", SearchComponent.In, SearchPad.And); } if (!String.IsNullOrEmpty(this.OrderNo.Text)) { ccWhere.AddComponent("Order_ID", this.OrderNo.Text, SearchComponent.Like, SearchPad.And); } string orderClass = ""; for (int i = 0; i < this.orderType.Items.Count; i++) { if (this.orderType.Items[i].Selected == true) { orderClass = orderClass + ",'" + this.orderType.Items[i].Value + "'"; } } if (!String.IsNullOrEmpty(orderClass)) { orderClass = "(" + orderClass.Trim(',') + ")"; ccWhere.AddComponent("orderclass", orderClass, SearchComponent.In, SearchPad.And); } string dateselect = Request["dateselect"]; if (!String.IsNullOrEmpty(dateselect)) { if (dateselect == "0") { ccWhere.AddComponent("indate", Request["txtdatefrom"], SearchComponent.GreaterOrEquals, SearchPad.And); ccWhere.AddComponent("indate", Request["txtdateto"], SearchComponent.LessOrEquals, SearchPad.And); } else { ccWhere.AddComponent("outdate", Request["txtdatefrom"], SearchComponent.GreaterOrEquals, SearchPad.And); ccWhere.AddComponent("outdate", Request["txtdateto"], SearchComponent.LessOrEquals, SearchPad.And); } } GetFilterByKind(ref ccWhere, "Report"); // DataTable dtModelProcessing = facservComm.GetListTop(0, "* ", "ModelProcessingSummary", ccWhere); DataTable dtModelProcessing = facservComm.ExecuteSqlDatatable(ModelProcessingSummary + " and " + ccWhere.sbComponent); this.FinanceReportViewer.LocalReport.SetParameters(new ReportParameter("paraIndate", "2015年01月01日")); this.FinanceReportViewer.LocalReport.SetParameters(new ReportParameter("paraOutDate", DateTime.Now.Year.ToString() + "年" + DateTime.Now.Month.ToString() + "月" + DateTime.Now.Day + "日")); this.FinanceReportViewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dtModelProcessing)); } }
private void BindComfirmdeListReport(bool initFlg = false) { if (initFlg) { this.ConfirmDeList.Visible = false; } else { this.ConfirmDeList.Visible = true; this.ConfirmDeList.LocalReport.DataSources.Clear(); string HospitalList = Request["HospitalList"]; string dateselect = Request["dateselect"]; ccWhere.Clear(); ccWhere.AddComponent("sellerid", this.seller.SelectedValue, SearchComponent.Equals, SearchPad.NULL); if (!String.IsNullOrEmpty(HospitalList)) { ccWhere.AddComponent("hospitalid", "(" + HospitalList.Replace(":", ",") + ")", SearchComponent.In, SearchPad.And); } if (!String.IsNullOrEmpty(dateselect)) { if (dateselect == "0") { ccWhere.AddComponent("indate", ConvertShortDate(Request["txtdatefrom"]), SearchComponent.GreaterOrEquals, SearchPad.And); ccWhere.AddComponent("indate", ConvertShortDate(Request["txtdateto"]), SearchComponent.LessOrEquals, SearchPad.And); } else if (dateselect == "1") { ccWhere.AddComponent("outdate", ConvertShortDate(Request["txtdatefrom"]), SearchComponent.GreaterOrEquals, SearchPad.And); ccWhere.AddComponent("outdate", ConvertShortDate(Request["txtdateto"]), SearchComponent.LessOrEquals, SearchPad.And); } else { ccWhere.AddComponent("preoutdate", Request["txtpredate"], SearchComponent.Equals, SearchPad.And); } } if (!String.IsNullOrEmpty(this.CaseNo.Text)) { ccWhere.AddComponent("ModelNo", this.CaseNo.Text, SearchComponent.Like, SearchPad.And); } string charges = ""; string orderClass = ""; for (int i = 0; i < this.charges.Items.Count; i++) { if (this.charges.Items[i].Selected == true) { charges = charges + ",'" + this.charges.Items[i].Value + "'"; } } if (!String.IsNullOrEmpty(charges)) { charges = "(" + charges.Trim(',') + ")"; ccWhere.AddComponent("charges", charges, SearchComponent.In, SearchPad.And); } for (int i = 0; i < this.orderType.Items.Count; i++) { if (this.orderType.Items[i].Selected == true) { orderClass = orderClass + ",'" + this.orderType.Items[i].Value + "'"; } } if (!String.IsNullOrEmpty(orderClass)) { orderClass = "(" + orderClass.Trim(',') + ")"; ccWhere.AddComponent("orderclasscode", orderClass, SearchComponent.In, SearchPad.And); } GetFilterByKind(ref ccWhere, "Report"); //DataTable dtModelProcessing = facservComm.ExecuteSqlDatatable("select * from VWConfirmDeList"); DataTable dtConfirmDeList = facservComm.ExecuteSqlDatatable(ConfirmDeList + " where " + ccWhere.sbComponent); // DataTable dtConfirmDeList = facservComm.GetListTop(0, "* ", "VWConfirmDeList", ccWhere); this.ConfirmDeList.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dtConfirmDeList)); this.ConfirmDeList.DataBind(); this.ConfirmDeList.LocalReport.Refresh(); //} } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ((HtmlContainerControl)Master.FindControl("HTitle")).InnerText = IsCN ? "结算单汇总表" : "Finace Summary"; } querycontrol.DispalyType = "1"; servCommfac = new ServiceCommon(base.factoryConnectionString); 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); } int 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; } string condition = ccWhere.sbComponent.ToString() == "" ? "" : " and " + ccWhere.sbComponent.ToString(); if (GetOrganization.Count >= 2) { string userHospitalID = GetOrganization["hospitalid"].ToString(); DataTable dt = servCommfac.ExecuteSqlDatatable("SELECT PrntPrices FROM [Hospital] where id =" + userHospitalID); string PrntPrices = ""; if (dt.Rows.Count > 0) { string serial = ""; PrntPrices = dt.Rows[0][0].ToString().Trim(); if (PrntPrices == "产品模板") { serial = PrntPrices; } else { if (PrntPrices != null && !"".Equals(PrntPrices)) { for (int i = 0; i < PrntPrices.ToCharArray().Length; i++) { if (PrntPrices.ToCharArray()[i] >= 48 && PrntPrices.ToCharArray()[i] <= 57) { serial = serial + PrntPrices.ToCharArray()[i]; } else { break; } } } } if (Utils.IsNoSP) { if (serial == "") { string sql = "SELECT row_number()over(order by products.id) as rowIndex, products.itemname,SUM(ordersdetail.Qty) as Qty ,null as price,null as amount,SUM(ordersdetail.NobleWeight) as NobleWeight,SUM(ordersdetail.nobleAmount) as nobleAmount FROM orders, OrdersDetail, products WHERE(OrdersDetail.Order_ID = orders.Order_ID) and (OrdersDetail.serial = orders.serial) and " + " (OrdersDetail.ProductId = products.id) and products.itemname is not null " + condition + " group by products.id,products.itemname"; dtAllFinaceSummary = servCommfac.ExecuteSqlDatatable(sql); } else { string sql = "SELECT row_number()over(order by products.id) as rowIndex, products.itemname,SUM(ordersdetail.Qty) as Qty ,sum(products.price) as price,SUM(ordersdetail.Qty * prices.price) as amount,SUM(ordersdetail.NobleWeight) as NobleWeight,SUM(ordersdetail.nobleAmount) as nobleAmount " + " FROM orders, OrdersDetail, products, prices WHERE(OrdersDetail.Order_ID = orders.Order_ID) and (OrdersDetail.serial = orders.serial) and (OrdersDetail.ProductId = products.id) and products.id = prices.productid and prices.serial = '" + serial + "' and products.itemname is not null " + condition + " group by products.id,products.itemname "; dtAllFinaceSummary = servCommfac.ExecuteSqlDatatable(sql); } } else { dtAllFinaceSummary = servCommfac.ExecuteSqlDatatable(" exec [SPWXFinaceSummaryByHospital] '" + condition.Replace("'", "''") + "' , N'" + serial + "'"); } } } else { if (Utils.IsNoSP) { string sql = "SELECT row_number()over(order by products.id) as rowIndex, products.itemname,SUM(ordersdetail.Qty) as Qty ,SUM(ordersdetail.price) as price,SUM(ordersdetail.amount) as amount,SUM(ordersdetail.NobleWeight) as NobleWeight,SUM(ordersdetail.nobleAmount) as nobleAmount " + " FROM orders, OrdersDetail, products WHERE(OrdersDetail.Order_ID = orders.Order_ID) and (OrdersDetail.serial = orders.serial) and (OrdersDetail.ProductId = products.id) and products.itemname is not null " + condition + " group by products.id,products.itemname"; dtAllFinaceSummary = servCommfac.ExecuteSqlDatatable(sql); } else { dtAllFinaceSummary = servCommfac.ExecuteSqlDatatable(" exec [SPWXFinaceSummaryBySeller] '" + condition.Replace("'", "''") + "'"); } } sumQty = dtAllFinaceSummary.Compute("sum(Qty)", "").ToString(); sumAmount = dtAllFinaceSummary.Compute("sum(amount)", "").ToString(); sumNobleWeight = dtAllFinaceSummary.Compute("sum(NobleWeight)", "").ToString(); sumNobleAmount = dtAllFinaceSummary.Compute("sum(NobleAmount)", "").ToString(); int rowcount = dtAllFinaceSummary.Rows.Count; this.pagecutID.iPageNum = (rowcount - 1) / 10 + 1; if (dtAllFinaceSummary.Rows.Count > 0) { dtFinaceSummary = dtAllFinaceSummary.Select(" rowIndex>=" + ((pagecutID.iPageIndex - 1) * 10 + 1).ToString() + " and rowIndex <=" + pagecutID.iPageIndex * 10).CopyToDataTable(); } else { dtFinaceSummary = dtFinaceSummary.Clone(); } }
private void getSceneryList() { 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("OrderNumber", Request["OrderNumber"], SearchComponent.Equals, SearchPad.NULL); ccWhere.AddComponent("BelongFactory", LoginUser.BelongFactory, SearchComponent.Equals, SearchPad.And); servComm.strOrderString = " ModifyDate desc "; DataTable dtTalk = servComm.GetListTop(0, "OrderMessage", ccWhere); List <string> talkList = new List <string>(); List <string> talkListTemp = new List <string>(); List <string> pageTalkList = new List <string>(); if (CacheHelper.GetInfoByIdentify(LoginUser.BelongFactory + "|" + Request["OrderNumber"]) != null) { talkListTemp = CacheHelper.GetInfoByIdentify(LoginUser.BelongFactory + "|" + Request["OrderNumber"]); //talkListTemp.Reverse(); talkList.AddRange(talkListTemp.AsEnumerable <string>()); talkList.Reverse(); } for (int i = 0; i < dtTalk.Rows.Count; i++) { talkListTemp = XmlSerializerHelper.DeserializeObject(dtTalk.Rows[i]["TalkContent"].ToString()); talkListTemp.Reverse(); talkList.AddRange(talkListTemp.AsEnumerable <string>()); } pageTalkList = talkList.GetRange((iPageIndex - 1) * iPageCount, (talkList.Count - (iPageIndex - 1) * iPageCount) > 10 ? 10 : talkList.Count - (iPageIndex - 1) * iPageCount); pageTalkList.Reverse(); if (iPageCount <= 1) { iPageCount = servComm.PageCount; iPageIndex = 1; } int PageCount = (talkList.Count - 1) / iPageCount + 1; string talkJson = ""; //string backstr = Json.ListToJson("replyJson", talkList, string.Format("\"PageCount\":\"{0}\",", iPageCount)).Replace("\n", "<br/>").Replace("\r", "<br/>"); for (int i = 0; i < pageTalkList.Count; i++) { string talkTime = pageTalkList[i].Split('|')[0]; string talkUser = pageTalkList[i].Split('|')[1]; string talkMessage = pageTalkList[i].Replace(talkTime + "|" + talkUser + "|", "").Replace("\"", "\\\"").Replace("\n", "").Replace("\r", ""); talkJson = talkJson + ",{" + "\"TalkMessage\":" + "\"" + talkMessage + "\"" + ",\"TalkTime\":" + "\"" + talkTime + "\"" + ",\"TalkUser\":" + "\"" + talkUser + "\"" + "}"; } if (talkJson == "") { Response.Write("{\"PageCount\":0}"); Response.End(); } else { talkJson = talkJson.Substring(1); talkJson = "{" + "\"PageCount\":" + PageCount + ",\"replyJson\"" + ":[" + talkJson + "]}"; //if (talkJson.IndexOf("\\") >= 0) //{ // talkJson = talkJson.Replace("\\", "\\\\"); //} Response.Write(talkJson); Response.End(); } }
/// <summary> /// 绑定分类 /// </summary> protected DataTable BindDictClass(ServiceCommon facComm, ConditionComponent ccWhere, string ClassID) { ccWhere.Clear(); ccWhere.AddComponent("ClassID", ClassID, SearchComponent.Equals, SearchPad.NULL); return(facComm.GetListTop(0, " Code,DictName ", "DictDetail", ccWhere)); }
private void BindReportView() { this.FinanceReportViewer.LocalReport.DataSources.Clear(); string HospitalList = Request["HospitalList"]; string dateselect = Request["dateselect"]; ccWhere.Clear(); ccWhere.AddComponent("sellerid", this.seller.SelectedValue, SearchComponent.Equals, SearchPad.NULL); if (!String.IsNullOrEmpty(HospitalList)) { ccWhere.AddComponent("hospitalid", "(" + HospitalList.Replace(":", ",") + ")", SearchComponent.In, SearchPad.And); } if (!String.IsNullOrEmpty(dateselect)) { if (dateselect == "0") { ccWhere.AddComponent("indate", ConvertShortDate(Request["txtdatefrom"]), SearchComponent.GreaterOrEquals, SearchPad.And); ccWhere.AddComponent("indate", ConvertShortDate(Request["txtdateto"]), SearchComponent.LessOrEquals, SearchPad.And); } else if (dateselect == "1") { ccWhere.AddComponent("outdate", ConvertShortDate(Request["txtdatefrom"]), SearchComponent.GreaterOrEquals, SearchPad.And); ccWhere.AddComponent("outdate", ConvertShortDate(Request["txtdateto"]), SearchComponent.LessOrEquals, SearchPad.And); } else { ccWhere.AddComponent("preoutdate", Request["txtpredate"], SearchComponent.Equals, SearchPad.And); } } if (!String.IsNullOrEmpty(this.OrderNo.Text)) { ccWhere.AddComponent("orders.Order_ID", this.OrderNo.Text, SearchComponent.Like, SearchPad.And); } //if (!String.IsNullOrEmpty(Request["txtpredate"])) //{ // ccWhere.AddComponent("preoutdate", Request["txtpredate"], SearchComponent.Equals, SearchPad.And); //} string charges = ""; string orderClass = ""; for (int i = 0; i < this.charges.Items.Count; i++) { if (this.charges.Items[i].Selected == true) { charges = charges + ",'" + this.charges.Items[i].Value + "'"; } } if (!String.IsNullOrEmpty(charges)) { charges = "(" + charges.Trim(',') + ")"; ccWhere.AddComponent("charges", charges, SearchComponent.In, SearchPad.And); } for (int i = 0; i < this.orderType.Items.Count; i++) { if (this.orderType.Items[i].Selected == true) { orderClass = orderClass + ",'" + this.orderType.Items[i].Value + "'"; } } if (!String.IsNullOrEmpty(orderClass)) { orderClass = "(" + orderClass.Trim(',') + ")"; ccWhere.AddComponent("orderclass", orderClass, SearchComponent.In, SearchPad.And); } GetFilterByKind(ref ccWhere, "Report"); //DataTable dtFinaceSummary = facservComm.GetListTop(0, "* ", "VWFinaceSummary", ccWhere); DataTable dtFinaceSummary = facservComm.ExecuteSqlDatatable(FinanceSummary + " and " + ccWhere.sbComponent); DataTable dtOneRow = new ReportDataSet.OneRowTableDataTable(); dtOneRow.Rows.Add(dtOneRow.NewRow()); dtOneRow.Rows[0][0] = dtFinaceSummary.Compute("min(indate)", ""); dtOneRow.Rows[0][1] = dtFinaceSummary.Compute("max(indate)", ""); dtOneRow.Rows[0][2] = Request["HidHospitalName"]; this.FinanceReportViewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dtFinaceSummary)); this.FinanceReportViewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet2", dtOneRow)); this.FinanceReportViewer.DataBind(); this.FinanceReportViewer.LocalReport.Refresh(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ((HtmlContainerControl)Master.FindControl("HTitle")).InnerText = IsCN ? "来模加工统计表" : "Seller Summary"; } servCommfac = new ServiceCommon(base.factoryConnectionString); ccWhere.Clear(); ccWhere = querycontrolSM.GetCondtion(); string condition = ccWhere.sbComponent.ToString() == "" ? "" : " and " + ccWhere.sbComponent.ToString(); hddpnumbers = yeyRequest.Params("hpnumbers"); int iCount = 5; 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 (Request["submitflg"] != null && Request["submitflg"] == "1") { iPageIndex = 1; } string viewsql = "select orders.seller,products.itemname as itemname ,'' as amount,'' as ordernumber,sum(OrdersDetail.Qty) as Qty,'1' as Flg from orders inner join ordersdetail on " + "orders.Order_ID = ordersdetail.Order_ID and orders.serial = ordersdetail.serial inner join products on products.id = ordersdetail.productid inner join classSet on classSet.ClassID = products.smallclass where (ordersdetail.Amount is not null or ordersdetail.nobleAmount is not null) " + condition + " group by orders.seller,products.itemname union all select orders.seller,'',sum(isnull(ordersdetail.Amount, 0) + isnull(ordersdetail.nobleAmount, 0)) as amount,count(distinct orders.Order_ID) as ordernumber,'' as Qty,'2' as Flg " + " from orders inner join ordersdetail on orders.Order_ID = ordersdetail.Order_ID and orders.serial = ordersdetail.serial inner join products on products.id = ordersdetail.productid inner join classSet on classSet.ClassID = products.smallclass where (ordersdetail.Amount is not null or ordersdetail.nobleAmount is not null) " + condition + " group by orders.seller union all select '合计数量',products.itemname as itemname,sum(isnull(ordersdetail.Amount, 0) + isnull(ordersdetail.nobleAmount, 0)) as amount,'' as ordernumber,sum(OrdersDetail.Qty) as Qty,'3' as Flg from orders inner join ordersdetail on orders.Order_ID = ordersdetail.Order_ID and orders.serial = ordersdetail.serial inner join products on products.id = ordersdetail.productid inner join classSet on classSet.ClassID = products.smallclass " + " where (ordersdetail.Amount is not null or ordersdetail.nobleAmount is not null) " + condition + " group by products.itemname union all select '合计金额','' as itemname,sum(isnull(ordersdetail.Amount, 0) + isnull(ordersdetail.nobleAmount, 0)) as amount,count(distinct orders.Order_ID) as ordernumber,'' as Qty,'4' as Flg " + " from orders inner join ordersdetail on orders.Order_ID = ordersdetail.Order_ID and orders.serial = ordersdetail.serial inner join products on products.id = ordersdetail.productid inner join classSet on classSet.ClassID = products.smallclass where (ordersdetail.Amount is not null or ordersdetail.nobleAmount is not null) " + condition + " order by Flg,orders.seller "; dtAllFinaceSummary = servCommfac.ExecuteSqlDatatable(viewsql); DataView dataView = dtAllFinaceSummary.DefaultView; dataView.Sort = "itemname"; dataView.RowFilter = "itemname <> ''"; DataTable dataTableDistinct = dataView.ToTable(true, "itemname"); widthgrid = 240 + (dataTableDistinct.Rows.Count + 2) * 40; dtSource.Columns.Add("序号"); dtSource.Columns.Add("营销员"); dtSource.Columns.Add("应收金额"); dtSource.Columns.Add("订单数量"); for (int i = 0; i < dataTableDistinct.Rows.Count; i++) { if (dataTableDistinct.Rows[i][0].ToString() != "") { dtSource.Columns.Add(dataTableDistinct.Rows[i][0].ToString()); } } int rowAdd = dataTableDistinct.Rows.Count % 3; if (rowAdd > 0) { for (int i = 0; i < (3 - rowAdd); i++) { dataTableDistinct.Rows.Add(dataTableDistinct.NewRow()); } } this.querycontrolSM.dtSource = dataTableDistinct; DataRow dr = null; DataRow dr2 = null; string seller = ""; string flg = ""; int rowIndex = 0; foreach (DataRow item in dtAllFinaceSummary.Rows) { if (item["Flg"].ToString() == "1") { if (seller != item["Seller"].ToString()) { flg = "1"; seller = item["Seller"].ToString(); dtSource.Rows.Add(dtSource.NewRow()); dr = dtSource.Rows[rowIndex]; dr["营销员"] = item["seller"]; rowIndex = rowIndex + 1; dr["序号"] = rowIndex; } dr[item["itemname"].ToString()] = item["Qty"]; } if (item["Flg"].ToString() == "2") { if (flg == "1") { rowIndex = 0; } flg = "2"; dr = dtSource.Rows[rowIndex]; dr["应收金额"] = decimal.Parse(item["amount"].ToString()).ToString("N0"); dr["订单数量"] = item["ordernumber"]; rowIndex = rowIndex + 1; } if (item["Flg"].ToString() == "3") { if (seller != item["Seller"].ToString()) { seller = item["Seller"].ToString(); dtSource.Rows.Add(dtSource.NewRow()); dr = dtSource.Rows[rowIndex]; rowIndex = rowIndex + 1; dtSource.Rows.Add(dtSource.NewRow()); dr2 = dtSource.Rows[rowIndex]; dr["营销员"] = "合计数量"; dr2["营销员"] = "合计金额"; } dr[item["itemname"].ToString()] = item["Qty"]; dr2[item["itemname"].ToString()] = decimal.Parse(item["amount"].ToString()).ToString("N0"); } if (item["Flg"].ToString() == "4" && rowIndex > 0) { dtSource.Rows[rowIndex - 1]["订单数量"] = item["ordernumber"]; dtSource.Rows[rowIndex]["应收金额"] = decimal.Parse(item["amount"].ToString()).ToString("N0");; } } //sumAmount = dtAllFinaceSummary.Compute("sum(amount)", "").ToString(); //int rowcount = dtAllFinaceSummary.Rows.Count; //this.pagecutID.iPageNum = (rowcount - 1) / 10 + 1; //if (dtAllFinaceSummary.Rows.Count > 0) //{ // dtFinaceSummary = dtAllFinaceSummary.Select(" rowIndex>=" + ((pagecutID.iPageIndex - 1) * 10 + 1).ToString() + " and rowIndex <=" + pagecutID.iPageIndex * 10).CopyToDataTable(); //} //else //{ // dtFinaceSummary = dtAllFinaceSummary.Clone(); //} }
protected void btnConsume_Click(object sender, EventArgs e) { ccWhere.Clear(); ccWhere.AddComponent("JGCBM", LoginUser.BelongFactory, SearchComponent.Equals, SearchPad.NULL); JX_USERS jxUser = servComm.GetEntity <JX_USERS>(null, ccWhere); if (!String.IsNullOrEmpty(jxUser.PayNoCardMerId) && Request["paymethod"] == "1" || Request["paymethod"] != "1" && !String.IsNullOrEmpty(jxUser.PayB2CMerId)) { //Dictionary<string, string> param = new Dictionary<string, string>(); //// 随机构造一个订单号(演示用) Random rnd = new Random(); string orderID = DateTime.Now.ToString("yyyyMMddHHmmss") + ((rnd.Next(900) + 100).ToString() + "0").Substring(0, 2).Trim(); ////填写参数 //param["version"] = "5.0.0";//版本号 //param["encoding"] = "UTF-8";//编码方式 //param["certId"] = CertUtil.GetSignCertId(); //证书ID //param["txnType"] = "01";//交易类型 //param["txnSubType"] = "01";//交易子类 //param["bizType"] = "000201";//业务类型 //param["frontUrl"] = "http://localhost:58826/BankPay/FrontRcvResponse.aspx?type=BankPay"; //前台通知地址 //param["backUrl"] = "http://222.222.222.222:8080/demo/utf8/BackRcvResponse.aspx"; //后台通知地址,改自己的外网地址 //param["signMethod"] = "01";//签名方法 //param["channelType"] = "08";//渠道类型,07-PC,08-手机 //param["accessType"] = "0";//接入类型 //param["merId"] = "481601512173917";//商户号,请改成自己的商户号 481601512173917,777290058110097 //param["orderId"] = orderID;//商户订单号,可任意修改 //param["txnTime"] = DateTime.Now.ToString("yyyyMMddHHmmss");//订单发送时间 //param["txnAmt"] = "1";//交易金额,单位分 //param["currencyCode"] = "156";//交易币种 ////param["orderDesc"] = "订单描述";//订单描述,暂时不会起作用 //param["reqReserved"] = "透传信息";//请求方保留域,透传字段,查询、通知、对账文件中均会原样出现 //SDKUtil.Sign(param, Encoding.UTF8); //// 将SDKUtil产生的Html文档写入页面,从而引导用户浏览器重定向 //string html = SDKUtil.CreateAutoSubmitForm(SDKConfig.FrontTransUrl, param, Encoding.UTF8); //Response.ContentEncoding = Encoding.UTF8; // 指定输出编码 //Response.Write(html); Hashtable myMap = new Hashtable(); //无卡支付 string payAmount = Request["actualAmount"]; myMap.Add("MerOrderNo", orderID); myMap.Add("TranDate", DateTime.Now.ToString("yyyyMMdd")); myMap.Add("TranTime", DateTime.Now.ToString("hhmmss")); myMap.Add("OrderAmt", (int)(decimal.Parse(payAmount) * 100)); //myMap.Add("OrderAmt", 1); myMap.Add("BusiType", "0001"); myMap.Add("AccessType", "0"); myMap.Add("AcqCode", "000000000000014"); myMap.Add("MerPageUrl", Request.Url.GetLeftPart(UriPartial.Authority) + "/BankPay/FrontRcvResponse.aspx?type=BankPay"); myMap.Add("MerBgUrl", Request.Url.GetLeftPart(UriPartial.Authority) + "/BankPay/BgRcvResponse.aspx?type=BankPay"); myMap.Add("CurryNo", "CNY"); //myMap.Add("SplitType", ""); //myMap.Add("SplitMethod", ""); //myMap.Add("MerSplitMsg", ""); //myMap.Add("PayTimeOut", "145"); myMap.Add("Version", "20140728"); //myMap.Add("CommodityMsg", "ChinaPay测试-商品信息"); //myMap.Add("MerResv", "ChinaPay测试-商户保留域"); //myMap.Add("TranReserved", "{\"Referred\":\"www.chinapay.com\",\"BusiId\":\"0001\",\"TimeStamp\":\"1438915150976\",\"Remoteputr\":\"172.16.9.44\"}"); myMap.Add("TranType", "0001"); SecssUtil obj = new SecssUtil(); WNetPay payModel = new WNetPay(); //TODO 其他特殊用法请查看 pages/api_01_gateway/special_use_purchase.htm if (Request["paymethod"] == "1") { payModel.PayMethod = "0"; myMap.Add("MerId", jxUser.PayNoCardMerId); obj.init(Request.PhysicalApplicationPath + "/ChinaPay/" + jxUser.PayNoCardMerId + "/security.properties"); //初始化安全控件: } else { payModel.PayMethod = "1"; //B2C支付 //myMap.Add("BankInstNo", "700000000000010"); myMap.Add("MerId", jxUser.PayB2CMerId); obj.init(Request.PhysicalApplicationPath + "/ChinaPay/" + jxUser.PayB2CMerId + "/securityb2c.properties"); //初始化安全控件: } //bool ee = obj.sign(myMap); String chkValue = obj.getSign(); myMap.Add("Signature", chkValue); //obj.verify(myMap); if ("00" != obj.getErrCode()) { } payModel.OrderID = orderID; payModel.UserID = CurrentUserID; payModel.PayAmount = decimal.Parse(payAmount); payModel.JGCBM = LoginUser.BelongFactory; payModel.SubmitDateTime = DateTime.Now; payModel.PayStatus = "0"; payModel.Remark = "Remark"; servComm.AddOrUpdate(payModel); //chkValue = DelegatePay(orderID); // SDKUtil.Sign(param, System.Text.Encoding.UTF8); myMap["Signature"] = chkValue; string html = SDKUtil.CreateAutoSubmitFormHash(SDKConfig.FrontTransUrl, myMap, System.Text.Encoding.UTF8); // 将SDKUtil产生的Html文档写入页面,从而引导用户浏览器重定向 Response.ContentEncoding = Encoding.UTF8; // 指定输出编码 Response.Write(html); Response.End(); } else { Response.Write("请配置支付参数"); Response.End(); } }
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) { try { servCommfac = new ServiceCommon(factoryConnectionString); if (!IsPostBack) { ((HtmlContainerControl)Master.FindControl("HTitle")).InnerText = IsCN? "订单输入":"Order Input"; ddlOrderType.DataSource = BindDictClass(servCommfac, ccWhere, "OrderClass"); ddlOrderType.DataBind(); } timeStamp = TenpayUtil.getTimestamp(); signalticket = GetSignalTicket(timeStamp, Session["APPID"].ToString(), Session["APPSECRET"].ToString()); if (GetOrganization.Count > 0) { userSellerID = GetOrganization["sellerid"].ToString();; } if (GetOrganization.Count == 2) { userHospitalID = GetOrganization["hospitalid"].ToString(); } else if (GetOrganization.Count == 3) { userHospitalID = GetOrganization["hospitalid"].ToString(); userDoctorID = GetOrganization["doctorid"].ToString(); } GetSceneryTypeList(); GetColors(); GetDoctorRequire(); if (Request["action"] == "autoNo") { DataTable dtNumber = servComm.ExecuteSqlDatatable("select dbo.fn_GetAutoOrderNo(N'" + LoginUser.UserName + "','" + DateTime.Now.ToString("yyMMdd") + "','" + LoginUser.BelongFactory + "')"); if (dtNumber.Rows.Count > 0) { Response.Write(dtNumber.Rows[0][0].ToString().Trim()); Response.End(); } else { Response.Write(""); Response.End(); } } string serverImage = Request["uploadimage"]; string AccessoryList = Request["AccessoryList"]; string path = Server.MapPath("~" + SaveFilePath); //网站中有一个 uploadedFiles 文件夹,存储上传来的图片 string photoList = ""; //生成文件名(系统要重新生成一个文件名,但注意扩展名要相同。千万不要用中文名称!!!) Log.LogInfo(serverImage); if (!String.IsNullOrEmpty(serverImage)) { string file = string.Empty; string content = string.Empty; string strpath = string.Empty; string savepath = string.Empty; for (int i = 0; i < serverImage.Split(',').Length; i++) { string stUrl = "http://file.api.weixin.qq.com/cgi-bin/media/get?access_token=" + GetAccessToken(Session["APPID"].ToString(), Session["APPSECRET"].ToString()) + "&media_id=" + serverImage.Split(',')[i]; HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(stUrl); req.Method = "GET"; using (WebResponse wr = req.GetResponse()) { HttpWebResponse myResponse = (HttpWebResponse)req.GetResponse(); strpath = myResponse.ResponseUri.ToString(); WebClient mywebclient = new WebClient(); string filename = DateTime.Now.ToString("yyyyMMddHHmmssfff") + (new Random()).Next().ToString().Substring(0, 4) + ".jpg"; savepath = path + "\\" + filename; try { Log.LogInfo(savepath); mywebclient.DownloadFile(strpath, savepath); System.Drawing.Image img = System.Drawing.Image.FromFile(savepath); if (img.RawFormat.Equals(System.Drawing.Imaging.ImageFormat.Png)) { filename = DateTime.Now.ToString("yyyyMMddHHmmssfff") + (new Random()).Next().ToString().Substring(0, 4) + ".png"; img.Save(path + "\\" + filename); file = Request.Url.GetLeftPart(UriPartial.Authority) + SaveFilePath + filename; } else { file = Request.Url.GetLeftPart(UriPartial.Authority) + SaveFilePath + filename; } photoList = photoList + "," + file; Log.LogInfo(file); } catch (Exception ex) { Log.LogInfo(ex.Message); } } photoList = photoList.Trim(','); } } if (yeyRequest.Params("haddinfo") == "1") { string seller = Request["seller"]; string hospital = Request["hospital"]; string doctor = Request["doctor"]; string patient = Request["patient"]; ordreModel.ModelNo = Request["txtModelNo"]; ordreModel.OrderClass = ddlOrderType.Value; ordreModel.SellerID = decimal.Parse(seller); ordreModel.HospitalID = decimal.Parse(hospital); ordreModel.DoctorId = decimal.Parse(doctor); ordreModel.Patient = Request["txtpatient"]; if (Request["txtAge"] != "") { ordreModel.Age = decimal.Parse(Request["txtAge"]); } ordreModel.Sex = Request["ddlSex"]; ordreModel.danzuo = Request["ddlSingle"]; ordreModel.Fenge = Request["ddlDivision"]; if (!String.IsNullOrEmpty(Request["Require"])) { ordreModel.Require = Request["Require"].Replace("'", ""); } ordreModel.RegTime = DateTime.Now; ordreModel.RegName = LoginUser.UserName; ordreModel.BelongFactory = LoginUser.BelongFactory; if (!String.IsNullOrEmpty(yeyRequest.Params("keyID"))) { servComm.Update(ordreModel); } else { servComm.Add(ordreModel); } //string AccessoryList = Request["OtherList"]; if (AccessoryList != "") { servComm.ExecuteSql(" delete from W_ordersOther where ModelNo='" + Request["txtModelNo"] + "'and BelongFactory = '" + LoginUser.BelongFactory + "'"); string[] otherSplit = AccessoryList.Split(':'); WORDERSOTHER otherModel = new WORDERSOTHER(); ccWhere.Clear(); ccWhere.AddComponent("ClassID", "Accessory", SearchComponent.Equals, SearchPad.NULL); DataTable dtAccessory = servCommfac.GetListTop(0, "DictDetail", ccWhere); for (int i = 0; i < otherSplit.Length; i++) { string accessoryName = ""; if (dtAccessory.Select("Code = '" + otherSplit[i].Split(',')[0] + "'").Length > 0) { accessoryName = dtAccessory.Select("Code = '" + otherSplit[i].Split(',')[0] + "'")[0]["DictName"].ToString(); } otherModel.ModelNo = Request["txtModelNo"]; otherModel.SubId = i + 1; otherModel.Code = otherSplit[i].Split(',')[0]; otherModel.name = accessoryName; otherModel.qty = decimal.Parse(otherSplit[i].Split(',')[1]); otherModel.BelongFactory = LoginUser.BelongFactory; servComm.Add(otherModel); } } if (photoList != "") { servComm.ExecuteSql(" delete from W_OrderPhotos where ModelNo='" + Request["txtModelNo"] + "' and BelongFactory = '" + LoginUser.BelongFactory + "'"); string[] photoSplit = photoList.Split(','); WORDERSPHOTOS photoModel = new WORDERSPHOTOS(); for (int i = 0; i < photoSplit.Length; i++) { photoModel.ModelNo = Request["txtModelNo"]; photoModel.SubId = i + 1; photoModel.picpath = photoSplit[i]; photoModel.BelongFactory = LoginUser.BelongFactory; servComm.Add(photoModel); } } string[] ddlSmallClass = Request["ddlSmallClass"].Split(','); string[] ddlItemName = Request["ddlItemName"].Split(','); string[] righttop = Request["righttop"].Split(','); string[] lefttop = Request["lefttop"].Split(','); string[] rightbottom = Request["rightbottom"].Split(','); string[] leftbottom = Request["leftbottom"].Split(','); string[] ProductColor = Request["hidProductColor"].Split(','); string[] ProductCount = Request["ProductCount"].Split(','); servComm.ExecuteSql(" delete from W_OrdersDetail where ModelNo='" + Request["txtModelNo"] + "'and BelongFactory = '" + LoginUser.BelongFactory + "'"); int index = 1; for (int i = 0; i < ddlSmallClass.Length; i++) { WORDERSDETAIL detailMode = new WORDERSDETAIL(); detailMode.a_teeth = righttop[i]; detailMode.b_teeth = lefttop[i]; detailMode.c_teeth = rightbottom[i]; detailMode.d_teeth = leftbottom[i]; detailMode.ProductId = ddlItemName[i]; detailMode.bColor = ProductColor[i].Replace(":", ","); detailMode.Qty = int.Parse(ProductCount[i]); detailMode.subId = index; detailMode.ModelNo = Request["txtModelNo"]; detailMode.BelongFactory = LoginUser.BelongFactory; servComm.Add(detailMode); index = index + 1; } Response.Redirect("OrderInput.aspx"); } } catch (Exception ex) { } }
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×tamp=" + 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) { if (!IsPostBack) { listClassType = DataCache.findAllDict().Where(model => model.ClassID == "MaterialType").ToList(); listClassType.Insert(0, new ModelDictDetail() { }); 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); listDictType = DataCache.findAllDict().Where(model => model.ClassID == "BillType").ToList(); listDictType.Insert(0, new ModelDictDetail() { }); servComm.strOrderString = " OrderNo "; ccWhere.Clear(); ccWhere.AddComponent("OrderNo", null, SearchComponent.ISNOT, SearchPad.NULL); ccWhere.AddComponent("Bh", null, SearchComponent.ISNOT, SearchPad.And); IList <ModelSpec> listSaleDetail = servComm.GetListTop <ModelSpec>(0, "OrderNo,Bh", "Spec", ccWhere); string SpecJson = JsonConvert.SerializeObject(listSaleDetail, Formatting.Indented, new IsoDateTimeConverter()); OrderJson = SpecJson.Replace("\r\n", ""); } string Id = Request["Id"]; if (!String.IsNullOrEmpty(Id)) { servComm.strOrderString = "Id"; ModelSale modelSale = servComm.GetEntity <ModelSale>(Request["Id"]); var timeConvert = new IsoDateTimeConverter(); timeConvert.DateTimeFormat = "yyyy-MM-dd"; string modelJson = JsonConvert.SerializeObject(modelSale, Formatting.Indented, timeConvert); ccWhere.Clear(); ccWhere.AddComponent("Id", Id, SearchComponent.Equals, SearchPad.NULL); IList <ModelSaleDetail> listSaleDetail = servComm.GetListTop <ModelSaleDetail>(0, "*", "SaleDetail", ccWhere); string listJson = JsonConvert.SerializeObject(listSaleDetail, Formatting.Indented, timeConvert); EditJson = modelJson.Replace("}", ",\"DetailJson\":") + listJson + "}"; EditJson = EditJson.Replace("\r\n", ""); //"[{\"RowCount\":"+servComm.RowCount + ",\"JsonData\":"+ responseJson+"}]" } if (Request["actiontype"] == "SaveSales") { int identityID = 0; try { ModelSale modelSale = new ModelSale(); DateTime?TimeNull = null; modelSale.SaleDate = String.IsNullOrEmpty(Request["SaleDate"]) ? TimeNull : DateTime.Parse(Request["SaleDate"].ToString()); modelSale.Seller = Request["Seller"]; modelSale.Salesperson = Request["Salesperson"]; modelSale.BillDate = String.IsNullOrEmpty(Request["BillDate"]) ? TimeNull : DateTime.Parse(Request["BillDate"].ToString());; modelSale.BillNo = Request["BillNo"]; modelSale.Addr = Request["Addr"]; modelSale.Receiver = Request["Receiver"]; modelSale.Tel = Request["Tel"]; modelSale.Distri = Request["Distri"]; modelSale.DistriNo = Request["DistriNo"]; modelSale.BillClass = Request["BillClass"]; modelSale.IsDel = "0"; modelSale.Reg = LoginUser.UserName; modelSale.RegTime = DateTime.Now; if (String.IsNullOrEmpty(Request["Id"])) { identityID = servComm.Add(modelSale); } else { identityID = int.Parse(Request["Id"]); modelSale.Id = identityID; int result = servComm.Update(modelSale); } string jsonResult = Request["SalesDetail"]; jsonResult = jsonResult.Replace("[", "").Replace("]", "").Replace("},{", "}|{").Replace("\"Id\":\"\"", "\"Id\":" + identityID.ToString()); List <ModelSaleDetail> listModel = Utility.ConvertJsonToEntity <ModelSaleDetail>(jsonResult.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries)); servComm.ExecuteSql(" delete from SaleDetail where ID = '" + identityID + "';"); int serialIndex = 0; foreach (ModelSaleDetail modelDetail in listModel) { serialIndex = serialIndex + 1; modelDetail.Serial = serialIndex; servComm.Add(modelDetail); } if (String.IsNullOrEmpty(Request["Id"])) { servComm.ExecuteSql("exec AutoDetectionNoCard " + identityID + "," + LoginUser.UserName); } else { servComm.ExecuteSql("exec AutoDetectionNoCard " + identityID + "," + identityID); } } catch (Exception ex) { Response.Write(0); Response.End(); } Response.Write(identityID); Response.End(); } else if (Request["actionType"] == "GetMaxCardNo") { DataTable dtCardNo = servComm.ExecuteSqlDatatable("select max(NoEnd) as MaxNo from CardNoMaintenance"); if (dtCardNo.Rows.Count == 0) { Response.Write("00000000"); Response.End(); } else { string maxNo = dtCardNo.Rows[0][0].ToString(); maxNo = (int.Parse(maxNo) + 1).ToString().PadLeft(8, '0'); Response.Write(maxNo); Response.End(); } } else if (Request["actionType"] == "DeleteCardNo") { string NoStart = Request["NoStart"]; string NoEnd = Request["NoEnd"]; if (!String.IsNullOrEmpty(NoStart) && !String.IsNullOrEmpty(NoEnd)) { servComm.ExecuteSql("update CardNoMaintenance set IsSave = 2 where NoEnd ='" + NoEnd + "' and NoStart = '" + NoStart + "'"); } } else if (Request["actiontype"] == "ValidCardNo") { string NoStart = Request["NoStart"]; string NoEnd = Request["NoEnd"]; string Serial = Request["Serial"]; ccWhere.Clear(); string condition = ""; if (Serial != null && Serial == "-1") { Serial = Request["DetailCount"]; } else if (Serial != null && Serial != "-1" && !String.IsNullOrEmpty(Id)) { condition = condition + " and (ID !='" + Id + "' or ID ='" + Id + "' and Serial != " + Serial + ")"; //ccWhere.AddComponent("Id", Id, SearchComponent.Equals, SearchPad.NULL); //ccWhere.AddComponent("Serial", Serial, SearchComponent.UnEquals, SearchPad.And); } else { condition = condition + " and (ID !='" + LoginUser.UserName + "' or ID ='" + LoginUser.UserName + "' and Serial != " + Serial + ")"; } int count = servComm.ExecuteSqlDatatable("select Id from CardNoMaintenance where (NoStart<='" + NoStart + "' and NoEnd>='" + NoStart + "' or NoStart<='" + NoEnd + "' and NoEnd>='" + NoEnd + "' or NoStart>='" + NoStart + "' and NoEnd<='" + NoEnd + "')" + condition).Rows.Count; if (count == 0) { if (String.IsNullOrEmpty(Id)) { servComm.ExecuteSql("delete from CardNoMaintenance where ID ='" + LoginUser.UserName + "' and Serial = " + Serial + "; insert into CardNoMaintenance values('" + LoginUser.UserName + "','" + Serial + "','" + NoStart + "','" + NoEnd + "',GetDate(),0)"); } else { servComm.ExecuteSql("delete from CardNoMaintenance where ID ='" + Id + "' and Serial = " + Serial + ";insert into CardNoMaintenance values('" + Id + "','" + Serial + "','" + NoStart + "','" + NoEnd + "',GetDate(),0)"); } Response.Write(count); Response.End(); } } //if (modelSale.ExecuteSqlDatatable("select ClassID from Dict where ClassID = '" + ClassID + "'").Rows.Count > 0) //{ // servComm.Update(modelDict); //} //else //{ //} }
protected void Page_Load(object sender, EventArgs e) { if (IsCN == false) { FinanceReportViewer.LocalReport.ReportPath = FinanceReportViewer.LocalReport.ReportPath.Replace("En", "").Replace(".rdlc", "En.rdlc"); } if (!IsPostBack) { string Order_ID = Request["Order_ID"]; string serial = Request["serial"]; facservComm = new ServiceCommon(base.factoryConnectionString); ccWhere.Clear(); ccWhere.AddComponent("Order_ID", Order_ID, SearchComponent.Equals, SearchPad.NULL); ccWhere.AddComponent("serial", serial, SearchComponent.Equals, SearchPad.And); //GetFilterByKind(ref ccWhere); //DataTable dtOrder = facservComm.GetListTop(0, "* ", "VWORDERS", ccWhere); DataTable dtOrder = facservComm.ExecuteSqlDatatable(VWORDERS + " where " + ccWhere.sbComponent); // DataTable dtOrderDetail = facservComm.GetListTop(0, "* ", "VWOrdersDetail", ccWhere); DataTable dtOrderDetail = facservComm.ExecuteSqlDatatable(VWOrdersDetail + " where " + ccWhere.sbComponent); DataTable dtOrderOther = facservComm.GetListTop(0, "* ", "ordersOther", ccWhere); int count = dtOrderOther.Rows.Count; DataTable dtConstruction = new ReportDataSet.OrderOthersDataTable(); for (int i = 1; i <= count / 3; i++) { dtConstruction.Rows.Add(dtConstruction.NewRow()); dtConstruction.Rows[i - 1]["name1"] = dtOrderOther.Rows[(i - 1) * 3]["name"]; dtConstruction.Rows[i - 1]["qty1"] = dtOrderOther.Rows[(i - 1) * 3]["qty"]; dtConstruction.Rows[i - 1]["name2"] = dtOrderOther.Rows[i * 3 - 1]["name"]; dtConstruction.Rows[i - 1]["qty2"] = dtOrderOther.Rows[i * 3 - 1]["qty"]; dtConstruction.Rows[i - 1]["name3"] = dtOrderOther.Rows[i * 3 - 2]["name"]; dtConstruction.Rows[i - 1]["qty3"] = dtOrderOther.Rows[i * 3 - 2]["qty"]; } if (count % 3 == 2) { dtConstruction.Rows.Add(dtConstruction.NewRow()); dtConstruction.Rows[count / 3]["name1"] = dtOrderOther.Rows[count - 2]["name"]; dtConstruction.Rows[count / 3]["qty1"] = dtOrderOther.Rows[count - 2]["qty"]; dtConstruction.Rows[count / 3]["name2"] = dtOrderOther.Rows[count - 1]["name"]; dtConstruction.Rows[count / 3]["qty2"] = dtOrderOther.Rows[count - 1]["qty"]; dtConstruction.Rows[count / 3]["name3"] = ""; dtConstruction.Rows[count / 3]["qty3"] = ""; } if (count % 3 == 1) { dtConstruction.Rows.Add(dtConstruction.NewRow()); dtConstruction.Rows[count / 3]["name1"] = dtOrderOther.Rows[count - 1]["name"]; dtConstruction.Rows[count / 3]["qty1"] = dtOrderOther.Rows[count - 1]["qty"]; dtConstruction.Rows[count / 3]["name2"] = ""; dtConstruction.Rows[count / 3]["qty2"] = ""; dtConstruction.Rows[count / 3]["name3"] = ""; dtConstruction.Rows[count / 3]["qty3"] = ""; } //this.FinanceReportViewer.LocalReport.SetParameters(new ReportParameter("paraIndate", "2015年01月01日")); //this.FinanceReportViewer.LocalReport.SetParameters(new ReportParameter("paraOutDate", DateTime.Now.Year.ToString() + "年" + DateTime.Now.Month.ToString() + "月" + DateTime.Now.Day + "日")); this.FinanceReportViewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dtOrder)); this.FinanceReportViewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet2", dtOrderDetail)); this.FinanceReportViewer.LocalReport.DataSources.Add(new ReportDataSource("DataSet3", dtConstruction)); } }