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> /// 条件查询配方 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonX1_Click(object sender, EventArgs e) { if (!String.IsNullOrEmpty(CB_Production.SelectedItem.ToString()) && !String.IsNullOrEmpty(CB_Station.SelectedItem.ToString())) { recipeDetailDt = null; recipeDetailDt = AsmRecipeDetail_BLL.GetRecipeDetailByStationAndProduction(CB_Station.SelectedValue.ToString(), CB_Production.SelectedValue.ToString()); DGV_RD.DataSource = recipeDetailDt; } }
public void RecipeDetailRefresh() { recipeDetailDt = null; if (CB_R.SelectedValue != null) { recipeDetailDt = AsmRecipeDetail_BLL.GetAllRecipeDetailByCondition(CB_R.SelectedValue?.ToString()); } DGV_RD.DataSource = recipeDetailDt; }
private void BT_D_Click(object sender, EventArgs e) { if (MessageBox.Show("删除后不可恢复,确定删除?", "删除提示", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { if (recipeDetailID != 0) { if (AsmRecipeDetail_BLL.DeleteRecieDetailByCondition(" RECIPE_DATIL_ID=" + recipeDetailID) > 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 = ""; BT_Z.Visible = true; RecipeDetailRefresh(); } } else { MessageBox.Show("所选对象不能为空!"); } } else { MessageBox.Show("删除失败,请重试......"); } }
/// <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("输入信息不全......"); } }