private List <SqlParameter> Set_Values_In_Quality(QualityInfo quality) { List <SqlParameter> sqlParamList = new List <SqlParameter>(); sqlParamList.Add(new SqlParameter("@Yarn_Type_Id", quality.Yarn_Type_Id)); sqlParamList.Add(new SqlParameter("@Reed", quality.Reed)); sqlParamList.Add(new SqlParameter("@Pick", quality.Pick)); sqlParamList.Add(new SqlParameter("@Weave", quality.Weave)); sqlParamList.Add(new SqlParameter("@Minimum_Order_Size", quality.Minimum_Order_Size)); sqlParamList.Add(new SqlParameter("@Ideal_Roll_Length", quality.Ideal_Roll_Length)); sqlParamList.Add(new SqlParameter("@Our_Sample_No", quality.Our_Sample_No)); sqlParamList.Add(new SqlParameter("@Quality_No", quality.Quality_No)); sqlParamList.Add(new SqlParameter("@Status", quality.Status)); sqlParamList.Add(new SqlParameter("@UpdatedOn", quality.UpdatedOn)); sqlParamList.Add(new SqlParameter("@UpdatedBy", quality.UpdatedBy)); if (quality.Quality_Id == 0) { sqlParamList.Add(new SqlParameter("@CreatedBy", quality.CreatedBy)); sqlParamList.Add(new SqlParameter("@CreatedOn", quality.CreatedOn)); } if (quality.Quality_Id != 0) { sqlParamList.Add(new SqlParameter("@Quality_Id", quality.Quality_Id)); } return(sqlParamList); }
private void button1_Click(object sender, EventArgs e) { if (this.dataGridView1.CurrentRow == null) { MessageBox.Show("請選中需要质检的单号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.textBox1.Focus(); return; } int index = this.dataGridView1.CurrentRow.Index; string qualityNo = this.dataGridView1.Rows[index].Cells["QualiatyNo"].Value.ToString(); QualityInfo qualityInfo = qualityInfos[index]; qualityInfo.Status = "2"; if (qualityInfoService.updateEndQualityInfo(qualityInfo)) { WoInfo woInfo = woInfoService.queryWoInfoByNo(qualityInfo.WoNo); woInfo.Status = "2"; woInfo.CheckTimes = woInfo.CheckTimes + 1; if (woInfoService.updateWoInfoStatusAndTimes(woInfo)) { this.qualityInfos.RemoveAt(this.dataGridView1.SelectedRows[0].Index); this.dataGridView1.Rows.RemoveAt(this.dataGridView1.SelectedRows[0].Index); } } else { MessageBox.Show("质检结果更新失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private Dictionary <string, string> contentToDic(QualityInfo qualityInfo, List <MandUnionFieldType> mandUnionFieldTypeList) { PropertyInfo[] propertyInfoARR = qualityInfo.GetType().GetProperties(); Dictionary <string, string> property = new Dictionary <string, string>(); foreach (PropertyInfo propertyInfo in propertyInfoARR) { Object propertyVal = qualityInfo.GetType().GetProperty(propertyInfo.Name).GetValue(qualityInfo, null); if (propertyVal != null) { property.Add(propertyInfo.Name.ToUpper(), propertyVal.ToString()); } } Dictionary <string, string> contentDict = new Dictionary <string, string>(); foreach (MandUnionFieldType mandUnionFieldType in mandUnionFieldTypeList) { string fieldName = mandUnionFieldType.FieldName.ToUpper(); if (property.ContainsKey(fieldName)) { contentDict.Add(fieldName, property[fieldName]); } else { contentDict.Add(fieldName, mandUnionFieldType.FieldValue); } } return(contentDict); }
/// <summary> /// 质检结束更新 /// </summary> /// <param name="qualityInfo"></param> /// <returns></returns> public bool updateEndQualityInfo(QualityInfo qualityInfo) { bool saveMark = true; StringBuilder strSql = new StringBuilder(); strSql.Append("update t_qualityInfo set endTime=@endTime,duringTime=@duringTime,status=@status,remark=@remark,update_user=@updateUser,update_time=@updateTime where qualiatyNo=@qualiatyNo"); MySqlParameter[] parameters = { new MySqlParameter("@endTime", MySqlDbType.DateTime, 600), new MySqlParameter("@duringTime", MySqlDbType.Int32, 600), new MySqlParameter("@status", MySqlDbType.VarChar, 900), new MySqlParameter("@updateUser", MySqlDbType.VarChar, 900), new MySqlParameter("@updateTime", MySqlDbType.VarChar, 900), new MySqlParameter("@qualiatyNo", MySqlDbType.VarChar, 900), new MySqlParameter("@remark", MySqlDbType.VarChar, 900) }; parameters[0].Value = qualityInfo.EndTime; parameters[1].Value = qualityInfo.DuringTime; parameters[2].Value = qualityInfo.Status; parameters[3].Value = qualityInfo.Updateser; parameters[4].Value = qualityInfo.Updatetime; parameters[5].Value = qualityInfo.QualiatyNo; parameters[6].Value = qualityInfo.Remark; int rows = SQLHelper.ExecuteNonQuery(SQLHelper.ConnectionString, CommandType.Text, strSql.ToString(), parameters); if (rows > 0) { saveMark = true; } else { saveMark = false; } return(saveMark); }
private void formRepairRange_Shown(object sender, EventArgs e) { comboBoxInterpolateMethod.SelectedIndex = 0; comboBoxRepairInterval.SelectedIndex = 0; rangeQuality = Qualifier.ProcessRange(range); if (rangeQuality == null) { _ = MessageBox.Show(this, "Произошла ошибка при открытии ряда. Возможно, ряд слишком короткий", "Открытие ряда", MessageBoxButtons.OK, MessageBoxIcon.Warning); this.Close(); return; } labelCompletness.Text = "Полнота ряда: " + (rangeQuality.Completeness * 100).ToString("0.00") + "%"; labelMaxEmptySpace.Text = "Максимальный перерыв в измерениях: " + rangeQuality.MaxEmptySpace.TotalDays.ToString("0.000") + " дней"; labelRangeLength.Text = "Длительность ряда: " + range.Length.ToText(); string dt; if (rangeQuality.Intervals.Count > 1) { StandartIntervals min = rangeQuality.Intervals.Min <RangeInterval, StandartIntervals>((i) => i.Interval); StandartIntervals max = rangeQuality.Intervals.Max <RangeInterval, StandartIntervals>((i) => i.Interval); dt = $"минимальный: {min.Description()}, максимальный: {max.Description()}"; } else { dt = rangeQuality.Intervals[0].Interval.Description(); } labelInterval.Text = "Δt: " + dt; }
public QualityViewModel() { Friendly_Message = new List <FriendlyMessageInfo>(); Pager = new PaginationInfo(); Quality = new QualityInfo(); Quality_Grid = new List <QualityInfo>(); Filter = new Quality_Filter(); Yarn_Types = new List <AttributeCodeInfo>(); Weaves_Types = new List <AttributeCodeInfo>(); Quality_Application_Mapping = new QualityApplicationMappingInfo(); Quality_Application_Mapping_Grid = new List <QualityApplicationMappingInfo>(); Application = new ApplicationInfo(); Quality_Market_Segment_Mapping = new QualityMarketSegmentMappingInfo(); Quality_Market_Segment_Mapping_Grid = new List <QualityMarketSegmentMappingInfo>(); Market_Segment = new MarketSegmentInfo(); }
static bool Prefix(ref string __result, ref int _quality, ref bool _useQualityColor) { Debug.Log("Patch 4"); if (_quality != 0) { Debug.Log("Patching..."); string text = string.Empty; _quality /= 10; switch (_quality) { case 0: text = Localization.Get("lblQualityDamaged"); break; case 1: text = Localization.Get("lblQualityPoor"); break; case 2: text = Localization.Get("lblQualityAverage"); break; case 3: text = Localization.Get("lblQualityGreat"); break; case 4: text = Localization.Get("lblQualityFlawless"); break; case 5: text = Localization.Get("lblQualityLegendary"); break; case 6: text = Localization.Get("lblQualityLegendaryPlus"); break; case 7: text = Localization.Get("lblQualityRelic"); break; case 8: text = Localization.Get("lblQualityDemonic"); break; } if (_useQualityColor) { text = string.Format("[{0}]{1}[-]", QualityInfo.GetQualityColorHex(_quality), text); __result = text; Debug.Log("Patch done"); } } else { __result = Localization.Get("lblQualityBroken"); } return(false); }
public int Insert_Quality(QualityInfo quality) { int Quality_Application_Id = 0; Quality_Application_Id = Convert.ToInt32(_sqlRepo.ExecuteScalerObj(Set_Values_In_Quality(quality), StoredProcedures.Insert_Quality_Sp.ToString(), CommandType.StoredProcedure)); return(Quality_Application_Id); }
public bool updateEndQualityInfo(QualityInfo qualityInfo) { qualityInfo.EndTime = DateTime.Now; qualityInfo.DuringTime = (long)(qualityInfo.EndTime - qualityInfo.StartTime)?.TotalMinutes; qualityInfo.Updatetime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); qualityInfo.Updateser = Auxiliary.loginName; return(qualityInfoDao.updateEndQualityInfo(qualityInfo)); }
public static void Postfix(XUiC_ItemStack __instance, bool ___bLocked, bool ___isDragAndDrop) { if (!Configuration.CheckFeatureStatus(AdvFeatureClass, Feature)) { return; } // Make sure we are dealing with legitimate stacks. if (__instance.ItemStack.IsEmpty()) { return; } if (__instance.ItemStack.itemValue == null) { return; } if (___bLocked && ___isDragAndDrop) { return; } // if (__instance.ItemStack.itemValue.NextSpoilageTick < (int)GameManager.Instance.World.GetWorldTime()) { if (__instance.ItemStack.itemValue.ItemClass != null && __instance.ItemStack.itemValue.ItemClass.Properties.Contains("Spoilable")) { float DegradationMax = 1000f; if (__instance.ItemStack.itemValue.ItemClass.Properties.Contains("SpoilageMax")) { DegradationMax = __instance.ItemStack.itemValue.ItemClass.Properties.GetFloat("SpoilageMax"); } __instance.durability.IsVisible = true; __instance.durabilityBackground.IsVisible = true; float PerCent = 1f - Mathf.Clamp01(__instance.ItemStack.itemValue.CurrentSpoilage / DegradationMax); int TierColor = 7 + (int)Math.Round(8 * PerCent); if (TierColor < 0) { TierColor = 0; } if (TierColor > 7) { TierColor = 7; } // allow over-riding of the color. if (__instance.ItemStack.itemValue.ItemClass.Properties.Contains("QualityTierColor")) { TierColor = __instance.ItemStack.itemValue.ItemClass.Properties.GetInt("QualityTierColor"); } __instance.durability.Color = QualityInfo.GetQualityColor(TierColor); __instance.durability.Fill = PerCent; } } }
static bool Prefix(QualityInfo __instance, ref int _tier) { if (_tier > 0) { _tier = (int)Math.Floor(_tier / 20 + 1m); } return(true); }
private QualityInfo Get_Quality_Values(DataRow dr) { QualityInfo quality = new QualityInfo(); quality.Quality_Id = Convert.ToInt32(dr["Quality_Id"]); quality.Quality_No = Convert.ToInt32(dr["Quality_No"]); return(quality); }
static bool Prefix(QualityInfo __instance, ref int _quality) { if (_quality > 0) { _quality = (int)Math.Floor(_quality / 20 + 1m); } return(true); }
static public int GetPhyAttack(int id, int level, int yellowPoint = 1) { HeroInfo info = GameTable.HeroInfoTableAsset.Lookup(id); if (null == info) { return(0); } RarityRelativeInfo rarityInfo = GameTable.RarityRelativeAsset.LookUp(info.Rarity); if (rarityInfo == null) { return(0); } QualityInfo qualityInfo = GameTable.qualityRelativeAsset.LookUp(info.Quality); if (qualityInfo == null) { return(0); } CardTypeInfo cardTypeInfo = GameTable.cardTypeVariationAsset.LookUp((int)info.AttrTypeID); if (cardTypeInfo == null) { return(0); } LevelUpInfo levelUpInfo = GameTable.LevelUpTableAsset.LookUp(level); if (levelUpInfo == null) { return(0); } CardLevelInfo cardLevelInfo = GameTable.cardLevelVariationAsset.LookUp((int)info.levelTypeID); if (cardLevelInfo == null) { return(0); } YellowPointInfo yellowPointInfo = GameTable.yellowPointParamAsset.LookUp(yellowPoint); if (yellowPointInfo == null) { return(0); } //Debug.Log("(" + info.FPhyAttack + "+" + cardTypeInfo.m_phyAtt + ") * (1 +" + cardLevelInfo.m_phyAttParam + "*" + level + "+" + yellowPointInfo.m_phyAttParam + ")*(" + rarityInfo.m_mainAttrMutiply +"+"+ qualityInfo.m_mainAttrMutiply+")"); // 计算物理攻击力 float attack = (info.FPhyAttack + cardTypeInfo.m_phyAtt) * (1 + cardLevelInfo.m_phyAttParam * level + yellowPointInfo.m_phyAttParam) * (rarityInfo.m_mainAttrMutiply + qualityInfo.m_mainAttrMutiply); return((int)attack); }
// 获得当前物理防御力 static public int GetPhyDefend(int id, int level, int yellowPoint = 1) { HeroInfo info = GameTable.HeroInfoTableAsset.Lookup(id); if (null == info) { return(0); } RarityRelativeInfo rarityInfo = GameTable.RarityRelativeAsset.LookUp(info.Rarity); if (rarityInfo == null) { return(0); } QualityInfo qualityInfo = GameTable.qualityRelativeAsset.LookUp(info.Quality); if (qualityInfo == null) { return(0); } CardTypeInfo cardTypeInfo = GameTable.cardTypeVariationAsset.LookUp((int)info.AttrTypeID); if (cardTypeInfo == null) { return(0); } LevelUpInfo levelUpInfo = GameTable.LevelUpTableAsset.LookUp(level); if (levelUpInfo == null) { return(0); } CardLevelInfo cardLevelInfo = GameTable.cardLevelVariationAsset.LookUp((int)info.levelTypeID); if (cardLevelInfo == null) { return(0); } YellowPointInfo yellowPointInfo = GameTable.yellowPointParamAsset.LookUp(yellowPoint); if (yellowPointInfo == null) { return(0); } // 获得当前魔法 防御力 float attack = (info.FPhyDefend + cardTypeInfo.m_phyDef) * (1 + cardLevelInfo.m_phyDefParam * level + yellowPointInfo.m_phyDefParam) * (rarityInfo.m_mainAttrMutiply + qualityInfo.m_mainAttrMutiply); return((int)attack); }
public QualityInfo LookUp(int quality) { QualityInfo info = null; if (m_map.TryGetValue(quality, out info)) { return(info); } return(null); }
public IAsyncResult BeginModifyQualityInfo(string checkCode, int AccountID, QualityInfo entity, ref string ErrMsg, AsyncCallback callback, object asyncState) { IncrementCallCount(); var pCallback = new AsyncCallback((ar) => { DecrementCallCount(); callback(ar); }); return _client.BeginModifyQualityInfo(checkCode, AccountID, entity, ref ErrMsg, pCallback, asyncState); }
public QualityInfoDetailViewModel() { _eventAggregator = ServiceLocator.Current.GetInstance<IEventAggregator>(); _eventAggregator.GetEvent<CmdEvent>().Subscribe(param => { if (InfoTypeCollection == null ) { InfoTypeCollection = new ObservableCollection<string>(); InfoTypeCollection.Add("入库"); InfoTypeCollection.Add("减薄"); InfoTypeCollection.Add("抛光"); InfoTypeCollection.Add("镀膜"); } CurrentQualityInfo = param.Entity as QualityInfo; if (CurrentQualityInfo == null) { CurrentQualityInfo = new QualityInfo(); } }, ThreadOption.UIThread, true, p => p.Target == "QualityInfoDetailViewModel"); _rule = new QualityInfoRule(); _rule.AddQualityInfoCompleted += (s, e) => { if (e.Cancelled) { Common.MessageBox.Show(e.Error.Message); } else { Common.MessageBox.Show("添加成功"); _eventAggregator.GetEvent<CmdEvent>().Publish(new CmdEventParam() { cmdViewName = CmdViewName.QualityInfoMainView, Target = "Sell", }); } }; _rule.ModifyQualityInfoCompleted += (s, e) => { if (e.Cancelled) { Common.MessageBox.Show(e.Error.Message); } else { Common.MessageBox.Show("修改成功"); _eventAggregator.GetEvent<CmdEvent>().Publish(new CmdEventParam() { cmdViewName = CmdViewName.QualityInfoMainView, Target = "Sell", }); } }; }
private void FormRangeStatistic_Shown(object sender, EventArgs e) { range.PerformRefreshQuality(); qualityInfo = range.Quality; labelCompletness.Text = "Полнота ряда: " + (qualityInfo.Completeness * 100).ToString("0.0") + "%"; labelExpectAmount.Text = "Ожидаемое число измерений: " + qualityInfo.ExpectAmount.ToString() + " штук"; labelLength.Text = "Длительность ряда наблюдений: " + range.Length.ToText(); labelMaxEmpty.Text = "Максимальная длительность пропуска данных: " + qualityInfo.MaxEmptySpace.ToText(); labelMeasureAmount.Text = "Общее количество наблюдений: " + qualityInfo.MeasureAmount.ToString() + " штук"; dataGridViewExt1.DataSource = null; dataGridViewExt1.DataSource = qualityInfo.Intervals; }
public QualityInfo updateStartQualityInfo(QualityInfo qualityInfo) { QualityInfo reQualityInfo = null; qualityInfo.Updatetime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); qualityInfo.Updateser = Auxiliary.loginName; if (qualityInfoDao.updateStartQualityInfo(qualityInfo)) { reQualityInfo = qualityInfoDao.queryQualityInfoByNo(qualityInfo.QualiatyNo); } return(reQualityInfo); }
public void initRow(int index, QualityInfo qualityInfo) { this.dataGridView1.Rows[index].Cells[0].Value = qualityInfo.QualiatyNo; this.dataGridView1.Rows[index].Cells[1].Value = qualityInfo.WoNo; this.dataGridView1.Rows[index].Cells[2].Value = qualityInfo.StartTime; this.dataGridView1.Rows[index].Cells[3].Value = qualityInfo.EndTime; this.dataGridView1.Rows[index].Cells[4].Value = qualityInfo.DuringTime; this.dataGridView1.Rows[index].Cells[5].Value = qualityInfo.Status == "1" ? "质检中" :"未开始"; this.dataGridView1.Rows[index].Cells[6].Value = qualityInfo.Createtime; this.dataGridView1.Rows[index].Cells[7].Value = qualityInfo.DeliverMan; this.textBox1.Text = ""; qualityInfos.Add(qualityInfo); }
public static void SetShaderLevel() { QualityInfo qualityInfo = GetQualityInfo(); if (qualityInfo.mShaderLevel > 0) { Shader.EnableKeyword("SHADER_AdvancedEffect"); } else { Shader.DisableKeyword("SHADER_AdvancedEffect"); } }
public void Load(byte[] bytes) { m_map = new Dictionary <int, QualityInfo>(); BinaryHelper helper = new BinaryHelper(bytes); int sceneCount = helper.ReadInt(); for (int index = 0; index < sceneCount; ++index) { QualityInfo info = new QualityInfo(); info.Load(helper); m_map.Add(info.m_quality, info); } }
static public int GetHp(int id, int level, int yellowPoint = 1) { HeroInfo info = GameTable.HeroInfoTableAsset.Lookup(id); if (null == info) { return(0); } RarityRelativeInfo rarityInfo = GameTable.RarityRelativeAsset.LookUp(info.Rarity); if (rarityInfo == null) { return(0); } QualityInfo qualityInfo = GameTable.qualityRelativeAsset.LookUp(info.Quality); if (qualityInfo == null) { return(0); } CardTypeInfo cardTypeInfo = GameTable.cardTypeVariationAsset.LookUp((int)info.AttrTypeID); if (cardTypeInfo == null) { return(0); } CardLevelInfo cardLevelInfo = GameTable.cardLevelVariationAsset.LookUp((int)info.levelTypeID); if (cardLevelInfo == null) { return(0); } YellowPointInfo yellowPointInfo = GameTable.yellowPointParamAsset.LookUp(yellowPoint); if (yellowPointInfo == null) { return(0); } float maxLevelAttrParam = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enMaxLevelAttrParam).FloatTypeValue; float hp = (info.FHPMax + cardTypeInfo.m_hp) * (1 + cardLevelInfo.m_hpParam * level + yellowPointInfo.m_hpParam) * (rarityInfo.m_mainAttrMutiply + qualityInfo.m_mainAttrMutiply); return((int)hp); }
/// <summary> /// TODO 保存箱号信息 /// </summary> /// <param name="carton"></param> /// <returns></returns> public QualityInfo saveQualityInfo(QualityInfo qualityInfo) { QualityInfo reQualityInfo = null; qualityInfo.Uuid = Auxiliary.Get_UUID(); qualityInfo.Createtime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); qualityInfo.Opuser = Auxiliary.loginName; qualityInfo.Status = "0"; if (qualityInfoDao.saveQualityInfo(qualityInfo)) { reQualityInfo = qualityInfoDao.queryQualityInfoById(qualityInfo.Uuid); } return(reQualityInfo); }
public JsonResult Get_Quality_By_Id(int quality_Id) { QualityInfo quality = new QualityInfo(); try { quality = _enquiryMan.Get_Quality_By_Id(quality_Id); } catch (Exception ex) { Logger.Error("Enquiry Controller - Get_Quality_By_Id " + ex.ToString()); } return(Json(new { quality }, JsonRequestBehavior.AllowGet)); }
/// <summary> /// TODO 打印裝箱單 /// </summary> private void printQualityLabel(QualityInfo qualityInfo) { List <MandUnionFieldType> mandUnionFieldTypeList = manRelFieldTypeService.queryMandUnionFieldTypeList("MF0055"); bool judgePrint = barPrint.bactchPrintPalletByModel(filePath, contentToDic(qualityInfo, mandUnionFieldTypeList)); if (judgePrint) { //清空质检标打印签信息 clearAll(); } else { MessageBox.Show("打印失敗請聯係管理員!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } }
/// <summary> /// экспорт информации о периодах наблюдения /// </summary> /// <param name="fileName">имя файла</param> /// <param name="qualityInfo">информация для сохранения</param> /// <param name="rangeLength">длительность ряда</param> public override void SaveRangeQualityInfo(string fileName, QualityInfo qualityInfo, TimeSpan rangeLength) { using (ExcelPackage excelPackage = new ExcelPackage()) { //Set some properties of the Excel document excelPackage.Workbook.Properties.Author = "Wind Energy"; excelPackage.Workbook.Properties.Title = "Статистика наблюдений"; excelPackage.Workbook.Properties.Created = DateTime.Now; //Create the WorkSheet ExcelWorksheet worksheet = excelPackage.Workbook.Worksheets.Add("Лист 1"); worksheet.Cells[1, 1].Value = "Полнота ряда, %;" + qualityInfo.Completeness * 100; worksheet.Cells[2, 1].Value = "Общее количество наблюдений;" + qualityInfo.MeasureAmount; worksheet.Cells[3, 1].Value = "Ожидаемое число измерений;" + qualityInfo.ExpectAmount; worksheet.Cells[4, 1].Value = "Длительность ряда наблюдений; " + rangeLength.ToText(); worksheet.Cells[5, 1].Value = "Максимальная длительность пропуска данных;" + qualityInfo.MaxEmptySpace.ToText(); //заголовок List <string> caption = new List <string>() { "Диапазон наблюдений", "Интервал", "Длительность диапазона" }; for (int j = 1; j <= caption.Count; j++) { worksheet.Cells[7, j].Value = caption[j - 1]; } worksheet.Cells[7, 1, 7, caption.Count].Style.Font.Bold = true; worksheet.Cells[7, 1, 7, caption.Count].Style.Fill.PatternType = ExcelFillStyle.Solid; worksheet.Cells[7, 1, 7, caption.Count].Style.Fill.BackgroundColor.SetColor(Color.LightGray); int i = 8; foreach (var spi in qualityInfo.Intervals) { worksheet.Cells[i, 1].Value = spi.Diapason; worksheet.Cells[i, 2].Value = spi.Interval.Description(); worksheet.Cells[i, 3].Value = spi.Length.ToText(); } //Save your file FileInfo fi = new FileInfo(fileName); excelPackage.SaveAs(fi); } }
public double GetDouble(String key, double quality, bool interpolate = false) { QualityInfo first = GetQualityInfo(quality); if (interpolate) { QualityInfo next = GetNextQualityInfo(quality); if (!next.IsDefault) { double firstVal = first.GetDouble(key); double nextVal = next.GetDouble(key); double ratio = (quality - first.Threshold) / (next.Threshold - first.Threshold); return(firstVal + ratio * nextVal); } } return(first.GetInteger(key)); }
private void button1_Click(object sender, EventArgs e) { if (woInfo == null) { MessageBox.Show("请输入有效工单号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.textBox1.Focus(); return; } if (this.textBox3.Text == null || this.textBox3.Text.Trim() == "") { MessageBox.Show("请维护送样检测人工号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.textBox3.Focus(); return; } if (qualityInfoService.checkQualNo(woInfo.WoNo)) { //可以打印标签, 先检查是否需要保存工单. if (!woInfoService.exists(woInfo.WoNo)) { bool saveResult = woInfoService.saveWoInfo(woInfo); if (!saveResult) { MessageBox.Show("保存工单信息失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } QualityInfo qualityInfo = new QualityInfo(); qualityInfo.WoNo = woInfo.WoNo; qualityInfo.DeliverMan = this.textBox3.Text.Trim(); qualityInfo.QualiatyNo = GenerateQuality.gennerateQualityNo("R040"); qualityInfo.CheckNum = qualityInfoService.queryCheckNum(woInfo.WoNo) + 1; QualityInfo printQualInfo = qualityInfoService.saveQualityInfo(qualityInfo); printQualInfo.DelMatno = woInfo.DelMatno; printQualInfo.ModelNo = woInfo.ModelNo; printQualInfo.Datecode = printQualInfo.Createtime; printQualityLabel(printQualInfo); } else { MessageBox.Show("该工单首件质检标签已完成/进行中,不能再产生质检标签!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); this.textBox1.Focus(); } }
/// <summary> /// 检查是否可以产生新的质检标签 /// </summary> /// <param name="woNo"></param> /// <returns></returns> public bool checkQualNo(string woNo) { QualityInfo qualInfo = qualityInfoDao.queryQualityInfoByWoNo(woNo); if (qualInfo == null) //未产生质检号,可以打印新的质检标签 { return(true); } else { if (qualInfo.Status.Equals("3")) //质检不合格,可以打印新的质检标签 { return(true); } else { return(false); //其他状态值不可以产生新的质检标签 } } }
public QualityInfo Get_Quality_By_Id(int quality_Id) { QualityInfo quality = new QualityInfo(); List <SqlParameter> sqlParams = new List <SqlParameter>(); sqlParams.Add(new SqlParameter("@Quality_Id", quality_Id)); DataTable dt = _sqlRepo.ExecuteDataTable(sqlParams, StoredProcedures.Get_Quality_Details_By_Id_Sp.ToString(), CommandType.StoredProcedure); List <DataRow> drList = new List <DataRow>(); drList = dt.AsEnumerable().ToList(); foreach (DataRow dr in drList) { quality = Get_Quality_Values(dr); } return(quality); }
private PatternBlock DetectBlock(int startNum, int startLineToSearch, int maxBlockLen, int maxDiffInBlock, int maxMisses, Dictionary<int, int> processedLinesDict, ILogWindowSearch logWindow) { int targetLine = FindSimilarLine(startNum, startLineToSearch, processedLinesDict, logWindow); if (targetLine == -1) { return null; } PatternBlock block = new PatternBlock(); block.startLine = startNum; int srcLine = block.startLine; block.targetStart = targetLine; int srcMisses = 0; block.srcLines.Add(srcLine, srcLine); int len = 0; QualityInfo qi = new QualityInfo(); qi.Quality = block.weigth; block.qualityInfoList[targetLine] = qi; while (!logWindow.ShouldCancel) { srcLine++; len++; if (maxBlockLen > 0 && len > maxBlockLen) { break; } int nextTargetLine = FindSimilarLine(srcLine, targetLine + 1, processedLinesDict, logWindow); if (nextTargetLine > -1 && nextTargetLine - targetLine - 1 <= maxDiffInBlock) { block.weigth += maxDiffInBlock - (nextTargetLine - targetLine - 1) + 1; block.endLine = srcLine; block.srcLines.Add(srcLine, srcLine); if (nextTargetLine - targetLine > 1) { int tempWeight = block.weigth; for (int tl = targetLine + 1; tl < nextTargetLine; ++tl) { qi = new QualityInfo(); qi.Quality = --tempWeight; block.qualityInfoList[tl] = qi; } } targetLine = nextTargetLine; qi = new QualityInfo(); qi.Quality = block.weigth; block.qualityInfoList[targetLine] = qi; } else { srcMisses++; block.weigth--; targetLine++; qi = new QualityInfo(); qi.Quality = block.weigth; block.qualityInfoList[targetLine] = qi; if (srcMisses > maxMisses) { break; } } } block.targetEnd = targetLine; qi = new QualityInfo(); qi.Quality = block.weigth; block.qualityInfoList[targetLine] = qi; for (int k = block.targetStart; k <= block.targetEnd; ++k) { block.targetLines.Add(k, k); } return block; }
public List<QualityInfo> GetAllQualityInfo() { KeyValue result = this.Read(QualityInfo.KeyName); List<QualityInfo> returnValue = new List<QualityInfo>(); QualityInfo def; if (result != null) { foreach (var subChildKey in result.Children) { def = new QualityInfo(); def.Name = subChildKey.Name; foreach (var itemSubChildKey in subChildKey.Children) { if (itemSubChildKey.Name.Equals(QualityInfo.SubKeyValue, StringComparison.CurrentCultureIgnoreCase)) { def.Value = int.Parse(itemSubChildKey.Value); } else if (itemSubChildKey.Name.Equals(QualityInfo.SubKeyCodedHexColor, StringComparison.CurrentCultureIgnoreCase)) { def.CodedHexColor = itemSubChildKey.Value; } } returnValue.Add(def); } } return returnValue; }
public bool DelQualityInfo(string checkCode, int AccountID, QualityInfo entity, ref string ErrMsg) { throw new NotImplementedException(); }