/// <summary> /// 输入的IC卡小票给sql附值 /// </summary> private void strsql() { string iccard_id = txtSerialnumber.Text.Trim(); if (iccard_id.Length == 10) { iccard_id = Convert.ToInt64(iccard_id).ToString("X"); } if (iccard_id.Length > 12) { iccard_id = iccard_id.Substring(0, 12); } if (iccard_id == "" || iccard_id == null) { return; } DataTable dt = LinQBaseDao.Query("select ICCard_ID from dbo.ICCard WHERE ICCard_Value='" + iccard_id + "'").Tables[0]; //刷IC卡 if (dt.Rows.Count > 0) { sql = "select top(1) * from View_CarState where SmallTicket_ICCard_ID='" + Convert.ToInt32(dt.Rows[0][0].ToString()) + "' order by SmallTicket_ID desc"; } //刷小票 else { sql = "select * from View_CarState where SmallTicket_Serialnumber='" + iccard_id + "' order by SmallTicket_ID desc"; } }
private async Task GetWeightData() { await Task.Factory.StartNew(() => { if (this.InvokeRequired) { this.Invoke(new AsynUpdateUI(delegate() { DataTable dt = LinQBaseDao.Query(" select * from View_QCInfo where QCInfo_ID=" + qcinfoid).Tables[0]; if (dt.Rows.Count > 0) { lblQCRecord_ID.Text = dt.Rows[0]["QCInfo_ID"].ToString(); lblCNTR_NO.Text = dt.Rows[0]["CNTR_NO"].ToString(); lblDictionary_Name.Text = dt.Rows[0]["Dictionary_Name"].ToString(); lblQCInfo_BAGWeight.Text = dt.Rows[0]["QCInfo_BAGWeight"].ToString(); lblQCInfo_MATERIAL_SCALE.Text = dt.Rows[0]["QCInfo_MATERIAL_SCALE"].ToString(); lblQCInfo_MATERIAL_WEIGHT.Text = dt.Rows[0]["QCInfo_MATERIAL_WEIGHT"].ToString(); lblQCInfo_PAPER_SCALE.Text = dt.Rows[0]["QCInfo_PAPER_SCALE"].ToString(); lblQCInfo_PAPER_WEIGHT.Text = dt.Rows[0]["QCInfo_PAPER_WEIGHT"].ToString(); lblQCInfo_PumpingPackets.Text = dt.Rows[0]["QCInfo_PumpingPackets"].ToString(); lbQCInfo_RECV_RMA_METHOD.Text = dt.Rows[0]["QCInfo_RECV_RMA_METHOD"].ToString(); lbwate.Text = dt.Rows[0]["QCInfo_MOIST_PER_SAMPLE"].ToString(); lblUserName.Text = dt.Rows[0]["UserName"].ToString(); lblWEIGHT_TICKET_NO.Text = dt.Rows[0]["WEIGHT_TICKET_NO"].ToString(); } })); } }); }
/// <summary> /// 特权卡 /// </summary> public static void DownloadIC() { try { string strsql = "select ICCard_Value from ICCard where ICCard_ICCardType_ID in (select ICCardType_ID from ICCardType where ICCardType_Value in ('1010','1011')) and ICCard_State='启动'"; DataTable dt = LinQBaseDao.Query(strsql).Tables[0]; string dvalue = ""; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { dvalue += dt.Rows[i][0].ToString() + ","; } ICCARD = dvalue.TrimEnd(','); XmlDocument doc = new XmlDocument(); string s = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "ControlSet.xml"; doc.Load(s); XmlNode root = doc.DocumentElement; foreach (XmlNode item in root.ChildNodes) { if (item.Name == "ICCARD") { item.InnerText = ICCARD.ToString(); } } doc.Save(s); } } catch (Exception) { } }
private void btnSearch_Click(object sender, EventArgs e) { //查询出车辆类型的详细策略 treeView1.Nodes.Clear(); try { DataTable table1 = LinQBaseDao.Query("select DrivewayStrategy_Sort,DrivewayStrategy_ID,DrivewayStrategy_Driveway_ID from DrivewayStrategy where DrivewayStrategy_Name='" + stawayType.Text.Trim() + "' and DrivewayStrategy_State='启动' order by DrivewayStrategy_Sort ").Tables[0]; TreeNode tr1; for (int i = 0; i < table1.Rows.Count; i++) { tr1 = new TreeNode(); tr1.Tag = table1.Rows[i]["DrivewayStrategy_ID"].ToString(); string str = table1.Rows[i]["DrivewayStrategy_Sort"].ToString(); DataTable dt = LinQBaseDao.Query("select Driveway_Name,Position_Name,Driveway_Type from View_DrivewayPosition where Driveway_ID= " + table1.Rows[i]["DrivewayStrategy_Driveway_ID"].ToString()).Tables[0]; if (dt.Rows.Count > 0) { str += " " + dt.Rows[0]["Position_Name"].ToString() + " " + dt.Rows[0]["driveway_name"].ToString() + " " + dt.Rows[0]["driveway_type"].ToString(); } tr1.Text = str; treeView1.Nodes.Add(tr1); } } catch { } }
private void btnRecognition_Click(object sender, EventArgs e) { strSerialnumber = txtSmallSer.Text.Trim(); if (!string.IsNullOrEmpty(strSerialnumber)) { DataTable dt = LinQBaseDao.Query("select * from eh_SAPRecord where Sap_Serialnumber='" + strSerialnumber + "' ").Tables[0]; if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { if (dt.Rows[i]["Sap_Type"].ToString() == "送货车辆") { txtOldNum.Text = dt.Rows[i]["Sap_InNO"].ToString(); txtBiaozhi.Text = dt.Rows[i]["Sap_Identify"].ToString(); txtCarName.Text = dt.Rows[i]["Sap_InCarNumber"].ToString(); txtInOut.Text = dt.Rows[i]["Sap_InCRFLG"].ToString(); txtMiao.Text = dt.Rows[i]["Sap_OutMAKTX"].ToString(); txtGYS.Text = dt.Rows[i]["Sap_OutNAME1C"].ToString(); txtCust.Text = dt.Rows[i]["Sap_OutNAME1P"].ToString(); txtSamll.Text = dt.Rows[i]["Sap_Serialnumber"].ToString(); txtCarType.Text = dt.Rows[i]["Sap_Type"].ToString(); sap_id = dt.Rows[i]["Sap_ID"].ToString(); } } } else { MessageBox.Show(this, "请输入需要修改的送货车辆的小票号!"); } } }
/// <summary> /// 绑定备用通道 /// </summary> private void BindRemarkDriveway() { try { string sql = "Select (Position_Name+Driveway_Name) as DrivewayPosition,Driveway_ID from dbo.View_DrivewayPosition where Driveway_State='启动' and Position_State='启动'"; DataTable dt = LinQBaseDao.Query(sql).Tables[0]; DataRow row = dt.NewRow(); row["DrivewayPosition"] = "请选择"; dt.Rows.InsertAt(row, 0); if (dt.Rows.Count > 0) { this.cobReserve.DataSource = dt; this.cobReserve.DisplayMember = "DrivewayPosition"; this.cobReserve.ValueMember = "Driveway_ID"; cobReserve.SelectedIndex = 0; } else { return; } } catch { CommonalityEntity.WriteTextLog("DrivewayFrom .BindRemarkDriveway()"); } }
/// <summary> /// 搜索的方法 /// </summary> private void GetDictionarySeach() { try { sqlwhere = " 1=1"; string name = this.cbxName.Text.Trim(); string value = this.txtDictionaryValue.Text.Trim(); string dicID = this.cbxDicname.SelectedValue.ToString(); if (!string.IsNullOrEmpty(name))//字典名称 { sqlwhere += String.Format(" and Dictionary_Name like '%{0}%'", name); } if (!string.IsNullOrEmpty(value))//字典名称 { sqlwhere += String.Format(" and Dictionary_Value like '%{0}%'", value); } if (!string.IsNullOrEmpty(dicID))//字典名称 { string strvalue = LinQBaseDao.GetSingle("select Dictionary_ID from Dictionary where Dictionary_ID=" + dicID).ToString(); sqlwhere += String.Format(" and Dictionary_ID=" + dicID + " or Dictionary_OtherID = {0}", strvalue); } } catch { CommonalityEntity.WriteTextLog("DictionaryForm.GetDictionarySeach异常:"); } finally { LogInfoLoad(""); } }
/// <summary> /// 初始化 /// </summary> private void Initialization() { try { sqlwhere = ""; DataTable dt = LinQBaseDao.Query("select Position_name,Position_ID from Position where Position_state='启动'").Tables[0]; DataRow dr = dt.NewRow(); dr["Position_ID"] = "0"; dr["Position_name"] = "全部"; dt.Rows.InsertAt(dr, 0); cmbPositionID.DataSource = dt; cmbPositionID.DisplayMember = "Position_name"; cmbPositionID.ValueMember = "Position_ID"; pc = new PageControl(); if (!CommonalityEntity.boolCopyDrivewayStrategy) { if (carname == "") { return; } } panel2.Visible = false; } catch { CommonalityEntity.WriteTextLog("DrivewayStrategyRecordForm.Initialization()" + "".ToString()); } }
/// <summary> /// 根据车辆类型查询通道编号 /// </summary> /// <returns></returns> private void SetDrivewayStrategy_Driveway_IDMethod(List <int> ListintCarTypeID) { try { listDrivewayPosition = new List <View_DrivewayPosition>(); listDrivewayPositionaOld = new List <View_DrivewayPosition>(); string strsql = String.Format("select DrivewayStrategyRecord_Driveway_ID,DrivewayStrategyRecord_CarType_ID from DrivewayStrategyRecord"); var p = LinQBaseDao.Query(strsql).Tables[0]; if (p.Rows.Count > 0) { var pDrivewayStrategy_Driveway_ID = p.AsEnumerable().Where(n => ListintCarTypeID.Contains(n.Field <int>("DrivewayStrategyRecord_CarType_ID"))).Select(n => n.Field <int>("DrivewayStrategy_Driveway_ID")); if (pDrivewayStrategy_Driveway_ID.Count() > 0) { foreach (var tem in pDrivewayStrategy_Driveway_ID.Distinct()) { if (tem > 0) { View_DrivewayPosition vdp = new View_DrivewayPosition(); vdp.Driveway_ID = tem; listDrivewayPosition.Add(vdp); } } } } listDrivewayPositionaOld = listDrivewayPosition; } catch { CommonalityEntity.WriteTextLog("DrivewayStrategyRecordForm.dgv_Information_DoubleClick()" + "".ToString()); } }
protected void treeViewPositionlist(TreeNodeCollection node, string MtID) { ///获取当前拥有的权限 DataTable table; if (CommonalityEntity.USERNAME.ToLower() == "emewe") { table = LinQBaseDao.Query("select * from MenuInfo where Menu_OtherID=" + MtID + "and Menu_Type=1").Tables[0]; } else { table = LinQBaseDao.Query("select distinct(Permissions_Menu_ID),Menu_ID,Menu_ControlText,menu_Order from View_MenuInfo_P where Menu_Type=1 and (Permissions_UserId=" + CommonalityEntity.USERID + " or Permissions_Role_Id=" + CommonalityEntity.USERRoleID + ") and Menu_FromName !='PCountSetForm' and Menu_OtherID=" + MtID).Tables[0]; } TreeNode nodeTemp; for (int i = 0; i < table.Rows.Count; i++) { nodeTemp = new TreeNode(); nodeTemp.Tag = table.Rows[i]["Menu_ID"]; if (table.Rows[i]["Menu_ControlText"] != null) { nodeTemp.Text = table.Rows[i]["Menu_ControlText"].ToString(); } if (nodeTemp != null) { node.Add(nodeTemp); //加入节点 } this.treeViewPositionlist(nodeTemp.Nodes, nodeTemp.Tag.ToString().Split(',')[0]); } }
private void tv_StaffInfo_DoubleClick(object sender, EventArgs e) { if (tv_StaffInfo.Nodes.Count > 0) { if (tv_StaffInfo.SelectedNode != null) { S_ID = tv_StaffInfo.SelectedNode.Tag.ToString(); string str = comunt(); if (str != "") { DataTable dt = LinQBaseDao.Query(str).Tables[0]; if (dt.Rows.Count > 0) { S_phone = dt.Rows[0][0].ToString(); } } if (tv_StaffInfo.SelectedNode.Parent == null)//父节点 { S_Name = tv_StaffInfo.SelectedNode.Text; S_Indes = tv_StaffInfo.SelectedNode.Name; } else { S_Name = tv_StaffInfo.SelectedNode.Name; S_Indes = tv_StaffInfo.SelectedNode.Text; } } tv_StaffInfo.Nodes.Clear(); } this.Visible = false; }
private void dgvCarAttribute_DoubleClick(object sender, EventArgs e) { try { if (this.dgvCarAttribute.SelectedRows[0].Cells["CardInfo_ID"].Value.ToString() == "") { MessageBox.Show("请选择要查看的单元格!"); return; } groupBox1.Visible = true; //得到车辆信息编号 保存车辆信息编号 string cardinfo_id = this.dgvCarAttribute.SelectedRows[0].Cells["CardInfo_ID"].Value.ToString(); DataTable dt = LinQBaseDao.Query(" select CardInfo_Pic,CardInfo_Remark from CardInfo where CardInfo_ID=" + cardinfo_id).Tables[0]; if (dt.Rows.Count > 0) { string CardInfo_Pic = dt.Rows[0][0].ToString(); string CardInfo_Remark = dt.Rows[0][1].ToString(); pic1.ImageLocation = SystemClass.SaveFile + CardInfo_Pic; pic2.ImageLocation = SystemClass.SaveFile + CardInfo_Remark; } else { pic1.ImageLocation = ""; pic2.ImageLocation = ""; } } catch { groupBox1.Visible = false; pic1.ImageLocation = ""; pic2.ImageLocation = ""; CommonalityEntity.WriteTextLog(" ICRecordForm.dgvCarAttribute_DoubleClick()"); } }
/// <summary> /// 添加 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnSave_Click(object sender, EventArgs e) { string name = txtName.Text.Trim(); if (string.IsNullOrEmpty(name)) { MessageBox.Show(this, "客户端名称不能为空"); return; } if (btnSave.Text == "添加") { if (ClientDAL.ISClientInfoName(name)) { MessageBox.Show(this, "客户端名称已存在"); return; } int id = 0; ClientInfo client = new ClientInfo(); client.Client_NAME = name; client.Client_Dictionary_ID = Convert.ToInt32(cmbState.SelectedValue); client.Client_Phone = txtPhone.Text.Trim(); client.Client_ADDRESS = txtAddres.Text.Trim(); client.Client_REMARK = txtRemark.Text.Trim(); if (ClientDAL.InsertOneClientInfo(client, out id)) { MessageBox.Show("添加成功!"); Empty(); } else { MessageBox.Show("添加失败!"); } } else { if (cid == 0) { return; } object obj = LinQBaseDao.GetSingle("select count(0) from ClientInfo where Client_ID !=" + cid + " and Client_NAME='" + name + "'"); if (Convert.ToInt32(obj.ToString()) > 0) { MessageBox.Show(this, "客户端名称已存在"); return; } Expression <Func <ClientInfo, bool> > exp = n => n.Client_ID == cid; Action <ClientInfo> ap = s => { s.Client_NAME = name; s.Client_Dictionary_ID = Convert.ToInt32(cmbState.SelectedValue); s.Client_Phone = txtPhone.Text.Trim(); s.Client_ADDRESS = txtAddres.Text.Trim(); s.Client_REMARK = txtRemark.Text.Trim(); }; ClientDAL.Update(exp, ap); Empty(); } LoadData(""); }
/// <summary> /// 得到时间差 /// </summary> /// <returns></returns> public static string GetTime(string d) { string times = ""; try { if (d.Length < 21) { return("0"); } string y = "20" + d.Substring(0, 2); string m = d.Substring(2, 2); string dd = d.Substring(4, 2); string h = d.Substring(6, 2); string mi = d.Substring(8, 2); string ss = d.Substring(10, 2); string time = y + "-" + m + "-" + dd + " " + h + ":" + mi + ":" + ss; DateTime dt = DateTime.Parse(time); t = dt; string sqltime = "select top 1 DATEDIFF(MINUTE,'" + dt + "',GETDATE()) from eh_CarPic "; var ds = LinQBaseDao.GetSingle(sqltime); times = ds.ToString(); } catch (Exception ex) { common.WriteTextLog("ImageFile GetTime()" + ex.Message); } return(times); }
private void PicForm_Load(object sender, EventArgs e) { System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = false; ThreadPool.QueueUserWorkItem(new WaitCallback(a), null); DataTable dt = LinQBaseDao.Query(" select * from View_QCRecordInfo where QCRecord_ID=" + QCRecord_ID).Tables[0]; if (dt.Rows.Count > 0) { lblCNTR_NO.Text = dt.Rows[0]["CNTR_NO"].ToString(); lblDictionary_Name.Text = dt.Rows[0]["Dictionary_Name"].ToString(); lblQCInfo_BAGWeight.Text = dt.Rows[0]["QCInfo_BAGWeight"].ToString(); lblQCInfo_MATERIAL_SCALE.Text = dt.Rows[0]["QCInfo_MATERIAL_SCALE"].ToString(); lblQCInfo_MATERIAL_WEIGHT.Text = dt.Rows[0]["QCInfo_MATERIAL_WEIGHT"].ToString(); lblQCInfo_PAPER_SCALE.Text = dt.Rows[0]["QCInfo_PAPER_SCALE"].ToString(); lblQCInfo_PAPER_WEIGHT.Text = dt.Rows[0]["QCInfo_PAPER_WEIGHT"].ToString(); lblQCInfo_PumpingPackets.Text = dt.Rows[0]["QCInfo_PumpingPackets"].ToString(); lblQCRecord_DRAW.Text = dt.Rows[0]["QCRecord_DRAW"].ToString(); lblQCRecord_ID.Text = dt.Rows[0]["QCRecord_ID"].ToString(); lblQCRecord_RESULT.Text = dt.Rows[0]["QCRecord_RESULT"].ToString(); lblQCRecord_TARE.Text = dt.Rows[0]["QCRecord_TARE"].ToString(); lblQCRecord_TIME.Text = dt.Rows[0]["QCRecord_TIME"].ToString(); lblTestItems_NAME.Text = dt.Rows[0]["TestItems_NAME"].ToString(); lblUserName.Text = dt.Rows[0]["UserName"].ToString(); lblWEIGHT_TICKET_NO.Text = dt.Rows[0]["WEIGHT_TICKET_NO"].ToString(); } }
/// <summary> /// 抽包 /// </summary> /// <param name="qcinfoid"></param> private void getPackets(int qcinfoid, int did) { try { //DTS包号 List <string> listbags = QCInfoDAL.GetBags(qcinfoid); //总包数 DataTable dtNO_OF_BALES = LinQBaseDao.Query("select NO_OF_BALES from dbo.DRAW_EXAM_INTERFACE where DRAW_EXAM_INTERFACE_ID=" + did).Tables[0]; string Packets_DTS = "";//DTS string类型包号 foreach (string item in listbags) { Packets_DTS += item + ","; } Packets_DTS = Packets_DTS.TrimEnd(','); Packets p = new Packets(); p.Packets_DTS = Packets_DTS; p.Packets_this = ""; p.Packets_QCInfo_DRAW_EXAM_INTERFACE_ID = did; p.Packets_Time = DateTime.Now; PacketsDAL.InsertOneQCRecord(p); Common.GetSumWaterCount(qcinfoid); LinQBaseDao.Query("update QCInfo set QCInfo_DRAW='" + Packets_DTS + "',QCInfo_PumpingPackets=" + Packets_DTS.Split(',').Count() + ",QCInfo_MOIST_Count=" + Common.SumWaterCount + " where QCInfo_ID=" + qcinfoid); } catch { } }
protected void treeViewPositionlist(TreeNodeCollection node, string MtID) { node.Clear(); ///获取当前拥有的权限 DataTable table; table = LinQBaseDao.Query("select * from Dictionary where Dictionary_OtherID=(select Dictionary_ID from Dictionary where Dictionary_Value='09') order by Dictionary_Sort asc").Tables[0]; TreeNode nodeTemp; for (int i = 0; i < table.Rows.Count; i++) { nodeTemp = new TreeNode(); nodeTemp.Tag = table.Rows[i]["Dictionary_ID"]; if (table.Rows[i]["Dictionary_Name"] != null) { nodeTemp.Text = table.Rows[i]["Dictionary_Name"].ToString(); nodeTemp.Name = table.Rows[i]["Dictionary_ID"].ToString(); } if (Convert.ToBoolean(table.Rows[i]["Dictionary_State"]) == false) { nodeTemp.BackColor = Color.Yellow; } if (nodeTemp != null) { node.Add(nodeTemp); //加入节点 } } }
/// <summary> /// 短信表添加待发送信息 /// </summary> /// <param name="Queue_Cartype"></param> private void insertNoteRecord(string Queue_Cartype) { try { DataTable dtSort = LinQBaseDao.Query("select CarInfo_ID,CarInfo_Name,StaffInfo_Name,StaffInfo_Phone from View_CarState where SortNumberInfo_TongXing ='排队中' and CarType_Name='" + Queue_Cartype + "' order by CarInOutRecord_ID ").Tables[0]; if (dtSort.Rows.Count > 0) { //间隔数量 DataTable dtJianGe = LinQBaseDao.Query("select PositionSMS_Remark,PositionSMS_Content from PositionSMS where PositionSMS_Position_ID =" + SystemClass.PositionID).Tables[0]; if (dtJianGe.Rows.Count > 0) { int JGcOUNT = Convert.ToInt32(dtJianGe.Rows[0]["PositionSMS_Remark"]); //间隔数量 string content = dtJianGe.Rows[0]["PositionSMS_Content"].ToString(); //发送内容 if ((1 + JGcOUNT) <= dtSort.Rows.Count) { string CarInfo_Name = dtSort.Rows[JGcOUNT + 1]["CarInfo_Name"].ToString(); string CarInfo_ID = dtSort.Rows[JGcOUNT + 1]["CarInfo_ID"].ToString(); string StaffInfo_Name = dtSort.Rows[JGcOUNT + 1]["StaffInfo_Name"].ToString(); string StaffInfo_Phone = dtSort.Rows[JGcOUNT + 1]["StaffInfo_Phone"].ToString(); LinQBaseDao.Query("insert into NoteRecord values('" + StaffInfo_Name + "','" + StaffInfo_Phone + "'," + CarInfo_ID + ",'" + CarInfo_Name + "','" + content + "','" + CommonalityEntity.GetServersTime() + "',0)"); } } } } catch (Exception ex) { return; } }
/// <summary> /// 控件判断 /// </summary>admin /// <param name="ControlName">控件名称</param> /// <param name="FromName">窗体名称</param> /// <param name="ControlAttribute">控件属性,Visible,Enabled</param> /// <returns>bool</returns> public static bool BoolControl(string ControlName, string FromName, string ControlAttribute) { if (CommonalityEntity.USERNAME.ToString().Trim().ToLower() == "emewe") { return(true); } try { DataTable tables = LinQBaseDao.Query("select Permissions_" + ControlAttribute + " from PermissionsInfo where Permissions_Menu_ID in (select Menu_ID from MenuInfo where Menu_ControlName='" + ControlName + "' and Menu_OtherID in (select Menu_ID from dbo.MenuInfo where Menu_FromName='" + FromName + "')) and (Permissions_UserId=" + CommonalityEntity.USERID + " or Permissions_Role_Id=" + CommonalityEntity.USERRoleID + ") ").Tables[0]; if (tables.Rows.Count > 0) { if (Convert.ToBoolean(tables.Rows[0]["Permissions_" + ControlAttribute].ToString())) { return(true); } else { return(false); } } else { return(false); } } catch { return(false); } }
private void GetCarInOutinfo() { DataTable dt = LinQBaseDao.Query("select CarInfo_Name,CarType_Name,CarInfo_Operate,CustomerInfo_Name,StaffInfo_Name,StaffInfo_Identity,CarInOutInfoRecord_ICType,CarInOutInfoRecord_ICValue,CarInOutInfoRecord_UserName,CarInOutInfoRecord_Remark,CarInOutInfoRecord_Time,CarInOutInfoRecord_Abnormal from View_carInOutSatistics where CarInOutInfoRecord_ID=" + CommonalityEntity.CarInOutInfoRecord_ID).Tables[0]; if (dt.Rows.Count > 0) { txtCarName.Text = dt.Rows[0]["CarInfo_Name"].ToString(); txtCarType_Name.Text = dt.Rows[0]["CarType_Name"].ToString(); txtCur.Text = dt.Rows[0]["CustomerInfo_Name"].ToString(); txtICtype.Text = dt.Rows[0]["CarInOutInfoRecord_ICType"].ToString(); txtICValue.Text = dt.Rows[0]["CarInOutInfoRecord_ICValue"].ToString(); txtStaffName.Text = dt.Rows[0]["StaffInfo_Name"].ToString(); txtStaInds.Text = dt.Rows[0]["StaffInfo_Identity"].ToString(); txtUser.Text = dt.Rows[0]["CarInOutInfoRecord_UserName"].ToString(); txtPicAdd.Text = dt.Rows[0]["CarInOutInfoRecord_Remark"].ToString(); txtOutTime.Text = dt.Rows[0]["CarInOutInfoRecord_Time"].ToString(); txtUserName.Text = dt.Rows[0]["CarInfo_Operate"].ToString(); lbException.Text = dt.Rows[0]["CarInOutInfoRecord_Abnormal"].ToString(); dt = LinQBaseDao.Query("select CarPic_Type,CarPic_Add,CarPic_Match from CarPic where CarPic_CarInOutInfoRecord_ID=" + CommonalityEntity.CarInOutInfoRecord_ID).Tables[0]; if (dt.Rows.Count > 0) { txtPicType.Text = dt.Rows[0]["CarPic_Type"].ToString(); txtISTrue.Text = dt.Rows[0]["CarPic_Match"].ToString(); } } }
private void BindCarType() { stawayType.DataSource = LinQBaseDao.Query("select distinct (DrivewayStrategy_Name) from DrivewayStrategy where DrivewayStrategy_State='启动'").Tables[0]; stawayType.DisplayMember = "DrivewayStrategy_Name"; stawayType.ValueMember = "DrivewayStrategy_Name"; stawayType.SelectedIndex = 0; }
private void ICCardPermissions_MouseDoubleClick(object sender, MouseEventArgs e) { treeViewIcP.Nodes.Clear(); try { if (GBPermissions.Visible) { GBPermissions.Visible = false; } else { GBPermissions.Visible = true; TreeNode tr1; DataTable table3 = LinQBaseDao.Query("select Dictionary_Name,Dictionary_Value from Dictionary where Dictionary_OtherID in(select Dictionary_ID from dbo.Dictionary where Dictionary_Value='20')").Tables[0]; for (int s = 0; s < table3.Rows.Count; s++) { tr1 = new TreeNode(); tr1.Tag = table3.Rows[s]["Dictionary_Value"]; tr1.Text = table3.Rows[s]["Dictionary_Name"].ToString(); treeViewIcP.Nodes.Add(tr1); } } } catch { CommonalityEntity.WriteTextLog("ICCardForm txtICCard_Permissions_DoubleClick()"); } }
private bool IsSapNo(string CarName, string CarInfo_PO) { try { bool istrue = false; DataTable dt = LinQBaseDao.Query("select * from eh_SAPRecord where Sap_InCarNumber='" + CarName + "' and Sap_State=1 order by Sap_InTime desc").Tables[0]; if (dt.Rows.Count > 0) { string strNo = dt.Rows[0]["Sap_InNO"].ToString(); DateTime BTime = Convert.ToDateTime(dt.Rows[0]["Sap_OutKDATB"].ToString()); DateTime ETime = Convert.ToDateTime(dt.Rows[0]["Sap_OutKDATE"].ToString()); DateTime NewTime = CommonalityEntity.GetServersTime(); if (strNo == CarInfo_PO) { DataTable dtstate = LinQBaseDao.Query("select SortNumberInfo_TongXing from View_CarState where CarInfo_Name='" + CarName + "' and CarInfo_PO='" + CarInfo_PO + "' order by CarInfo_ID desc").Tables[0]; if (dtstate.Rows.Count > 0) { string tonging = dtstate.Rows[0][0].ToString(); if (tonging == "已出厂") { istrue = true; } } } } return(istrue); } catch (Exception) { return(true); } }
private void 添加ToolStripMenuItem_Click(object sender, EventArgs e) { Form f = new Form(); f.Text = strtabelNtext; f.Name = strtabelName; f.Width = 200; f.Height = 150; f.Show(); f.TopLevel = false; f.Visible = true; this.groupBox2.Controls.Add(f); string strsql = String.Format("select a.name,g.value from syscolumns a left join systypes b on a.xtype=b.xusertype inner join sysobjects d on a.id=d.id and d.xtype='U' and d.name='{0}' left join sys.extended_properties g on a.id=g.major_id AND a.colid = g.minor_id order by a.id,a.colorder", strtabelName); dt = LinQBaseDao.Query(strsql).Tables[0]; dt.Rows[0]["name"] = "*"; dt.Rows[0]["value"] = "(*)所有字段"; clb = new CheckedListBox(); clb.DataSource = dt; clb.DisplayMember = "value"; clb.ValueMember = "name"; f.Controls.Add(clb); clb.Dock = DockStyle.Fill; clb.DoubleClick += new System.EventHandler(this.checkedListBox1_Click); }
private void btnSave_Click(object sender, EventArgs e) { if (txtNewNum.Text.Trim() == "") { MessageBox.Show(this, "请输入新的单号!"); return; } if (txtRemark.Text.Trim() == "") { MessageBox.Show(this, "请输入修改原因!"); return; } if (sap_id == "") { MessageBox.Show(this, "修改的数据标识失效,请重新数据小票获取!"); return; } string rstr = ""; if (CommonalityEntity.ISSapCheck(txtCarType.Text.Trim(), txtNewNum.Text.Trim(), out rstr)) { string strSql = "update eh_SAPRecord set Sap_Remark='" + txtRemark.Text.Trim() + "' ,Sap_InNO='" + txtNewNum.Text.Trim() + "' where Sap_ID=" + sap_id; LinQBaseDao.Query(strSql); strSql = "update View_CarState set CarInfo_PO='" + txtNewNum.Text.Trim() + "' where SmallTicket_Serialnumber='" + txtNewNum.Text.Trim() + "'"; LinQBaseDao.Query(strSql); string operateContent = "SAP手动修改单号将原单号" + txtOldNum.Text.Trim() + "改为新单号" + txtNewNum.Text.Trim() + ",修改原因:" + txtRemark.Text.Trim(); MessageBox.Show(this, "SAP新单号修改成功!"); } else { MessageBox.Show(this, "SAP新单号验证失败," + rstr); } }
//按条件查询车辆信息 private void BindTypeting() { try { lblleixingzhi.Font = new System.Drawing.Font("宋体", fontsize + 3); lblleixingting.Font = new System.Drawing.Font("宋体", fontsize + 3); lblpaiduihaoting.Font = new System.Drawing.Font("宋体", fontsize); lblChePaiting.Font = new System.Drawing.Font("宋体", fontsize); lblMenGangting.Font = new System.Drawing.Font("宋体", fontsize); lblTongDaoting.Font = new System.Drawing.Font("宋体", fontsize); if (typeting > 0) { if (saTypeting.Tables[0].Rows.Count == 1) { dscarting = LinQBaseDao.Query("Select top (5) 车牌号,Position_Name,通道名称,排队号,SortNumberInfo_ID from View_LEDShow_zj where 车辆类型='" + saTypeting.Tables[0].Rows[0]["CarType_Name"] + "' and 通行状态='排队中' and SortNumberInfo_State='启动' and 排队号 is not null order by SortNumberInfo_ID"); } else { dscarting = LinQBaseDao.Query("Select top (5) 车牌号,Position_Name,通道名称,排队号,SortNumberInfo_ID from View_LEDShow_zj where 车辆类型='" + saTypeting.Tables[0].Rows[typecountting]["CarType_Name"] + "' and 通行状态='排队中' and SortNumberInfo_State='启动' and 排队号 is not null order by SortNumberInfo_ID"); } if (dscarting.Tables[0].Rows.Count > 0) { CheLiangCountting = dscarting.Tables[0].Rows.Count; lblleixingzhi.Text = saTypeting.Tables[0].Rows[typecountting]["CarType_Name"].ToString(); } } } catch { CommonalityEntity.WriteTextLog(" LEDTingForm.BindTypeting异常:"); } }
/// <summary> /// 删除 /// </summary> private void Delete() { int index = 0; if (dgvImageRecord.SelectedRows.Count < 1) { MessageBox.Show("请选择至少一行进行删除"); return; } string sum = dgvImageRecord.SelectedRows[0].Cells["ImageRecord_Id"].Value.ToString(); for (int i = 0; i < this.dgvImageRecord.SelectedRows.Count; i++) { string SqlDelete = "delete ImageRecord where ImageRecord_Id=" + dgvImageRecord.SelectedRows[i].Cells["ImageRecord_Id"].Value.ToString(); int num = LinQBaseDao.ExecuteSql(SqlDelete); if (num > 0) { index++; } } if (index > 0) { MessageBox.Show("删除成功"); LoadData(""); } else { MessageBox.Show("删除失败"); } }
private void timerData_Tick(object sender, EventArgs e) { //if (mf.strWater != "") //{ // txtRecord.Text = "——" + mf.strWater + txtRecord.Text; // mf.strWater = ""; //} try { DataTable dt = LinQBaseDao.Query("select * from Moisture_test where Moisture_test_Collection_ID in (" + cid + ") and Moisture_test_status=0 and Moisture_test_Time>'" + dtime + "' ").Tables[0]; if (dt.Rows.Count > 0) { DataRow dr = dt.Rows[0]; //string instrumentID = dt.Rows[0]["Moistrue_test_Instrument_ID"].ToString(); string strWater = Common.GetServersTime().ToString() + " 序号:" + dt.Rows[0]["Moisture_test_NO"].ToString() + " 次数:" + dt.Rows[0]["Moisture_test_count"].ToString() + " 水分值:" + dt.Rows[0]["Moisture_test_value"].ToString(); //if (instrumentID == "1") //{ // txtRecord.Text = strWater + "\r\n" + txtRecord.Text; //} //else //{ // txtRecord2.Text = strWater + "\r\n" + txtRecord2.Text; //} txtRecord.Text = strWater + "\r\n" + txtRecord.Text; LinQBaseDao.Query("update Moisture_test set Moisture_test_status=1 where Moisture_test_ID=" + dt.Rows[0]["Moisture_test_ID"].ToString()); } } catch (Exception) { } }
/// <summary> /// 判断当前操作的车辆类型是否正在使用 /// </summary> private bool JudgeCarTypeUseMethod() { bool rbool = true; arraylist.Clear(); try { string strsql = String.Format("select * from dbo.ManagementStrategy where ManagementStrategy_CarType_ID in({0}) ", strCarType_ID); arraylist.Add(strsql); strsql = String.Format("select * from DrivewayStrategy where DrivewayStrategy_CarType_ID in({0}) ", strCarType_ID); arraylist.Add(strsql); strsql = String.Format("select * from PrintInfo where Print_CarType_ID in({0}) ", strCarType_ID); arraylist.Add(strsql); strsql = String.Format("select * from CarInfo where CarInfo_CarType_ID in({0}) ", strCarType_ID); arraylist.Add(strsql); if (LinQBaseDao.GetCount(arraylist) > 0) { rbool = false; } } catch { CommonalityEntity.WriteTextLog("CarTypeForm.JudgeCarTypeUseMethod()"); } return(rbool); }
//绑定职务 private void bingcob_Duty_Name() { cobDuty_Name.DataSource = LinQBaseDao.Query <DutyInfo>(new DCQUALITYDataContext()); cobDuty_Name.DisplayMember = "Duty_Name"; cobDuty_Name.ValueMember = "Duty_ID"; cobDuty_Name.Text = ""; }