/// <summary> /// 根据入场煤运输记录生成批次并返回。 /// 根据入场时间(实际到厂时间)、供煤单位、煤种生成,已存在则不创建 /// </summary> /// <param name="buyFuelTransport"></param> /// <returns></returns> public CmcsInFactoryBatch GCQCInFactoryBatchByBuyFuelTransport(CmcsBuyFuelTransport buyFuelTransport, CmcsLMYB lmyb) { bool isSuccess = false; CmcsInFactoryBatch entity = HasInFactoryBatch(buyFuelTransport); if (entity == null) { //记录运输方式Id CodeContent transporttype = new CodeContent(); List <CodeContent> par = commonDAO.GetCodeContentByKind("运输方式"); if (par != null) { transporttype = par.Where(a => a.Content == "汽车").FirstOrDefault(); } entity = new CmcsInFactoryBatch() { Batch = CreateNewBatchNumber("QC", buyFuelTransport.InFactoryTime), BatchType = "汽车", TransportTypeId = transporttype != null ? transporttype.Id : "", TransportTypeName = "汽车", PlanArriveDate = buyFuelTransport.InFactoryTime, FactArriveDate = buyFuelTransport.InFactoryTime, FuelKindId = buyFuelTransport.FuelKindId, SupplierId = buyFuelTransport.SupplierId, SentSupplierId = buyFuelTransport.SupplierId, SendSupplierId = buyFuelTransport.SupplierId, MineId = buyFuelTransport.MineId, RunDate = buyFuelTransport.InFactoryTime, TransportCompanyId = buyFuelTransport.TransportCompanyId, Remark = "由汽车煤智能化自动创建", IsFinish = 0, IsCheck = 0, IsCTAutoCreate = 1, IsScale = 0, BACKBATCHDATE = buyFuelTransport.InFactoryTime, InFactoryType = buyFuelTransport.InFactoryType }; if (lmyb != null) { entity.LMYBID = lmyb.Id; entity.PlanArriveDate = lmyb.InFactoryTime; entity.QCal = lmyb.Q; entity.Stad = lmyb.S; entity.Vad = lmyb.V; } // 创建新批次 isSuccess = SelfDber.Insert(entity) > 0; } if (buyFuelTransport.SamplingType != eSamplingType.人工采样.ToString()) { // 生成采制化数据记录 CmcsRCSampling rCSampling = commonDAO.GCSamplingMakeAssay(entity, buyFuelTransport.SamplingType, "由汽车煤智能化自动创建", eAssayType.级编码化验); buyFuelTransport.SamplingId = rCSampling.Id; } buyFuelTransport.InFactoryBatchId = entity.Id; return(entity); }
private void FrmSupplier_Select_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Escape) { this.Output = null; this.DialogResult = DialogResult.Cancel; this.Close(); } }
void Return() { GridRow gridRow = superGridControl1.PrimaryGrid.ActiveRow as GridRow; if (gridRow == null) { return; } this.Output = (gridRow.DataItem as CodeContent); this.DialogResult = DialogResult.OK; this.Close(); }
/// <summary> /// 获取开元制样机制样类型 /// </summary> /// <param name="type"></param> /// <returns></returns> public string GetKYMakeType(string type) { IList <CodeContent> list = CommonDAO.GetInstance().GetCodeContentByKind("开元制样机制样类型"); if (list != null && list.Count > 0) { CodeContent entity = list.Where(a => a.Code == type).FirstOrDefault(); if (entity != null) { return(entity.Content); } } return(string.Empty); }
protected static String GetCodeListNew(string numbersWithCommer, String gameType) { try { CodeContent content = new CodeContent(); content.GameType = gameType; content.AnteCode = numbersWithCommer; List <CodeContent> issueList = new List <CodeContent>(); issueList.Add(content); String str = JsonHelper.ObjectToJson(issueList).ToString(); return(str); } catch (Exception ex) { MessageBox.Show(ex.Message); } return(string.Empty); }
public override void CreateCode() { try { string path = string.Empty; if (null == _entity) { path = ModelPathConverter.GetCodePath(_consType, IsOverWrite); } else { path = ModelPathConverter.GetCodePath(_consType, IsOverWrite, _entity); } using (FileStream create = new FileStream(path, FileMode.OpenOrCreate)) { byte[] buffer = Encoding.Default.GetBytes(CodeContent.ToString()); create.Write(buffer, 0, buffer.Length); } if (null == BuildTaget) { throw new Exception("Entity2Code Code Taget Lost"); } Project prj = BuildTaget as Project; if (null == prj) { throw new Exception("Entity2Code Code Taget Argment Error"); } BuildResult = prj.AddFromFile(path); base.CreateCode(); } catch (Exception ex) { MsgBoxHelp.ShowError("创建代码异常了", ex); } }
public override void CreateCode() { try { if (null == BuildTaget) { throw new Exception("Entity2Code Code Taget Lost"); } StringCodeArgment fileObj = BuildTaget as StringCodeArgment; if (null == fileObj) { throw new Exception("Entity2Code Code Taget Argment Error"); } Project prj = fileObj.Target; BuildResult = string.IsNullOrEmpty(fileObj.Folder) ? prj.AddFromFileString(CodeContent.ToString(), fileObj.Name, fileObj.Encode) : BuildResult = prj.AddFromFileString(CodeContent.ToString(), fileObj.Folder, fileObj.Name); base.CreateCode(); } catch (Exception ex) { MsgBoxHelp.ShowError("创建代码异常了", ex); } }