Example #1
0
        public IList<DefectCodeStationInfo> GetDefectList()
        {

            IList<DefectCodeStationInfo> defectList = new List<DefectCodeStationInfo>();
            try 
            {
                DefectCodeStationInfo cond = new DefectCodeStationInfo();
                //defectList = stationRep.GetDefectCodeStationList(cond);
                defectList = stationRep.GetDefectCodeStationList2(cond);

            }
            catch(FisException fe)
            {
                logger.Error(fe.Message);
                throw fe;
            }
            catch(Exception e)
            {
                logger.Error(e.Message);
                throw e;
            }
            return defectList;
        }
        //2012-8-1, Jessica Liu, 需求变更:增加Return Station 计算逻辑, 修改解DN条件
        /// <summary>
        /// GetReturnStation
        /// </summary>
        /// <param name="code"></param>
        /// <param name="preStn"></param>
        /// <param name="station"></param>
        /// <param name="cause"></param>
        /// <returns></returns>
        public IList<DefectCodeStationInfo> GetReturnStation(int id, string code, string preStn, string station, string cause)
        {
            var stationRepository = RepositoryFactory.GetInstance().GetRepository<IMES.FisObject.Common.Station.IStationRepository, IMES.FisObject.Common.Station.IStation>();
            var productRepository = RepositoryFactory.GetInstance().GetRepository<IProductRepository, IProduct>();

            DefectCodeStationInfo cond = new DefectCodeStationInfo();
            IList<DefectCodeStationInfo> info = null;
            cond.defect = code;
            cond.pre_stn = preStn;
            cond.crt_stn = station;
            cond.cause = cause;
            info = stationRepository.GetDefectCodeStationList(cond);
            if (info != null && info.Count > 0)
            {
                RepairInfo setValue = new RepairInfo();
                RepairInfo c1 = new RepairInfo();

                c1.Identity = id;
                setValue.returnStation = info[0].nxt_stn;

                productRepository.UpdateProductRepairDefectInfo(setValue, c1);
            }
            else
            {
                DefectCodeStationInfo cond1 = new DefectCodeStationInfo();
                IList<DefectCodeStationInfo> info1 = null;
                cond1.defect = code;
                cond1.pre_stn = preStn;
                cond.crt_stn = station;
                info1 = stationRepository.GetDefectCodeStationList(cond1);

                if (info1 != null && info1.Count > 0)
                {
                    RepairInfo setValue = new RepairInfo();
                    RepairInfo c1 = new RepairInfo();

                    c1.Identity = id;
                    setValue.returnStation = info[0].nxt_stn;

                    productRepository.UpdateProductRepairDefectInfo(setValue, c1);
                }
                else
                {
                    List<string> errpara = new List<string>();
                    FisException e = new FisException("CHK830", errpara);
                    throw e;
                }
            }

            return info;
        }
Example #3
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="code"></param>
        /// <param name="prodid"></param>
        /// <returns></returns>
        public IList<DefectCodeStationInfo> GetReturnStationForAdd(string code, string cause, string prodid)
        {
            var stationRepository = RepositoryFactory.GetInstance().GetRepository<IMES.FisObject.Common.Station.IStationRepository, IMES.FisObject.Common.Station.IStation>();
            var productRepository = RepositoryFactory.GetInstance().GetRepository<IProductRepository, IProduct>();
            IProduct currentProduct = null;
            IList<DefectCodeStationInfo> info = null;

            currentProduct = productRepository.Find(prodid);
            if (currentProduct != null)
            {
                if (!String.IsNullOrEmpty(cause))
                {
                    DefectCodeStationInfo cond = new DefectCodeStationInfo();
                    cond.defect = code;
                    cond.pre_stn = currentProduct.Status.StationId;
                    cond.crt_stn = "45";
                    cond.cause = cause;
                    info = stationRepository.GetDefectCodeStationList(cond);
                }
                else
                {
                    DefectCodeStationInfo cond1 = new DefectCodeStationInfo();
                    cond1.defect = code;
                    cond1.pre_stn = currentProduct.Status.StationId;
                    cond1.crt_stn = "45";
                    DefectCodeStationInfo cond2 = new DefectCodeStationInfo();
                    cond2.cause = "";

                    info = stationRepository.GetDefectCodeStationList(cond1, cond2);
                }
            }

            return info;
        }
Example #4
0
 public IList<DefectCodeStationInfo> GetDefectStationByPreStation(string preStation)
 {
     try
     {
         DefectCodeStationInfo pre_stn = new DefectCodeStationInfo();
         pre_stn.pre_stn = preStation;
         return stationRep.GetDefectCodeStationList2(pre_stn);
     }
     catch (FisException fe)
     {
         logger.Error(fe.Message);
         throw fe;
     }
     catch (Exception e)
     {
         logger.Error(e.Message);
         throw e;
     }
 }
Example #5
0
 public void UpdateDefectStation(DefectCodeStationInfo stationItem)
 {
     try 
     {
         //if (stationRep.CheckDefectStationUnique(stationItem.pre_stn, stationItem.crt_stn, stationItem.majorPart, stationItem.cause, stationItem.defect))
         //{
         //    List<string> erpara = new List<string>();
         //    FisException ex;
         //    ex = new FisException("DMT150", erpara);
         //    throw ex;
         //}  
         DefectCodeStationInfo conItem = new DefectCodeStationInfo();
         conItem.id = stationItem.id;
         stationItem.id = int.MinValue;
         stationItem.udt = DateTime.Now;
         stationRep.UpdateDefectCodeStationInfo(stationItem,conItem);    
     }
     catch(Exception e)
     {
         logger.Error(e.Message);
         throw e;
     }
 }
Example #6
0
 public void DeleteDefectStation(int id)
 {
     try 
     {
         DefectCodeStationInfo conItem = new DefectCodeStationInfo();
         conItem.id = id;
         stationRep.DeleteDefectCodeStationInfo(conItem);
     }
     catch(Exception e)
     {
         logger.Error(e.Message);
         throw e;
     }
 }
Example #7
0
 public string AddDefectStation(DefectCodeStationInfo stationItem)
 {
     try 
     {
         if (stationRep.CheckDefectStationUnique(stationItem.pre_stn, stationItem.crt_stn, stationItem.majorPart, stationItem.cause, stationItem.defect,stationItem.family))
         {
             List<string> erpara = new List<string>();
             FisException ex;
             ex = new FisException("DMT150", erpara);
             throw ex;
         }    
         DefectCodeStationInfo newitem = new DefectCodeStationInfo();
         stationItem.cdt = DateTime.Now;
         stationItem.udt = DateTime.Now;
         stationRep.InsertDefectCodeStationInfo(stationItem);
         return Convert.ToString(stationItem.id);
     }
     catch(Exception e)
     {
         logger.Error(e.Message);
         throw e;
     }
 }
Example #8
0
    protected void btnSave_ServerClick(object sender, EventArgs e)
    {
        string itemId = this.HiddenSelectedId.Value.Trim();
        string familyAndModel = this.txtFamilyAndModel.Text.ToUpper().Trim();
        DefectCodeStationInfo newDefect = new DefectCodeStationInfo();
        newDefect.pre_stn = this.ddlPreWC.InnerDropDownList.SelectedValue.Trim();
        newDefect.crt_stn = this.ddlCurWC.InnerDropDownList.SelectedValue.Trim();
        newDefect.nxt_stn = this.ddlNextWC.InnerDropDownList.SelectedValue.Trim();
        newDefect.defect = this.ddlDefect.InnerDropDownList.SelectedValue.Trim();
        newDefect.cause = this.ddlCause.InnerDropDownList.SelectedValue.Trim();
        newDefect.family = familyAndModel;
        newDefect.majorPart = this.hidMajorPart.Value.Trim();
        newDefect.editor = Master.userInfo.UserId;

        newDefect.id = Convert.ToInt32(itemId);
        
        try
        {
            if (!string.IsNullOrEmpty(familyAndModel))
            {
                bool check = iDefectStation.CheckFamily(familyAndModel);
                if (check == false)
                {
                    throw new FisException("此Family/Model不存在");
                }
            }
            iDefectStation.UpdateDefectStation(newDefect);
            initPreWCTopSelect();
            showDefectList();
        }
        catch(FisException fe)
        {
            showErrorMessage(fe.mErrmsg);
            return;
        }
        catch(Exception ee)
        {
            showErrorMessage(ee.Message);
            return;
        }
        finally
        {
            hideWait();
            this.updatePanel2.Update();
            AddUpdateComplete(itemId);
        }
        
        
        //ScriptManager.RegisterStartupScript(this.updatePanel2, typeof(System.Object), "saveUpdate", "AddUpdateComplete('" + itemId + "');HideWait();", true);

    }
Example #9
0
    protected void btnAdd_ServerClick(object sender,EventArgs e)
    {
        string familyAndModel = this.txtFamilyAndModel.Text.ToUpper().Trim();
        DefectCodeStationInfo defect = new DefectCodeStationInfo();
        defect.pre_stn = this.ddlPreWC.InnerDropDownList.SelectedValue;
        defect.crt_stn =  this.ddlCurWC.InnerDropDownList.SelectedValue;
        defect.nxt_stn = this.ddlNextWC.InnerDropDownList.SelectedValue;
        defect.defect = this.ddlDefect.InnerDropDownList.SelectedValue;
        defect.cause = this.ddlCause.InnerDropDownList.SelectedValue;
        defect.family = familyAndModel;
        defect.editor = Master.userInfo.UserId;
        defect.majorPart = this.hidMajorPart.Value.Trim();
        string itemId="";
        try 
        {
            if (!string.IsNullOrEmpty(familyAndModel))
            {
                bool check = iDefectStation.CheckFamily(familyAndModel);
                if (check == false)
                {
                    throw new FisException("此Family/Model不存在");
                }
            }
            //if(!iDefectStation.CheckDefectStationUnique(defect.pre_stn,defect.crt_stn,defect.majorPart,defect.cause,defect.defect))
            //{
            //    throw new Exception("");
            //}
            itemId = iDefectStation.AddDefectStation(defect);
            initPreWCTopSelect();
            showDefectList();
            itemId = replaceSpecialChart(itemId);

        }
        catch(FisException fex)
        {
            showErrorMessage(fex.mErrmsg);
            return;
        }
        catch(Exception ex)
        {
            showErrorMessage(ex.Message);
            return;
        }
        finally
        {
            hideWait();
            this.updatePanel2.Update();
            AddUpdateComplete(itemId);
        }
        
        
        //ScriptManager.RegisterStartupScript(this.updatePanel2, typeof(System.Object), "saveUpdate", "AddUpdateComplete('" + itemId + "');", true);
    }