Esempio n. 1
0
        /// <summary>
        ///
        /// 获取单步配方信息
        /// </summary>
        /// <param name="stationName"></param>
        /// <param name="stepNo"></param>
        /// <returns></returns>
        public static AsmRecipeDetailObject GetSingleRecipe(string stationName, int stepNo)
        {
            AsmRecipeDetailObject ardo = null;
            Dictionary <int, Dictionary <string, string> > stationRecipes = RecipesDic[stationName];
            Dictionary <string, string> recipe = stationRecipes[stepNo];

            if (recipe.Count > 0)
            {
                ardo               = new AsmRecipeDetailObject();
                ardo.StepNo        = recipe["StepNo"].ToString();
                ardo.Step_Category = recipe["Step_Category"];
                ardo.Material_Name = recipe["Material_Name"];
                ardo.Number        = recipe["Number"];
                ardo.Gun_No        = recipe["Gun_No"];
                ardo.Program_No    = recipe["Program_No"];
                ardo.Photo_No      = recipe["Photo_No"];
                ardo.Sleeve_No     = recipe["Sleeve_No"];
                ardo.ReworkTimes   = recipe["ReworkTimes"];
                ardo.Feacode       = recipe["Feacode"];
                ardo.CheckOrNo     = recipe["CheckOrNo"];
                ardo.ReviewOrNo    = recipe["ReviewOrNo"];
                ardo.ExactOrNo     = recipe["ExactOrNo"];
                ardo.MaterialPn    = recipe["MaterialPn"];
                ardo.BoltEQS       = recipe["BoltEQS"];
                ardo.A_Limit       = recipe["A_Limit"];
                ardo.T_Limit       = recipe["T_Limit"];
            }
            return(ardo);
        }
Esempio n. 2
0
 private void BT_Z_Click(object sender, EventArgs e)
 {
     for (int i = 0; i < recipeDetailDt.Rows.Count; i++)
     {
         recipeDetailDt.Rows[i]["StepNo"] = i + 1;
         AsmRecipeDetailObject ardo = new AsmRecipeDetailObject();
         ardo.RECIPE_DATIL_ID = Convert.ToInt32(recipeDetailDt.Rows[i]["RECIPE_DATIL_ID"].ToString());
         ardo.StepNo          = recipeDetailDt.Rows[i]["StepNo"].ToString();
         ardo.Step_Category   = recipeDetailDt.Rows[i]["Step_Category"].ToString();
         ardo.Material_Name   = recipeDetailDt.Rows[i]["Material_Name"].ToString();
         ardo.Number          = recipeDetailDt.Rows[i]["Number"].ToString();
         ardo.Gun_No          = recipeDetailDt.Rows[i]["Gun_No"].ToString();
         ardo.Program_No      = recipeDetailDt.Rows[i]["Program_No"].ToString();
         ardo.Photo_No        = recipeDetailDt.Rows[i]["Photo_No"].ToString();
         ardo.Sleeve_No       = recipeDetailDt.Rows[i]["Sleeve_No"].ToString();
         ardo.MaterialPn      = recipeDetailDt.Rows[i]["MaterialPn"].ToString();
         ardo.BoltEQS         = recipeDetailDt.Rows[i]["BoltEQS"].ToString();
         ardo.A_Limit         = recipeDetailDt.Rows[i]["A_Limit"].ToString();
         ardo.T_Limit         = recipeDetailDt.Rows[i]["T_Limit"].ToString();
         ardo.RECIPE_ID       = Convert.ToInt32(recipeDetailDt.Rows[i]["RECIPE_ID"].ToString());
         ardo.T_Limits        = recipeDetailDt.Rows[i]["T_Limits"].ToString();
         ardo.T_Target        = recipeDetailDt.Rows[i]["T_Target"].ToString();
         ardo.L_Program       = recipeDetailDt.Rows[i]["L_Program"].ToString();
         ardo.L_Rate          = recipeDetailDt.Rows[i]["L_Rate"].ToString();
         ardo.PICPath         = recipeDetailDt.Rows[i]["PICPath"].ToString();
         if (AsmRecipeDetail_BLL.UpdateProductionBOM(ardo) == 0)
         {
             MessageBox.Show("整理步序失败,请重试......");
             break;
         }
     }
     RecipeDetailRefresh();
 }
 /// <summary>
 /// 增加BOM信息
 /// </summary>
 /// <param name="pbo"></param>
 /// <returns></returns>
 public static int AddRecipeDetail(AsmRecipeDetailObject ardo)
 {
     using (IDbConnection conn = ClsCommon.OpenConnection())  //这里访问的是Sqlite数据文件,这里OpenConnection即上边获取连接数据库对象方法
     {
         var result = conn.Insert(ardo);
         return(Convert.ToInt32(result));
     }
 }
        /// <summary>
        /// 根据对象删除产品
        /// </summary>
        /// <param name="uo"></param>
        /// <returns></returns>
        public static int DeleteProductionBomByObject(AsmRecipeDetailObject pbo)
        {
            var result = 0;

            using (IDbConnection conn = ClsCommon.OpenConnection())
            {
                result = conn.Delete(pbo);
            }
            return(Convert.ToInt32(result));
        }
        /// <summary>
        /// 更新BOM详细信息
        /// </summary>
        /// <param name="po"></param>
        /// <returns></returns>
        public static int UpdateProductionBOM(AsmRecipeDetailObject pbo)
        {
            var result = 0;

            using (IDbConnection conn = ClsCommon.OpenConnection())  //这里访问的是Sqlite数据文件,这里OpenConnection即上边获取连接数据库对象方法
            {
                result = conn.Update(pbo);
            }
            return(Convert.ToInt32(result));
        }
Esempio n. 6
0
        public static List <AsmRecipeDetailObject> GetRecipesByProductionAndStation(string productionVr, string stationName)
        {
            List <AsmRecipeDetailObject> lar = new List <AsmRecipeDetailObject>();
            string    sql = "SELECT ARD.RECIPE_DATIL_ID,ARD.StepNo,ARD.Step_Category,ARD.Material_Name,ARD.Number,ARD.Gun_No,ARD.Program_No,ARD.Photo_No,ARD.Sleeve_No,ARD.ReworkTimes,ARD.Feacode,ARD.CheckOrNo,ARD.ReviewOrNo,ARD.ExactOrNo,ARD.MaterialPn,ARD.BoltEQS,ARD.A_Limit,ARD.T_Limit,ARD.RECIPE_ID  FROM dbo.C_ASM_RECIPE_DATIL_T ARD,dbo.C_ASM_PRODUCTION_RECIPE_T APR,dbo.C_ASM_PRODUCTION_T AP,dbo.C_ASM_RECIPE_T AR,dbo.C_ASM_STATION_T AST WHERE AP.PRODUCTION_ID=APR.PRODUCTION_ID AND AST.STATION_ID=APR.STATION_ID AND AR.RECIPE_ID=APR.RECIPE_ID AND AR.RECIPE_ID=ARD.RECIPE_ID AND AP.PRODUCTION_VR LIKE '%" + productionVr + "%' AND AST.STATION_NAME='" + stationName + "'";
            DataTable dt  = new DataTable();

            dt = ClsCommon.dbSql.ExecuteDataTable(sql);
            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    AsmRecipeDetailObject ardo = new AsmRecipeDetailObject();
                    ardo.RECIPE_DATIL_ID = Convert.ToInt32(dt.Rows[i]["RECIPE_DATIL_ID"].ToString());
                    ardo.StepNo          = dt.Rows[i]["StepNo"].ToString();
                    ardo.Step_Category   = dt.Rows[i]["Step_Category"].ToString();
                    ardo.Material_Name   = dt.Rows[i]["Material_Name"].ToString();
                    ardo.Number          = dt.Rows[i]["Number"].ToString();
                    ardo.Gun_No          = dt.Rows[i]["Gun_No"].ToString();
                    ardo.Program_No      = dt.Rows[i]["Program_No"].ToString();
                    ardo.Photo_No        = dt.Rows[i]["Photo_No"].ToString();
                    ardo.Sleeve_No       = dt.Rows[i]["Sleeve_No"].ToString();
                    ardo.ReworkTimes     = dt.Rows[i]["ReworkTimes"].ToString();
                    ardo.Feacode         = dt.Rows[i]["Feacode"].ToString();
                    ardo.CheckOrNo       = dt.Rows[i]["CheckOrNo"].ToString();
                    ardo.ReviewOrNo      = dt.Rows[i]["ReviewOrNo"].ToString();
                    ardo.ExactOrNo       = dt.Rows[i]["ExactOrNo"].ToString();
                    ardo.MaterialPn      = dt.Rows[i]["MaterialPn"].ToString();
                    ardo.BoltEQS         = dt.Rows[i]["BoltEQS"].ToString();
                    ardo.A_Limit         = dt.Rows[i]["A_Limit"].ToString();
                    ardo.T_Limit         = dt.Rows[i]["T_Limit"].ToString();
                    ardo.RECIPE_ID       = Convert.ToInt32(dt.Rows[i]["RECIPE_ID"].ToString());
                    lar.Add(ardo);
                }
            }
            return(lar);
        }
Esempio n. 7
0
        public static int DeleteProductionBomByObject(AsmRecipeDetailObject pbo)
        {
            int a = AsmRecipeDetail_DAL.DeleteProductionBomByObject(pbo);

            return(a);
        }
Esempio n. 8
0
        public static int UpdateProductionBOM(AsmRecipeDetailObject pbo)
        {
            int a = AsmRecipeDetail_DAL.UpdateProductionBOM(pbo);

            return(a);
        }
Esempio n. 9
0
        public static int AddRecipeDetail(AsmRecipeDetailObject ardo)
        {
            int a = AsmRecipeDetail_DAL.AddRecipeDetail(ardo);

            return(a);
        }
Esempio n. 10
0
 /// <summary>
 /// 保存
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void BT_S_Click(object sender, EventArgs e)
 {
     if (CheckInfo())
     {
         if (recipeDetailID == 0)
         {
             #region >>>>>新增
             AsmRecipeDetailObject ardo = new AsmRecipeDetailObject();
             ardo.StepNo        = UP_SN.Value.ToString();                //工序
             ardo.Step_Category = CB_CG.SelectedValue.ToString().Trim(); //类别
             ardo.Material_Name = TB_Name.Text.Trim();                   //名称
             ardo.Number        = TB_Number.Text.Trim();                 //数量
             ardo.Gun_No        = TB_Gn.Text.Trim();                     //枪号
             ardo.Program_No    = TB_PN.Text.Trim();                     //程序号
             ardo.Photo_No      = TB_PH.Text.Trim();                     //条码长度
             ardo.Sleeve_No     = TB_EQS.Text.Trim();                    //套筒号
             ardo.MaterialPn    = TB_VR.Text.Trim();                     //物料PN
             ardo.BoltEQS       = TB_SL.Text.Trim();                     //节拍
                                                                         // ardo.A_Limit = TB_AL.Text.Trim();//工序
             ardo.T_Limit   = TB_TL.Text.Trim();                         //上传代码
             ardo.RECIPE_ID = Convert.ToInt32(CB_R.SelectedValue);
             ardo.T_Limits  = TB_TLM.Text.Trim();
             ardo.T_Target  = TB_TT.Text.Trim();
             ardo.L_Program = TB_LP.Text.Trim();
             ardo.L_Rate    = TB_LR.Text.Trim();
             ardo.PICPath   = TB_PICP.Text.Trim();
             if (AsmRecipeDetail_BLL.AddRecipeDetail(ardo) > 0)
             {
                 MessageBox.Show("增加配方详细信息成功......");
                 UP_SN.Value        = UP_SN.Value + 1;
                 CB_CG.SelectedItem = null;
                 TB_Name.Text       = "";
                 TB_Number.Value    = 0;
                 TB_Gn.Value        = 0;
                 TB_PN.Value        = 0;
                 TB_PH.Text         = "";
                 TB_SL.Value        = 0;
                 TB_VR.Text         = "";
                 TB_EQS.Value       = 0;
                 // TB_AL.Text = "";
                 TB_TL.Text = "";
                 RecipeDetailRefresh();
             }
             #endregion
         }
         else
         {
             #region >>>>>更新
             AsmRecipeDetailObject ardo = new AsmRecipeDetailObject();
             ardo.RECIPE_DATIL_ID = recipeDetailID;
             ardo.StepNo          = UP_SN.Value.ToString();
             ardo.Step_Category   = CB_CG.SelectedValue.ToString().Trim();
             ardo.Material_Name   = TB_Name.Text.Trim();   //名称
             ardo.Number          = TB_Number.Text.Trim(); //数量
             ardo.Gun_No          = TB_Gn.Text.Trim();     //枪号
             ardo.Program_No      = TB_PN.Text.Trim();     //程序号
             ardo.Photo_No        = TB_PH.Text.Trim();     //条码长度
             ardo.Sleeve_No       = TB_EQS.Text.Trim();    //套筒号
             ardo.MaterialPn      = TB_VR.Text.Trim();     //物料PN
             ardo.BoltEQS         = TB_SL.Text.Trim();     //节拍
                                                           // ardo.A_Limit = TB_AL.Text.Trim();//工序
             ardo.T_Limit   = TB_TL.Text.Trim();           //上传代码
             ardo.RECIPE_ID = Convert.ToInt32(CB_R.SelectedValue);
             ardo.T_Limits  = TB_TLM.Text.Trim();
             ardo.T_Target  = TB_TT.Text.Trim();
             ardo.L_Program = TB_LP.Text.Trim();
             ardo.L_Rate    = TB_LR.Text.Trim();
             ardo.PICPath   = TB_PICP.Text.Trim();
             if (AsmRecipeDetail_BLL.UpdateProductionBOM(ardo) > 0)
             {
                 MessageBox.Show("增加配方详细信息成功......");
                 recipeDetailID     = 0;
                 UP_SN.Value        = 0;
                 CB_CG.SelectedItem = null;
                 TB_Name.Text       = "";
                 TB_Number.Value    = 0;
                 TB_Gn.Value        = 0;
                 TB_PN.Value        = 0;
                 TB_PH.Text         = "";
                 TB_SL.Value        = 0;
                 TB_EQS.Value       = 0;
                 TB_VR.Text         = "";
                 // TB_AL.Text = "";
                 TB_TL.Text = "";
                 RecipeDetailRefresh();
             }
             #endregion
         }
         BT_Z.Visible = true;
     }
     else
     {
         MessageBox.Show("输入信息不全......");
     }
 }