Example #1
0
 /// <summary>
 /// 加载对应工位下对应产品的配方
 /// </summary>
 /// <param name="production"></param>
 /// <param name="stationName"></param>
 public static bool LoadRecipes(string production, string stationName)
 {
     try
     {
         if (RecipesDic.Count > 0)
         {
             RecipesDic.Clear();
         }
         List <Crafts_Recipe_Modle> recipeList = Crafts_Recipe_Bll.GetRecipesByProductionAndStation(production, stationName);
         if (recipeList.Count > 0)
         {
             Dictionary <int, Dictionary <string, string> > rp = new Dictionary <int, Dictionary <string, string> >();
             foreach (Crafts_Recipe_Modle crm in recipeList)
             {
                 Dictionary <string, string> recipe = new Dictionary <string, string>();
                 recipe.Add("RecipeID", crm.RecipeID.ToString());
                 recipe.Add("ProductionName", crm.ProductionName);
                 recipe.Add("Station", crm.Station);
                 recipe.Add("Step", crm.Step.ToString());
                 recipe.Add("OperationType", crm.OperationType);
                 recipe.Add("ProgramNo", crm.ProgramNo);
                 recipe.Add("CheckRule", crm.CheckRule);
                 recipe.Add("BlotNo", crm.BlotNo);
                 recipe.Add("ComponentName", crm.ComponentName);
                 recipe.Add("BlotNumber", crm.BlotNumber.ToString());
                 recipe.Add("ComponentNNumber", crm.ComponentNNumber.ToString());
                 recipe.Add("BarcodeLength", crm.BarcodeLength.ToString());
                 recipe.Add("Istrace", crm.Istrace.ToString());
                 recipe.Add("IsCheck", crm.IsCheck.ToString());
                 recipe.Add("ImagePath", crm.ImagePath);
                 recipe.Add("SleeveNo", crm.SleeveNo.ToString());
                 recipe.Add("StepDescription", crm.StepDesc);
                 rp.Add(Convert.ToInt32(crm.Step), recipe);
             }
             RecipesDic.Add(stationName, rp);
             //WriteCacheStationInfo(stationName, "ToalStep", recipeList.Count.ToString());
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception)
     {
         return(false);
     }
 }