private void 查询_Click(object sender, EventArgs e) { string storecode = textBox1.Text.Trim(); if (!string.IsNullOrEmpty(storecode)) { bool find = false; string jydh = QC_Sample_Mix.FullStoreCode(storecode); foreach (var item in this.lableiji) { if (item.JyCode == jydh) { this.curLab = item; find = true; break; } } if (find == false) { MessageBox.Show("未查到数据"); } // curLab.CheckVals.LoadDataByWhere("main.Sample_Lab_ID=@Sample_Lab_ID", curLab.Sample_Lab_ID); SetGridViewFocuse(); } }
public void HandleCardMessage(Device.CardReader device, string cardId) { QC_IC_Info icCard = QC_IC_Info.FindByCardId(cardId); if (icCard == null) { MessageBox.Show("此卡未注册"); return; } if (!icCard.CardType.StartsWith("CUT_")) { MessageBox.Show("磁扣类型不对"); return; } if (icCard.SampleId <= 0) { MessageBox.Show("此卡没有业务信息"); return; } QC_Sample_Lab_Jy tempLab = QC_Sample_Lab_Jy.GetById(icCard.SampleId); if (tempLab == null) { MessageBox.Show("没有找到单据"); return; } tempLab.JyCode = DbContext.GetSeq("JY" + DateTime.Now.Date.ToString("yyyyMMdd"), 2); tempLab.Billtype = "开始检验"; tempLab.LabState = "开始检验"; tempLab.JyUser = LocalInfo.Current.user.ID; tempLab.JyTime = DateTime.Now; icCard.SampleId = 0; IDbConnection conn = DbContext.GetDefaultConnection(); conn.Open(); IDbTransaction trans = conn.BeginTransaction(); icCard.Save(trans); tempLab.Save(trans); trans.Commit(); conn.Close(); this.curLab = QC_Sample_Lab_Jy.GetById(tempLab.Sample_Lab_ID); lableiji.Add(curLab); DbContext.ExeSql("insert into QC_LabLog(zycode,jycode,jytime) values('" + this.curLab.StoreCode + "','" + this.curLab.JyCode + "',getDate())"); labTable1.LoadDataByWhere("labstate='送检' and checkgroupname like '化验样%' and maketime>=@maketime", DateTime.Today.AddDays(-1)); // labTable2.LoadDataByWhere("labstate='送检' and checkgroupname like '角质层%' and maketime>=@maketime", DateTime.Today.AddDays(-1)); label2.Text = labTable1.Count.ToString(); // label4.Text = labTable2.Count.ToString(); SetGridViewFocuse(); this.printDocument1.Print(); //自动打印 //this.printPreviewDialog1.ShowDialog(); }
private void qCSampleLabJyBindingSource_CurrentChanged(object sender, EventArgs e) { this.curLab = qCSampleLabJyBindingSource.Current as QC_Sample_Lab_Jy; }