Пример #1
0
 /// <summary>
 /// 工位属性配置
 /// </summary>
 /// <param name="sql"></param>
 public void StationConfigure(string sql)
 {
     try
     {
         string           str_station = "";
         AsmStationObject aso         = AsmStation_BLL.GetStationByCondition(sql);
         if (aso != null)
         {
             str_station += "站名:          " + aso.STATION_NAME + "\n\n";
             str_station += "站类型:        " + aso.STATION_TYPE + "\n\n";
             str_station += "是否需要配方:  " + ((aso.STATION_RECIPEORNOT == "1") ? true : false) + "\n\n";
             str_station += "是否配备AGV:   " + ((aso.STATION_AGVORNOT == "1") ? true : false) + "\n\n";
             str_station += "是否点亮放行灯:" + ((aso.STATION_LIGHTORNOT == "1") ? true : false) + "\n\n";
             str_station += "是否配置打印机:" + ((aso.STATION_PRINTORNOT == "1") ? true : false) + "\n\n";
             str_station += "是否末站:      " + ((aso.STATION_ENDORNOT == "1") ? true : false) + "\n\n";
             str_station += "是否配备拧紧枪:" + ((aso.STATION_GUNORNOT == "1") ? true : false) + "\n\n";
             str_station += "工位节拍:      " + aso.STATION_TIME + "\n\n";
         }
         rTB_stationproperty.AppendText(str_station);
     }
     catch (Exception e)
     {
     }
 }
Пример #2
0
        /// <summary>
        /// 存储数据
        /// </summary>
        public void StoreData()
        {
            try
            {
                List <Item> list_item                   = addFlow.Items;
                DataTable   dt                          = AsmStation_BLL.GetAllStation();
                AsmProductionWayRecordObject apwo       = null;
                AsmProductionWayRecordObject apwo_right = null;
                List <string> list                      = new List <string>();
                bool          judge                     = false;
                bool          judge_right               = false;
                int           j                         = 1;

                List <Item> list_link = new List <Item>();
                for (int i = 0; i < list_item.Count; i++)
                {
                    if (list_item[i].GetType().ToString().Contains("Link"))
                    {
                        list_link.Add(list_item[i]);
                    }
                }

                for (int i = 0; i < list_link.Count; i++)
                {
                    string str_left  = (list_link[i] as Link).Org.Text;
                    string str_right = (list_link[i] as Link).Dst.Text;


                    if (list.Count > 0)
                    {
                        for (int m = 0; m < list.Count; m++)
                        {
                            if (str_left.Equals(list[m]))
                            {
                                judge = false;
                            }
                            else
                            {
                                judge = true;
                            }
                        }
                    }
                    else
                    {
                        judge = true;
                    }

                    if (judge)
                    {
                        apwo         = new AsmProductionWayRecordObject();
                        apwo.ST_NAME = str_left;
                        AsmProductionObject apo = AsmProduction_BLL.GetAsmProductionByCondition("PRODUCTION_NAME='" + cB_product_name.SelectedItem.ToString() + "'");
                        if (apo != null)
                        {
                            apwo.PRODUCTION_NAME = apo.PRODUCTION_NAME;
                            apwo.PRODUCTION_ID   = apo.PRODUCTION_ID;
                        }
                        AsmStationObject aso = AsmStation_BLL.GetStationByCondition("STATION_NAME='" + apwo.ST_NAME + "'");
                        if (aso != null)
                        {
                            apwo.ST_ID = aso.STATION_ID;
                        }
                        apwo.DT        = System.DateTime.Now;
                        apwo.SERIAL_NO = j++;
                        AsmproductionWayRecord_BLL.AddRecord(apwo);
                    }

                    if (list.Count > 0)
                    {
                        for (int m = 0; m < list.Count; m++)
                        {
                            if (str_right.Equals(list[m]))
                            {
                                judge_right = false;
                            }
                            else
                            {
                                judge_right = true;
                            }
                        }
                    }
                    else
                    {
                        judge_right = true;
                    }
                    if (judge_right)
                    {
                        apwo_right         = new AsmProductionWayRecordObject();
                        apwo_right.ST_NAME = str_right;
                        AsmProductionObject apoX = AsmProduction_BLL.GetAsmProductionByCondition("PRODUCTION_NAME='" + cB_product_name.SelectedItem.ToString() + "'");
                        apwo_right.PRODUCTION_NAME = apoX.PRODUCTION_NAME;
                        apwo_right.PRODUCTION_ID   = apoX.PRODUCTION_ID;
                        AsmStationObject asoX = AsmStation_BLL.GetStationByCondition("STATION_NAME='" + apwo_right.ST_NAME + "'");
                        apwo_right.ST_ID     = asoX.STATION_ID;
                        apwo_right.DT        = System.DateTime.Now;
                        apwo_right.SERIAL_NO = j++;
                        AsmproductionWayRecord_BLL.AddRecord(apwo_right);
                    }
                }

                DataTable dt_way = AsmProductionWay_BLL.GetWayByCondition("PRODUCTION_NAME= '" + cB_product_name.SelectedItem.ToString().Trim() + "'");
                if (!(dt_way.Rows.Count > 0))
                {
                    DataTable dt_record          = AsmproductionWayRecord_BLL.GetAllRecordByCondition(cB_product_name.SelectedItem.ToString().Trim());
                    AsmProductionWayObject apwro = null;
                    for (int i = 0; i < dt_record.Rows.Count; i++)
                    {
                        apwro                 = new AsmProductionWayObject();
                        apwro.ST_NAME         = dt_record.Rows[i]["ST_NAME"].ToString();
                        apwro.DT              = Convert.ToDateTime(dt_record.Rows[i]["DT"].ToString());
                        apwro.PRODUCTION_NAME = dt_record.Rows[i]["PRODUCTION_NAME"].ToString();
                        apwro.PRODUCTION_ID   = Convert.ToInt32(dt_record.Rows[i]["PRODUCTION_ID"].ToString());
                        apwro.ST_NAME         = dt_record.Rows[i]["ST_NAME"].ToString();
                        apwro.ST_ID           = Convert.ToInt32(dt_record.Rows[i]["ST_ID"].ToString());
                        apwro.SERIAL_NO       = i + 1;
                        AsmProductionWay_BLL.AddRoutingRecord(apwro);
                    }
                }
                else
                {
                    AsmProductionWay_BLL.DeleteAllByCondition("PRODUCTION_NAME= '" + cB_product_name.SelectedItem.ToString().Trim() + "'");
                    DataTable dt_record          = AsmproductionWayRecord_BLL.GetAllRecordByCondition(cB_product_name.SelectedItem.ToString().Trim());
                    AsmProductionWayObject apwro = null;
                    for (int i = 0; i < dt_record.Rows.Count; i++)
                    {
                        apwro    = new AsmProductionWayObject();
                        apwro.DT = Convert.ToDateTime(dt_record.Rows[i]["DT"]);
                        apwro.PRODUCTION_NAME = dt_record.Rows[i]["PRODUCTION_NAME"].ToString();
                        apwro.PRODUCTION_ID   = Convert.ToInt32(dt_record.Rows[i]["PRODUCTION_ID"].ToString());
                        apwro.ST_NAME         = dt_record.Rows[i]["ST_NAME"].ToString();
                        apwro.ST_ID           = Convert.ToInt32(dt_record.Rows[i]["ST_ID"].ToString());
                        apwro.SERIAL_NO       = i + 1;
                        AsmProductionWay_BLL.AddRoutingRecord(apwro);
                    }
                }
            }
            catch (Exception)
            {
            }
        }
Пример #3
0
 public void Refish()
 {
     aso = AsmStation_BLL.GetStationByCondition(" STATION_NAME='" + StationName + "';");
 }