void but_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(Request.QueryString["doc"]) == false) { String docFile = Server.MapPath(Request.QueryString["doc"]); PubFun.SaveTxtFileInfo(docFile, this.txt1.Text, Encoding.UTF8); JAjax.Alert("提示:保存操作成功!"); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack && String.IsNullOrEmpty(Request.QueryString["doc"]) == false) { String docFile = Server.MapPath(Request.QueryString["doc"]); this.txt1.Text = PubFun.GetTxtFileInfo(docFile, Encoding.GetEncoding("gb2312")); } }
private void worker_DoWork(object sender, DoWorkEventArgs e) { try { HttpHelper helper = new HttpHelper(); string url = ConfigFile.ReadConfig("Car", "UnLockTicket"); _carEntity._UnLockTicketRequest = new UnLockTicketRequest(); _carEntity._UnLockTicketRequest.TicketIds = _carEntity.TicketId; string postData = PubFun.GetJsonString(_carEntity._UnLockTicketRequest); Log.Info("PostData:" + postData); postData = PubFun.Encrypt(postData); url += "&data=" + postData.Replace("+", "%2b"); HttpItem item = GetHttpItem(url, "", "utf-8"); HttpResult result = helper.GetHtml(item); AppLog.Write("httpResult2:" + result.Html, AppLog.LogMessageType.Info); if (result.StatusCode == HttpStatusCode.OK) { string json = PubFun.Decrypt(result.Html); //, ConfigFile.ReadConfig("AppData", "DesKey")); AppLog.Write("json:" + json, AppLog.LogMessageType.Info); _carEntity._UnLockTicketResponse = PubFun.GetJsonObject <UnLockTicketResponse>(json); if (_carEntity._UnLockTicketResponse != null) { if (string.IsNullOrEmpty(_carEntity._UnLockTicketResponse.ErrorCode)) { e.Cancel = false; } else { e.Cancel = false; ShowMessageAndGoBack(_carEntity._UnLockTicketResponse.ErrorCode + ":" + _carEntity._UnLockTicketResponse.Msg); e.Result = new object(); return; } } else { e.Cancel = true; } } else { e.Cancel = true; } } catch (Exception ex) { AppLog.Write("UnLockTicketProcessDeal http Err:" + ex.Message, AppLog.LogMessageType.Error); e.Cancel = true; } }
/// <summary> /// 没取到值返回true /// </summary> /// <returns></returns> private bool ProcessEndCity() { try { // Thread.Sleep(6000); HttpHelper helper = new HttpHelper(); string url = ConfigFile.ReadConfig("Car", "ToCity"); QueryTerminusByCityRequest request = new QueryTerminusByCityRequest(); request.CityName = _carEntity.SelectStartCity.CityName; request.CityId = _carEntity.SelectStartCity.CityId; request.StopName = ""; string postData = PubFun.GetJsonString(request); Log.Info("PostData:" + postData); postData = PubFun.Encrypt(postData); url += "&data=" + postData.Replace("+", "%2b"); HttpItem item = GetHttpItem(url, "", "utf-8"); HttpResult result = helper.GetHtml(item); Log.Info("httpResult2:" + result.Html); if (result.StatusCode == HttpStatusCode.OK) { string json = PubFun.Decrypt(result.Html); Log.Info("json:" + json); _carEntity._QueryTerminusByCityResponse = PubFun.GetJsonObject <QueryTerminusByCityResponse>(json); if (_carEntity._QueryTerminusByCityResponse != null) { if (string.IsNullOrEmpty(_carEntity._QueryTerminusByCityResponse.ErrorCode)) { return(false); } else { ShowMessageAndGoBack(_carEntity._QueryTerminusByCityResponse.ErrorCode + ":" + _carEntity._QueryTerminusByCityResponse.Msg); return(true); } } else { return(true); } } else { return(true); } } catch (Exception ex) { AppLog.Write("[ProcessEndCity Err]" + ex.Message, AppLog.LogMessageType.Error); return(true); } }
void worker_DoWork(object sender, DoWorkEventArgs e) { HttpHelper helper = new HttpHelper(); string url = ConfigFile.ReadConfig("Car", "FromCity"); HttpItem item = GetHttpItem(url, "", "utf-8"); HttpResult result = helper.GetHtml(item); // AppLog.Write("httpResult2:" + result.Html, AppLog.LogMessageType.Info); if (result.StatusCode == HttpStatusCode.OK) { string json = PubFun.Decrypt(result.Html);//, ConfigFile.ReadConfig("AppData", "DesKey")); AppLog.Write("json:" + json, AppLog.LogMessageType.Info); _carEntity._querySetOutResponse = PubFun.GetJsonObject <QuerySetOutResponse>(json); if (_carEntity._querySetOutResponse != null) { if (string.IsNullOrEmpty(_carEntity._querySetOutResponse.ErrorCode)) { e.Cancel = false; } else { ShowMessageAndGoBack(_carEntity._querySetOutResponse.ErrorCode + ":" + _carEntity._querySetOutResponse.Msg); e.Cancel = false; e.Result = new object(); } } else { e.Cancel = true; } } else { e.Cancel = true; } }
private void butFind_Click(object sender, EventArgs e) { //查询单据 string sSql = ""; string strAreaid = gdFindWhere.Cell(8, 1).Text.ToString(); //区域 sSql = " select a.*,d.custname ,d.telname ,d.tel,d.ddtel,d.address,d.city,d.cityid,d.khwxh "; sSql += " from Inv_Evi a inner join dbo.f_CAreaid('" + strAreaid + "') c on a.areaid =c.AreaID "; sSql += " inner join customer d on a.custid=d.custid "; sSql += " where 1=1 "; if (gdFindWhere.Cell(1, 1).Text.ToString() == "单据日期") { sSql += " and a.evidate>='" + gdFindWhere.Cell(2, 1).Text.ToString() + "' and a.evidate <='" + gdFindWhere.Cell(3, 1).Text.ToString() + "'"; } else if (gdFindWhere.Cell(1, 1).Text.ToString() == "审核日期") { sSql += " and a.Verifierdate>='" + gdFindWhere.Cell(2, 1).Text.ToString() + "' and a.Verifierdate <='" + gdFindWhere.Cell(3, 1).Text.ToString() + "'"; } //条件,快递 if (gdFindWhere.Cell(4, 1).Text.ToString() == "1") { sSql += " and ISNULL(a.ISKD,0)='1'"; } else { sSql += " and ISNULL(a.ISKD,0)='0'"; } SqlDataReader rd = DbHelperSQL.ExecuteReader(sSql); int intR = 1; try { while (rd.Read()) { intR += 1; gdFindList.Rows = intR; gdFindList.Cell(intR - 1, 1).Text = ""; //选择 gdFindList.Cell(intR - 1, 2).Text = rd["EviNo"].ToString(); //单据编号 gdFindList.Cell(intR - 1, 3).Text = PubFun.Nz(rd["isPCFH"].ToString(), ""); //是否排产 gdFindList.Cell(intR - 1, 4).Text = rd["isKD"].ToString(); //是否快递 gdFindList.Cell(intR - 1, 5).Text = rd["KDDH"].ToString(); //快递单号 gdFindList.Cell(intR - 1, 6).Text = rd["driver"].ToString(); //司机 gdFindList.Cell(intR - 1, 7).Text = rd["khwxh"].ToString(); //客户微信号 gdFindList.Cell(intR - 1, 8).Text = rd["CustName"].ToString(); //客户名称 gdFindList.Cell(intR - 1, 8).WrapText = true; //换行 gdFindList.Cell(intR - 1, 8).Tag = rd["Custid"].ToString(); //客户编号 gdFindList.Cell(intR - 1, 9).Text = rd["SumWeight"].ToString(); //重量 gdFindList.Cell(intR - 1, 10).Text = rd["SumnQty"].ToString(); //件数 gdFindList.Cell(intR - 1, 11).Text = rd["telname"].ToString(); //联系人 gdFindList.Cell(intR - 1, 12).Text = rd["Tel"].ToString(); //手机 gdFindList.Cell(intR - 1, 13).Text = rd["DDTel"].ToString(); //固话 if (rd["cityID"].ToString().Substring(1, 2) == "44") { gdFindList.Cell(intR - 1, 14).Text = "广东省" + rd["Address"].ToString(); //广东地址要加上"广东省" } else { gdFindList.Cell(intR - 1, 14).Text = rd["Address"].ToString(); } gdFindList.Cell(intR - 1, 14).WrapText = true;//换行 } } catch { } }
private void toolSave_Click(object sender, EventArgs e) { //保存 var au = new Person { ID = textBox1.Text.ToInt(), // = au.ID.ToString(); Pname = txtPname.Text.ToString(), // = au.Pname.ToString(), Sex = comSex.Text.ToString(), // = au.Sex.ToString(), Job = comJob.Text.ToString(), // = au.Job.ToString(); Paper = comPaper.Text.ToString(), // = au.Paper.ToString(); PaperNum = txtPaperNum.Text.ToString(), // = au.PaperNum.ToString(); DeptID = PubFun.GetSplit(comDeptID.Text.ToString(), 0), // = au.DeptID.ToString(); //textDeptName.Text = ""; //部门名称 InDate = dtIndate.Value, // = au.InDate;//入职日期 //if (checkIsStatus.Checked) //{ // //checkIsStatus.Checked = true; // au.Statu= "1", //} //else //{ // au.Statu = "1", //checkIsStatus.Checked = false; // dtOutdate.Value = au.OutDate;//离职日期 //} Psbz = Convert.ToDecimal(txtPsbz.Text.ToString()), // = au.Psbz.ToString(); Psdzbz = Convert.ToDecimal(txtPsdzbz.Text.ToString()), // = au.Psdzbz.ToString(); Zzjs = txtZzjs.Text.ToInt(), // = au.Zzjs.ToString(); Zzbl = Convert.ToDecimal(txtZzbl.Text.ToString()), // = au.Zzbl.ToString(); Qsrq = dtQsrq.Value, // = au.Qsrq; Zwpdbh = PubFun.GetSplit(comZwpdbh.Text.ToString(), 0), Pdpxbh = txtPdpxbh.Text.ToString(), Driverfz = txtDriverfz.Text.ToString(), }; if (checkIsStatus.Checked) { //checkIsStatus.Checked = true; au.Status = "1"; } else { au.Status = "0"; //checkIsStatus.Checked = false; au.OutDate = dtOutdate.Value; //离职日期 } au.Save(); toolSetTrue(true); groupBox2.Text = ""; groupBox2.Tag = ""; IsSaved = false; }
private void butFind_Click(object sender, EventArgs e) { string sSql = " "; string sItem = " "; // AreaID,AreaName,PrevID sSql = "select h.* "; sSql += ",o.orderStatus,u.isWXFocus,o.CustWXnum "; sSql = sSql + " ,case o.orderStatus "; sSql = sSql + " when -10 then '已取消'"; sSql = sSql + " when 10 then '已完成'"; sSql = sSql + " when 11 then '未付款待发货'"; sSql = sSql + " when 12 then '未付款已受理'"; sSql = sSql + " when 13 then '未付款正在备货'"; sSql = sSql + " when 14 then '未付款已发货'"; sSql = sSql + " when 15 then '未付款已签收'"; sSql = sSql + " when 21 then '已付款待发货'"; sSql = sSql + " when 22 then '已付款已受理'"; sSql = sSql + " when 23 then '已付款正在备货'"; sSql = sSql + " when 24 then '已付款已发货'"; sSql = sSql + " Else ''"; sSql = sSql + " end orderStatusName"; sSql += " from inv_evi h "; sSql += " left join DefWeixin.dbo.WxOrder o on h.evino = o.orderno "; sSql += " left join DefWeixin.dbo.WxUserCust u on o.CustWXnum = u.openid "; if (gdFindWhere.Cell(1, 1).Text == "单据日期") { sSql += " where h.evidate between '" + gdFindWhere.Cell(2, 1).Text + "' and '" + gdFindWhere.Cell(3, 1).Text + "' "; } else //审核日期 { sSql += " where h.Verifierdate between '" + gdFindWhere.Cell(2, 1).Text + "' and '" + gdFindWhere.Cell(3, 1).Text + "' "; } if (gdFindWhere.Cell(4, 1).Text == "已审核") //单据状态 { sSql += " and h.Verified='1' "; } else if (gdFindWhere.Cell(4, 1).Text == "未审核") //单据状态 { sSql += " and h.Verified<>'1' "; } //客户编号 if (gdFindWhere.Cell(7, 1).Text != "") { sSql += " and (h.custid like '%" + gdFindWhere.Cell(7, 1).Text + "%' or h.custname like '%" + gdFindWhere.Cell(7, 1).Text + "%' ) "; } //确认快递 if (gdFindWhere.Cell(9, 1).Text == "1") { sSql += " and h.iskd=1 "; } DataSet ds = DbHelperSQL.Query(sSql); //SqlDataReader dr //SqlDataReader dr = DbHelperSQL.ExecuteReader(sSql); gdFindList.Rows = 1; gdFindList.AutoRedraw = false; if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { sItem = ""; try { sItem += "\t" + ds.Tables[0].Rows[i]["evino"].ToString().Trim(); //dr["evino"].ToString(); //是否排产 PCBZ sItem += "\t " + ds.Tables[0].Rows[i]["PCBZ"].ToString(); sItem += "\t" + ds.Tables[0].Rows[i]["iskd"].ToString(); // dr["iskd"].ToString(); //是否快递 sItem += "\t" + ds.Tables[0].Rows[i]["Verified"].ToString(); //dr["Verified"].ToString(); //是否 审批 sItem += "\t" + ds.Tables[0].Rows[i]["payed"].ToString(); //dr["payed"].ToString(); //是否 付款 sItem += "\t" + ds.Tables[0].Rows[i]["evidate"].ToString().Substring(0, 10); // dr["evidate"].ToString().Substring(0, 10); // 单据日期 sItem += "\t" + ds.Tables[0].Rows[i]["driver"].ToString(); // dr["driver"].ToString(); //司机 // var wxno = dr["Wxorderno"].ToString(); //sItem += "\t" + ds.Tables[0].Rows[i]["Wxorderno"] == null ? "" : ds.Tables[0].Rows[i]["Wxorderno"].ToString(); //, PubFun.Nz(dr["Wxorderno"].ToString(), ""); sItem += "\t" + PubFun.Nz(ds.Tables[0].Rows[i]["Wxorderno"], ""); //微信订单号 //微信订单状态 sItem += "\t" + PubFun.Nz(ds.Tables[0].Rows[i]["orderStatus"], "") + "|" + PubFun.Nz(ds.Tables[0].Rows[i]["orderStatusName"], ""); //微信号 CustWXnum sItem += "\t" + PubFun.Nz(ds.Tables[0].Rows[i]["CustWXnum"], ""); //是否取消关注 isWXFocus -1 已取消 if (ds.Tables[0].Rows[i]["isWXFocus"].ToString() == "-1") { sItem += "\t已取消"; } else { sItem += "\t"; } //客户 sItem += "\t" + PubFun.Nz(ds.Tables[0].Rows[i]["custid"], "") + "|" + PubFun.Nz(ds.Tables[0].Rows[i]["custname"], ""); //单据 重量 sItem += "\t" + PubFun.Nz(ds.Tables[0].Rows[i]["SumWeight"], ""); //单据 罐数 sItem += "\t" + PubFun.Nz(ds.Tables[0].Rows[i]["SumQty"], ""); //单据 件数 sItem += "\t" + PubFun.Nz(ds.Tables[0].Rows[i]["SumNQty"], ""); //单据 金额 sItem += "\t" + PubFun.Nz(ds.Tables[0].Rows[i]["SumAmount"], ""); //单据 联系人 sItem += "\t"; //单据 手机 sItem += "\t" + PubFun.Nz(ds.Tables[0].Rows[i]["tel"], ""); //单据 固话 sItem += "\t"; //单据 地址 sItem += "\t" + PubFun.Nz(ds.Tables[0].Rows[i]["caddress"], ""); } catch (Exception ex) { MessageBox.Show("提示!:" + ex); break; } gdFindList.AddItem(sItem); //标识已取消关注为红色 gdFindList.Cell(gdFindList.Rows - 1, 12).ForeColor = Color.Red; //客户换行 gdFindList.Cell(gdFindList.Rows - 1, 13).WrapText = true; //客户手机 gdFindList.Cell(gdFindList.Rows - 1, 19).WrapText = true; //客户地址 gdFindList.Cell(gdFindList.Rows - 1, 21).WrapText = true; } } gdFindList.AutoRedraw = true; gdFindList.Refresh(); //while (dr.Read()) //{ // sItem = ""; // // string getID = dr["lsbh"].ToString(); // try // { // //ds.Tables[0].Rows[i].ItemArray[0].ToString().Trim(); // sItem += "\t" + dr["evino"].ToString(); // sItem += "\t " ; //是否排产 // sItem += "\t" + dr["iskd"].ToString() ; //是否快递 // sItem += "\t" + dr["Verified"].ToString(); //是否 审批 // sItem += "\t" + dr["payed"].ToString(); //是否 付款 // sItem += "\t" + dr["evidate"].ToString().Substring(0,10) ; // 单据日期 // sItem += "\t" + dr["driver"].ToString(); //司机 // var wxno = dr["Wxorderno"].ToString(); // sItem += "\t" + PubFun.Nz(dr["Wxorderno"].ToString(),""); // //if(dr["Wxorderno"].ToString().IsNullOrEmpty()) // //{ // // sItem += "\t"; // //} // //else // //{ // // sItem += "\t" + dr["Wxorderno"].ToString(); // //} // //if(dr["Wxorderno"].ToString()==null) //微信订单号 // //{ // // sItem += "\t" ; // //} // //else // //{ // // sItem += "\t" + dr["Wxorderno"].ToString(); // //} // gdFindList.AddItem(sItem); // } // catch (Exception ex) // { // MessageBox.Show("提示!:" + ex); // break; // } //} }
/// <summary> /// 保存 /// </summary> private int proSave() { int rows = -1; txt_PATHWAY_NAME.Tag = bIsPathWay ? "2;路径名称;1;0,100;" : "2;单病种名称;1;0,100;"; txt_PATHWAY_VERSION.Tag = "2;版本号;1;0,50;"; //ce_MIN_HOSPITAL_DAYS.Tag = "1;住院天数下线;1;0,5000;0;"; //ce_MAX_HOSPITAL_DAYS.Tag = "1;住院天数上线;1;0,5000;0;"; //ce_MIN_COST.Tag = "1;路径费用下线;1;0,90000000;2;"; //ce_MAX_COST.Tag = "1;路径费用上线;1;0,90000000;2;"; if (this.BindingContext[dt].Count > 0) { string strErr = PubFun.getCheckDataStr(paneMain); if (ce_MAX_HOSPITAL_DAYS.Value < ce_MIN_HOSPITAL_DAYS.Value) { strErr += CON_CRLF + "住院天数 上线:" + ce_MAX_HOSPITAL_DAYS.Value.ToString() + " 小于下线" + ce_MIN_HOSPITAL_DAYS.Value.ToString(); } if (ce_MAX_COST.Value < ce_MIN_COST.Value) { strErr += CON_CRLF + "住院天数 上线:" + ce_MAX_COST.Value.ToString() + " 小于下线" + ce_MIN_COST.Value.ToString(); } if (strErr.Trim() != "") { MsgBox.MsgShow(strErr); return(rows); } //System.Collections.ArrayList alSql = new System.Collections.ArrayList(); if (info_DLG.dlgKind != DbOpt.OpenWindowKind.Open) { lbl_id.EditValue = Guid.NewGuid(); lbl_CREATE_DATE.DateTime = DbOpt.GetSysDate(); lbl_EMP_ID_CREATE.Text = InstanceBaseForm.BCurrentUser.EmployeeId.ToString(); // //if (dt.Rows.Count == 0) //{ // DataRow r = dt.NewRow(); // //如果是打开 // r["pym"] = PubStaticFun.GetPYWBM(txt_PATHWAY_NAME.Text.Trim(), 1); // r["wbm"] = PubStaticFun.GetPYWBM(txt_PATHWAY_NAME.Text.Trim(), 1); // r["VERSION"] = txt_PATHWAY_VERSION.Text; // r["DEPTID"] = int.Parse(lookEditCmb2.TextValue.ToString()); // r["MIN_DAYS"] = ce_MIN_HOSPITAL_DAYS.EditValue; // r["MAX_DAYS"] = ce_MAX_HOSPITAL_DAYS.EditValue; // r["MIN_AMOUNT"] = ce_MIN_COST.EditValue; // r["MAX_AMOUNT"] = ce_MAX_COST.EditValue; // r["PATHWAY_ID"] = lbl_id.EditValue; // dt.Rows.Add(r); //} } else { lbl_UPDATE_DATE.DateTime = DbOpt.GetSysDate(); lbl_EMP_ID_UPDATE.Text = InstanceBaseForm.BCurrentUser.EmployeeId.ToString(); //txt_PATHWAY_VERSION.DataBindings.Add(new System.Windows.Forms.Binding("EditValue", dt, "VERSION", true)); //lookEditCmb2.DataBindings.Add(new System.Windows.Forms.Binding("TextValue", dt, "DEPTID", true)); //ce_MIN_HOSPITAL_DAYS.DataBindings.Add(new System.Windows.Forms.Binding("EditValue", dt, "MIN_DAYS", true)); //ce_MAX_HOSPITAL_DAYS.DataBindings.Add(new System.Windows.Forms.Binding("EditValue", dt, "MAX_DAYS", true)); //ce_MIN_COST.DataBindings.Add(new System.Windows.Forms.Binding("EditValue", dt, "MIN_AMOUNT", true)); //ce_MAX_COST.DataBindings.Add(new System.Windows.Forms.Binding("EditValue", dt, "MAX_AMOUNT", true)); } //for (int i = 0; i < gridView1.RowCount; i++) //{ // dt_sybz.Rows[i]["PATHWAY_ID"] = lbl_id.EditValue; //} // update code pengy 2015.6.5 for (int i = 0; i < dt_sybz.Rows.Count; i++) { DataRowState state = dt_sybz.Rows[i].RowState; if (state != DataRowState.Deleted) { dt_sybz.Rows[i]["PATHWAY_ID"] = lbl_id.EditValue; } } ArrayList cmdList = new ArrayList(); txt_PATHWAY_NAME.Text = txt_PATHWAY_NAME.Text.Trim(); this.lbl_WBM.Text = PubStaticFun.GetPYWBM(txt_PATHWAY_NAME.Text.Trim(), 1); this.lbl_PYM.Text = PubStaticFun.GetPYWBM(txt_PATHWAY_NAME.Text.Trim(), 0); this.BindingContext[dt].EndCurrentEdit(); dt.Rows[0]["MONOCONDITION"] = bIsPathWay ? "0" : "1";//单病种 为 1 ,默认 为0 dt.Rows[0]["PATHWAY_ID"] = lbl_id.EditValue; //dt.Rows[0]["DEPTID"] = lookEditCmb2.TextValue; this.BindingContext[dt_sybz].EndCurrentEdit(); if (cmdList != null && cmdList.Count > 0) { rows = DbOpt.Update(new DataTable[] { dt, dt_sybz }, new string[] { sSql, sSql_sybz }, null, cmdList); } else { rows = DbOpt.Update(new DataTable[] { dt, dt_sybz }, new string[] { sSql, sSql_sybz }, null, null); } if (rows > -1) { dt.AcceptChanges(); info_DLG.pKey1 = lbl_id.Text; info_DLG.name = txt_PATHWAY_NAME.Text + "_" + txt_PATHWAY_VERSION.Text; info_DLG.dlgCs10 = "";//复制失效 //this.Text = "路径-" + info_DLG.name + " 信息"; dt_sybz.AcceptChanges(); gridControl1.Tag = dt_sybz.Copy(); this.setEnabledInAddOrOther(EventKind.barSave); this.setParentFormtxx(info_DLG); this.setEnable(EventKind.barSave); } } return(rows); }