Esempio n. 1
0
    protected void Save_ServerClick(Object sender, EventArgs e)
    {
        try
        {
            IList<PartForbidRuleInfo> PartForbidRuleList = null;
            string customer = this.cmbCustomer.SelectedValue.ToString();
            string category = this.cmbCategory.SelectedValue.ToString();
            string line = "";// this.cmbLine.SelectedValue.ToString();
            if (this.cmbLine.SelectedValue != "")
            {
                line = this.cmbLine.SelectedValue;
            }
            else if (this.hidLine.Value != "")
            {
                line = this.hidLine.Value;
            }
            string family = this.txtFamily.Value.ToString().Trim();
            string exceptMode = this.txtExceptModel.Value.ToString().Trim();
            string bomnodetype = this.txtBomNodeType.Value.ToString().Trim();
            string vendorcode = this.txtVendorCode.Value.ToString().Trim();
            string partno = this.txtPartNo.Value.ToString().Trim();
            string noticemsg = this.txtNoticeMsg.Value.ToString().Trim();
            string remark = this.txtRemark.Value.ToString().Trim();
            string id = this.hidDeleteID.Value;
            if (string.IsNullOrEmpty(bomnodetype))
            {
                throw new FisException("Please Input BomNodeType...");
            }
            PartForbidRuleInfo PartForbidInfo = new PartForbidRuleInfo();
            PartForbidInfo.Customer = customer;
            PartForbidInfo.Category = category;
            PartForbidInfo.Line = line;
            PartForbidInfo.Family = family;
            PartForbidInfo.ExceptModel = exceptMode;
            PartForbidInfo.BomNodeType = bomnodetype;
            PartForbidInfo.VendorCode = vendorcode;
            PartForbidInfo.PartNo = partno;
            PartForbidInfo.NoticeMsg = noticemsg;
            PartForbidInfo.Status = "Enable";
            PartForbidInfo.Remark = remark;
            PartForbidInfo.Editor = UserId;
            PartForbidInfo.Cdt = DateTime.Now;
            PartForbidInfo.Udt = DateTime.Now;

            if (!string.IsNullOrEmpty(id))
            {
                PartForbidInfo.ID = int.Parse(id);
                iPartForbidRule.UpdatePartForbidRule(PartForbidInfo);
            }
            else
            {
                iPartForbidRule.InsertPartForbidRule(PartForbidInfo);
            }
            PartForbidRuleList = iPartForbidRule.GetPartForbidRule(new PartForbidRuleInfo { Customer = customer });
            long ID = PartForbidRuleList[0].ID;
            bindTable(PartForbidRuleList, DEFAULT_ROWS);
            ScriptManager.RegisterStartupScript(this.updatePanel, typeof(System.Object), "saveUpdate", "resetTableHeight();AddUpdateComplete('" + ID + "');", true);//
        }
        catch (FisException ex)
        {
            showErrorMessage(ex.mErrmsg);
        }
        catch (Exception ex)
        {
            showErrorMessage(ex.Message);
            bindTable(null, DEFAULT_ROWS);
        }
        finally
        {
            hideWait();
        }
    }
Esempio n. 2
0
        public void UpdatePartForbidRule(PartForbidRuleInfo item)
        {
            logger.Debug("(PartForbidRule)UpdateDefectHoldRule starts");
            try
            {
				PartForbidRuleInfo checkInfo = new PartForbidRuleInfo();
                checkInfo.Customer = item.Customer;
                checkInfo.Category = item.Category;
                checkInfo.Line = item.Line;
                checkInfo.Family = item.Family;
                checkInfo.ExceptModel = item.ExceptModel;
                checkInfo.BomNodeType = item.BomNodeType;
                checkInfo.VendorCode = item.VendorCode;
                checkInfo.PartNo = item.PartNo;
                IList<PartForbidRuleInfo> checkInfoList = iPartRepository.GetPartForbid(checkInfo);

                if (checkInfoList != null && checkInfoList.Count != 0)
                {
                    throw new FisException("Input Data is exist");
                }
                else
                {
                    //iPartRepository.AddPartForbid(item);
                    iPartRepository.UpdatePartForbid(item);
                }
                
            }
            catch (FisException e)
            {
                logger.Error(e.mErrmsg, e);
                throw new Exception(e.mErrmsg);
            }
            catch (Exception e)
            {
                logger.Error(e.Message, e);
                throw new SystemException(e.Message);
            }
            finally
            {
                logger.Debug("(PartForbidRule)UpdateDefectHoldRule end");
            }
        }
Esempio n. 3
0
 protected void Query_ServerClick(Object sender, EventArgs e)
 {
     try
     {
         string customer = this.cmbCustomerTop.SelectedValue.ToString().Trim();
         string category = this.cmbCategoryTop.SelectedValue.ToString().Trim();
         string line = this.txtLineTop.Value.ToString().Trim();
         string family = this.txtFamilyTop.Value.ToString().Trim();
         PartForbidRuleInfo condition = new PartForbidRuleInfo();
         if (customer != "")
         {
             condition.Customer = customer; 
         }
         if (category != "")
         {
             condition.Category = category;
         }
         if (line != "")
         {
             condition.Line = line;
         }
         if (family != "")
         {
             condition.Family = family;
         }
         IList<PartForbidRuleInfo> PartForbidRuleList = iPartForbidRule.GetPartForbidRule(condition);
         bindTable(PartForbidRuleList, DEFAULT_ROWS);
     }
     catch (FisException ex)
     {
         showErrorMessage(ex.mErrmsg);
         bindTable(null, DEFAULT_ROWS);
     }
     catch (Exception ex)
     {
         showErrorMessage(ex.Message);
         bindTable(null, DEFAULT_ROWS);
     }
     finally
     {
         hideWait();
     }
 }
Esempio n. 4
0
 public IList<PartForbidRuleInfo> GetPartForbidRule(PartForbidRuleInfo condition)
 {
     logger.Debug("(PartForbidRule)GetPartForbidRule starts");
     try
     {
         return iPartRepository.GetPartForbid(condition);
     }
     catch (FisException e)
     {
         logger.Error(e.mErrmsg, e);
         throw new Exception(e.mErrmsg);
     }
     catch (Exception e)
     {
         logger.Error(e.Message, e);
         throw new SystemException(e.Message);
     }
     finally
     {
         logger.Debug("(PartForbidRule)GetPartForbidRule end");
     }
 }