Exemple #1
0
        public PDM_ALL_PRODUCT GetById(String p_id)
        {
            PDM_ALL_PRODUCT t_product = new PDM_ALL_PRODUCT();
            string          sqlText   = "select *  from  PDM_ALL_PRODUCT where PRODUCTID = '" + p_id + "'";

            System.Data.DataTable dt = this.DataAccessor.QueryDataTable(sqlText);
            if (dt.Rows.Count > 0)
            {
                t_product.PRODUCTID    = dt.Rows[0]["PRODUCTID"].ToString();
                t_product.PRODUCTNO    = dt.Rows[0]["PRODUCTNO"].ToString();
                t_product.MODELTYPE    = dt.Rows[0]["MODELTYPE"].ToString();
                t_product.PRODUCTTYPE  = dt.Rows[0]["PRODUCTTYPE"].ToString();
                t_product.PRODUCTLEVEL = Convert.ToInt16(dt.Rows[0]["PRODUCTLEVEL"].ToString());
                t_product.VERSION      = dt.Rows[0]["VERSION"].ToString();
                t_product.STATUS       = dt.Rows[0]["STATUS"].ToString();
                t_product.CREATER      = dt.Rows[0]["CREATER"].ToString();
                t_product.MODIFIER     = dt.Rows[0]["MODIFIER"].ToString();
                t_product.CREATETIME   = dt.Rows[0]["CREATETIME"].ToString();
                t_product.MODIFYTIME   = dt.Rows[0]["MODIFYTIME"].ToString();
                t_product.MEMO_ZH      = dt.Rows[0]["MEMO_ZH"].ToString();
                t_product.MEMO_EN      = dt.Rows[0]["MEMO_EN"].ToString();
                t_product.MEMO         = dt.Rows[0]["MEMO"].ToString();
            }
            return(t_product);
        }
 private void bt_Query_Click(object sender, EventArgs e)
 {
     if (s_type == selectType.Matieral) {
         this.p_materail = new PDM_MATERAIL();
         p_materail.MATERIALNO = this.tb_No.Text;
         p_materail.MODELTYPE = this.tb_Model.Text;
         p_materail.VERSION = this.tb_Version.Text;
         p_materail.MEMO = this.tb_Memo.Text;
     }
     else if (s_type == selectType.Parts)
     {
         this.p_parts = new PDM_ALL_PRODUCT();
         p_parts.PRODUCTNO = this.tb_No.Text;
         p_parts.MODELTYPE = this.tb_Model.Text;
         p_parts.VERSION = this.tb_Version.Text;
         p_parts.MEMO = this.tb_Memo.Text;
     }
     else if (s_type == selectType.Product)
     {
         this.p_products = new PDM_ALL_PRODUCT();
         p_products.PRODUCTNO = this.tb_No.Text;
         p_products.MODELTYPE = this.tb_Model.Text;
         p_products.VERSION = this.tb_Version.Text;
         p_products.MEMO = this.tb_Memo.Text;
     }
     this.DialogResult = DialogResult.OK;
 }
 private void query_Product_Click(object sender, EventArgs e)
 {
     /*Condition condition = PDM_ALL_PRODUCT.Create().CreateCondition();
     if (!string.IsNullOrEmpty(no_Product.Text))
     {
         condition.AddElement("PRODUCTNO", no_Product.Text, ElementType.Match);
     }
     if (!string.IsNullOrEmpty(version_Product.Text))
     {
         condition.AddElement("VERSION", version_Product.Text);
     }
     if (!string.IsNullOrEmpty(type_Product.Text))
     {
         condition.AddElement("PRODUCTTYPE", type_Product.Text);
     }
     if (!string.IsNullOrEmpty(status_Product.Text))
     {
         condition.AddElement("STATUS", status_Product.Text);
     }
     if (!string.IsNullOrEmpty(mperson_Product.Text))
     {
         condition.AddElement("MODIFIER", mperson_Product.Text, ElementType.Match);
     }
     if (!string.IsNullOrEmpty(modifyDate_Product.Text))
     {
         condition.AddElement("MODIFYTIME", modifyDate_Product.Text);
     }
     condition.AddElement("PRODUCTLEVEL", 1);
       */
     PDM_ALL_PRODUCT t_product = new PDM_ALL_PRODUCT();
     t_product.PRODUCTNO = no_Product.Text;
     t_product.VERSION = version_Product.Text;
     m_productList = m_productService.GetProductList(t_product);
     this.DialogResult = DialogResult.OK;
 }
Exemple #4
0
 private void bt_Query_Click(object sender, EventArgs e)
 {
     if (s_type == selectType.Matieral)
     {
         this.p_materail       = new PDM_MATERAIL();
         p_materail.MATERIALNO = this.tb_No.Text;
         p_materail.MODELTYPE  = this.tb_Model.Text;
         p_materail.VERSION    = this.tb_Version.Text;
         p_materail.MEMO       = this.tb_Memo.Text;
     }
     else if (s_type == selectType.Parts)
     {
         this.p_parts      = new PDM_ALL_PRODUCT();
         p_parts.PRODUCTNO = this.tb_No.Text;
         p_parts.MODELTYPE = this.tb_Model.Text;
         p_parts.VERSION   = this.tb_Version.Text;
         p_parts.MEMO      = this.tb_Memo.Text;
     }
     else if (s_type == selectType.Product)
     {
         this.p_products      = new PDM_ALL_PRODUCT();
         p_products.PRODUCTNO = this.tb_No.Text;
         p_products.MODELTYPE = this.tb_Model.Text;
         p_products.VERSION   = this.tb_Version.Text;
         p_products.MEMO      = this.tb_Memo.Text;
     }
     this.DialogResult = DialogResult.OK;
 }
Exemple #5
0
 public DocAddForm(String p_ProductId)
 {
     InitializeComponent();
     m_AllPartsService = EAS.Services.ServiceContainer.GetService<IAllPartsService>();
     m_Product = m_AllPartsService.GetById(p_ProductId);
     this.tsb_type.SelectedIndex = 0;
     DocList_Init();
 }
Exemple #6
0
        private void CopyStrut(PDM_ALL_PRODUCT p_OldProduct, PDM_ALL_PRODUCT p_NewProduct)
        {
            string sqlText = " INSERT INTO PDM_STRUCT(OBJECTID, ASSOBJECTID, ASSONUM, ASSOWEIGHT, SORTNUM, MEMO,DEL_FLAG) "
                             + " SELECT '" + p_NewProduct.PRODUCTID + "', "
                             + " ASSOBJECTID, ASSONUM, ASSOWEIGHT, SORTNUM, MEMO,DEL_FLAG  "
                             + " FROM PDM_STRUCT  "
                             + " WHERE  DEL_FLAG='N'  "
                             + " AND    OBJECTID='" + p_OldProduct.PRODUCTID + "'  ";

            this.DataAccessor.Execute(sqlText);
        }
Exemple #7
0
 /// <summary>
 /// 根据半成品对象更新记录
 /// </summary>
 /// <param name="c"></param>
 public void UpdateByID(PDM_ALL_PRODUCT c)
 {
     string sqlText = "update  PDM_ALL_PRODUCT SET  PRODUCTNO ='" + c.PRODUCTNO + "',"
                      + "MODELTYPE ='" + c.MODELTYPE + "',"
                      + "PRODUCTTYPE ='" + c.PRODUCTTYPE + "',"
                      + "MEMO_ZH ='" + c.MEMO_ZH + "',"
                      + "MEMO_EN ='" + c.MEMO_EN + "',"
                      + "MEMO ='" + c.MEMO + "',"
                      + "MODIFYTIME ='" + c.MODIFYTIME + "',"
                      + "MODIFIER ='" + c.MODIFIER + "'  "
                      + "where PRODUCTID = '" + c.PRODUCTID + "'";
     int temp = this.DataAccessor.Execute(sqlText);
 }
Exemple #8
0
        private void CopyDoc(PDM_ALL_PRODUCT p_OldProduct, PDM_ALL_PRODUCT p_NewProduct)
        {
            string sqlText = " INSERT INTO ObjectRelation(ORID, MASTEROBJECTID, MASTEROBJECTTYPE, MASTEROBJECTVERSION, RELATIONOBJECTID, RELATIONOBJECTTYPE, RELATIONOBJECTVERSION,OPT1, OPT2, DEL_FALG)  "
                             + " SELECT  NEWID(), MASTEROBJECTID, MASTEROBJECTTYPE, MASTEROBJECTVERSION, '" + p_NewProduct.PRODUCTID + "', "
                             + "  RELATIONOBJECTTYPE, '" + p_NewProduct.VERSION + "',"
                             + "  OPT1, OPT2, DEL_FALG  "
                             + " FROM  ObjectRelation "
                             + " WHERE DEL_FALG ='N' "
                             + " and RELATIONOBJECTID ='" + p_OldProduct.PRODUCTID + "' "
                             + " and  RELATIONOBJECTVERSION='" + p_OldProduct.VERSION + "' ";

            this.DataAccessor.Execute(sqlText);
        }
        private void query_Product_Click(object sender, EventArgs e)
        {
            PDM_ALL_PRODUCT t_product = new PDM_ALL_PRODUCT();
            t_product.PRODUCTNO = no_Product.Text;
            t_product.VERSION = version_Product.Text;
            t_product.PRODUCTTYPE = type_Product.Text;
            t_product.STATUS = status_Product.Text;

            t_product.MODIFIER = mperson_Product.Text;
            t_product.CREATETIME = createDate_Product.Text;
            t_product.MODIFYTIME = modifyDate_Product.Text;
            t_product.MODELTYPE = model_Product.Text;
            m_productList = m_productService.GetProductList(t_product,this.AdvanceQueryString);
            this.DialogResult = DialogResult.OK;
        }
        /// <summary>
        /// 初始化
        /// </summary>
        private void  common_Init(string p_firstId, string p_secondId)
        {
            m_StructService     = EAS.Services.ServiceContainer.GetService <IStructService>();
            m_AllProductService = EAS.Services.ServiceContainer.GetService <IAllProductService>();
            m_firstObj          = m_AllProductService.GetById(p_firstId);
            m_secondObj         = m_AllProductService.GetById(p_secondId);

            this.tb_firstNo.Text      = m_firstObj.PRODUCTNO;
            this.tb_firstMemo.Text    = m_firstObj.MEMO_ZH;
            this.tb_firstVersion.Text = m_firstObj.VERSION;

            this.tb_secondNo.Text      = m_secondObj.PRODUCTNO;
            this.tb_secondMemo.Text    = m_secondObj.MEMO_ZH;
            this.tb_secondVersion.Text = m_secondObj.VERSION;
        }
Exemple #11
0
        /// <summary>
        /// 更加对象查询半成品记录
        /// </summary>
        /// <param name="c"></param>
        /// <returns></returns>
        public DataTable GetProductList(PDM_ALL_PRODUCT c)
        {
            string sqlText = "Select * from  PDM_ALL_PRODUCT WHERE PRODUCTLEVEL=2  AND DEL_FLAG = 'N'  ";

            if (!string.IsNullOrEmpty(c.PRODUCTNO))
            {
                sqlText += " AND PRODUCTNO LIKE '%" + c.PRODUCTNO + "%' ";
            }
            if (!string.IsNullOrEmpty(c.VERSION))
            {
                sqlText += " AND VERSION LIKE '%" + c.VERSION + "%' ";
            }
            System.Data.DataTable dt = this.DataAccessor.QueryDataTable(sqlText);
            return(dt);
        }
Exemple #12
0
        private void query_Product_Click(object sender, EventArgs e)
        {
            PDM_ALL_PRODUCT t_product = new PDM_ALL_PRODUCT();

            t_product.PRODUCTNO   = no_Product.Text;
            t_product.VERSION     = version_Product.Text;
            t_product.PRODUCTTYPE = type_Product.Text;
            t_product.STATUS      = status_Product.Text;

            t_product.MODIFIER   = mperson_Product.Text;
            t_product.CREATETIME = createDate_Product.Text;
            t_product.MODIFYTIME = modifyDate_Product.Text;
            t_product.MODELTYPE  = model_Product.Text;
            m_productList        = m_productService.GetProductList(t_product, this.AdvanceQueryString);
            this.DialogResult    = DialogResult.OK;
        }
Exemple #13
0
        private void query_Product_Click(object sender, EventArgs e)
        {
            Condition condition = PDM_ALL_PRODUCT.Create().CreateCondition();


            if (!string.IsNullOrEmpty(no_Product.Text))
            {
                condition.AddElement("PRODUCTNO", no_Product.Text, ElementType.Match);
            }
            if (!string.IsNullOrEmpty(version_Product.Text))
            {
                condition.AddElement("VERSION", version_Product.Text);
            }
            if (!string.IsNullOrEmpty(type_Product.Text))
            {
                condition.AddElement("PRODUCTTYPE", type_Product.Text);
            }
            if (!string.IsNullOrEmpty(status_Product.Text))
            {
                condition.AddElement("STATUS", status_Product.Text);
            }
            if (!string.IsNullOrEmpty(mperson_Product.Text))
            {
                condition.AddElement("MODIFIER", mperson_Product.Text, ElementType.Match);
            }
            if (!string.IsNullOrEmpty(createDate_Product.Text))
            {
                condition.AddElement("MODIFYTIME", createDate_Product.Text);
            }
            condition.AddElement("PRODUCTLEVEL", 2);

            PDM_ALL_PRODUCT t_product = new PDM_ALL_PRODUCT();

            t_product.PRODUCTNO   = no_Product.Text;
            t_product.VERSION     = version_Product.Text;
            t_product.PRODUCTTYPE = type_Product.Text;
            t_product.STATUS      = status_Product.Text;

            t_product.MODIFIER   = mperson_Product.Text;
            t_product.CREATETIME = createDate_Product.Text;
            t_product.MODIFYTIME = modifyDate_Product.Text;
            t_product.MODELTYPE  = model_Product.Text;

            m_partsList       = m_partsService.GetProductList(t_product, this.AdvanceQueryString);
            this.DialogResult = DialogResult.OK;
        }
        private void query_Product_Click(object sender, EventArgs e)
        {
            Condition condition = PDM_ALL_PRODUCT.Create().CreateCondition();

            if (!string.IsNullOrEmpty(no_Product.Text))
            {

                condition.AddElement("PRODUCTNO", no_Product.Text, ElementType.Match);
            }
            if (!string.IsNullOrEmpty(version_Product.Text))
            {
                condition.AddElement("VERSION", version_Product.Text);
            }
            if (!string.IsNullOrEmpty(type_Product.Text))
            {
                condition.AddElement("PRODUCTTYPE", type_Product.Text);
            }
            if (!string.IsNullOrEmpty(status_Product.Text))
            {
                condition.AddElement("STATUS", status_Product.Text);
            }
            if (!string.IsNullOrEmpty(mperson_Product.Text))
            {
                condition.AddElement("MODIFIER", mperson_Product.Text, ElementType.Match);
            }
            if (!string.IsNullOrEmpty(createDate_Product.Text))
            {
                condition.AddElement("MODIFYTIME", createDate_Product.Text);
            }
            condition.AddElement("PRODUCTLEVEL", 2);

            PDM_ALL_PRODUCT t_product = new PDM_ALL_PRODUCT();
            t_product.PRODUCTNO = no_Product.Text;
            t_product.VERSION = version_Product.Text;
            t_product.PRODUCTTYPE = type_Product.Text;
            t_product.STATUS = status_Product.Text;

            t_product.MODIFIER = mperson_Product.Text;
            t_product.CREATETIME = createDate_Product.Text;
            t_product.MODIFYTIME = modifyDate_Product.Text;
            t_product.MODELTYPE = model_Product.Text;

            m_partsList = m_partsService.GetProductList(t_product, this.AdvanceQueryString);
            this.DialogResult = DialogResult.OK;
        }
Exemple #15
0
        public DataTable GetProductList(PDM_ALL_PRODUCT c, String p_partSql)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("Select A.* from  PDM_ALL_PRODUCT A Left join PDM_Params_DETAIL on  PK_VALUE =PRODUCTID where    PRODUCTLEVEL=2  AND DEL_FLAG ='N'    ");
            if (!string.IsNullOrEmpty(c.PRODUCTNO))
            {
                sb.Append(" AND PRODUCTNO LIKE '%").Append(c.PRODUCTNO).Append("%' ");
            }
            if (!string.IsNullOrEmpty(c.PRODUCTTYPE))
            {
                sb.Append(" AND PRODUCTTYPE LIKE '%").Append(c.PRODUCTTYPE).Append("%' ");
            }
            if (!string.IsNullOrEmpty(c.MODELTYPE))
            {
                sb.Append(" AND MODELTYPE LIKE '%").Append(c.MODELTYPE).Append("%' ");
            }
            if (!string.IsNullOrEmpty(c.VERSION))
            {
                sb.Append(" AND VERSION LIKE '%").Append(c.VERSION).Append("%' ");
            }
            if (!string.IsNullOrEmpty(c.STATUS))
            {
                sb.Append(" AND STATUS LIKE '%").Append(c.STATUS).Append("%' ");
            }
            if (!string.IsNullOrEmpty(c.MODIFIER))
            {
                sb.Append(" AND MODIFIER LIKE '%").Append(c.MODIFIER).Append("%' ");
            }
            if (!string.IsNullOrEmpty(c.CREATETIME))
            {
                sb.Append(" AND CREATETIME LIKE '%").Append(c.CREATETIME).Append("%' ");
            }
            if (!string.IsNullOrEmpty(c.MODIFYTIME))
            {
                sb.Append(" AND MODIFYTIME LIKE '%").Append(c.MODIFYTIME).Append("%'  ");
            }
            sb.Append(p_partSql);
            System.Data.DataTable dt = this.DataAccessor.QueryDataTable(sb.ToString());
            return(dt);
        }
Exemple #16
0
        /// <summary>
        /// 调用存储过程,用于插入产品结构时排序的序号加1.
        /// </summary>
        /// <param name="p_productId"></param>
        /// <param name="p_sortNum"></param>
        public DataSet GetProductByPage(PDM_ALL_PRODUCT c, int currentpage, int pagesize)
        {
            string sqlText = "Select * from  PDM_ALL_PRODUCT WHERE PRODUCTLEVEL=1   AND DEL_FLAG = 'N' ";

            if (!string.IsNullOrEmpty(c.PRODUCTNO))
            {
                sqlText += " AND PRODUCTNO LIKE '%" + c.PRODUCTNO + "%' ";
            }
            if (!string.IsNullOrEmpty(c.VERSION))
            {
                sqlText += " AND VERSION LIKE '%" + c.VERSION + "%' ";
            }

            ParameterCollection pc = new ParameterCollection();

            pc.Add("sqlstr", sqlText);
            pc.Add("currentpage", currentpage);
            pc.Add("pagesize", pagesize);
            DataSet ds = this.DataAccessor.QueryDataSet("SqlPager", CommandType.StoredProcedure, pc);

            return(ds);
        }
Exemple #17
0
        /// <summary>
        /// 获取符合条件的产成品的列表
        /// </summary>
        /// <param name="p"></param>
        /// <returns></returns>
        public DataTable GetPartsList(PDM_ALL_PRODUCT p)
        {
            string sqlText = "Select PRODUCTID,PRODUCTNO,MODELTYPE,PRODUCTTYPE from  PDM_ALL_PRODUCT  WHERE  DEL_FLAG='N'  AND  PRODUCTLEVEL =2  ";

            if (!string.IsNullOrEmpty(p.PRODUCTNO))
            {
                sqlText += "AND PRODUCTNO like '%" + p.PRODUCTNO + "%'  ";
            }
            if (!string.IsNullOrEmpty(p.MODELTYPE))
            {
                sqlText += "AND MODELTYPE like '%" + p.MODELTYPE + "%'  ";
            }
            if (!string.IsNullOrEmpty(p.VERSION))
            {
                sqlText += "AND VERSION like '%" + p.VERSION + "%'  ";
            }
            if (!string.IsNullOrEmpty(p.MEMO))
            {
                sqlText += "AND MEMO like '%" + p.MEMO + "%'  ";
            }
            System.Data.DataTable dt = this.DataAccessor.QueryDataTable(sqlText);
            return(dt);
        }
Exemple #18
0
        /// <summary>
        /// 基本信息--修改按钮操作
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void toolBaseEdit_Click(object sender, EventArgs e)
        {
            //
            if (this.m_product == null)
            {
                MessageBox.Show("该产品不存在,无法修改!"); return;
            }

            //判断是否需要修改
            if (MessageBox.Show("您确认要修改此产品基本信息?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
            {
                return;
            }

            //1.更新数据库产品基本信息记录
            PDM_ALL_PRODUCT t_product = new PDM_ALL_PRODUCT();

            t_product.PRODUCTID   = this.m_product.PRODUCTID;
            t_product.PRODUCTNO   = this.tb_productNo.Text;
            t_product.MODELTYPE   = this.tb_modelType.Text;
            t_product.PRODUCTTYPE = this.tb_productType.Text;
            t_product.MEMO_ZH     = this.tb_memoZh.Text;
            t_product.MEMO_EN     = this.tb_memoEn.Text;
            t_product.MEMO        = this.rtbMemo.Text;
            t_product.MODIFYTIME  = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");
            t_product.MODIFIER    = this.LoginInfo.LoginID;
            m_AllProductService.UpdateByID(t_product);


            //2.基本信息改变后更新基本信息显示
            this.tb_modifyTime.Text = t_product.MODIFYTIME;
            this.tb_modifier.Text   = t_product.MODIFIER;

            //3.更新(派生历史记录,ERC,文档,图纸,技术任务单,产品结构,版本)等tab页面列表显示,更新基本属性信息
            this.m_product = m_AllProductService.GetById(t_product.PRODUCTID);
            allinit();
        }
Exemple #19
0
        private void query_Product_Click(object sender, EventArgs e)
        {
            /*Condition condition = PDM_ALL_PRODUCT.Create().CreateCondition();
             * if (!string.IsNullOrEmpty(no_Product.Text))
             * {
             *  condition.AddElement("PRODUCTNO", no_Product.Text, ElementType.Match);
             * }
             * if (!string.IsNullOrEmpty(version_Product.Text))
             * {
             *  condition.AddElement("VERSION", version_Product.Text);
             * }
             * if (!string.IsNullOrEmpty(type_Product.Text))
             * {
             *  condition.AddElement("PRODUCTTYPE", type_Product.Text);
             * }
             * if (!string.IsNullOrEmpty(status_Product.Text))
             * {
             *  condition.AddElement("STATUS", status_Product.Text);
             * }
             * if (!string.IsNullOrEmpty(mperson_Product.Text))
             * {
             *  condition.AddElement("MODIFIER", mperson_Product.Text, ElementType.Match);
             * }
             * if (!string.IsNullOrEmpty(modifyDate_Product.Text))
             * {
             *  condition.AddElement("MODIFYTIME", modifyDate_Product.Text);
             * }
             * condition.AddElement("PRODUCTLEVEL", 1);
             */
            PDM_ALL_PRODUCT t_product = new PDM_ALL_PRODUCT();

            t_product.PRODUCTNO = no_Product.Text;
            t_product.VERSION   = version_Product.Text;
            m_productList       = m_productService.GetProductList(t_product);
            this.DialogResult   = DialogResult.OK;
        }
Exemple #20
0
 public DataTable GetProductList(PDM_ALL_PRODUCT c, String p_partSql)
 {
     StringBuilder sb = new StringBuilder();
     sb.Append("Select A.* from  PDM_ALL_PRODUCT A Left join PDM_Params_DETAIL on  PK_VALUE =PRODUCTID where    PRODUCTLEVEL=2  AND DEL_FLAG ='N'    ");
     if (!string.IsNullOrEmpty(c.PRODUCTNO))
     {
         sb.Append(" AND PRODUCTNO LIKE '%").Append(c.PRODUCTNO).Append("%' ");
     }
     if (!string.IsNullOrEmpty(c.PRODUCTTYPE))
     {
         sb.Append(" AND PRODUCTTYPE LIKE '%").Append(c.PRODUCTTYPE).Append("%' ");
     }
     if (!string.IsNullOrEmpty(c.MODELTYPE))
     {
         sb.Append(" AND MODELTYPE LIKE '%").Append(c.MODELTYPE).Append("%' ");
     }
     if (!string.IsNullOrEmpty(c.VERSION))
     {
         sb.Append(" AND VERSION LIKE '%").Append(c.VERSION).Append("%' ");
     }
     if (!string.IsNullOrEmpty(c.STATUS))
     {
         sb.Append(" AND STATUS LIKE '%").Append(c.STATUS).Append("%' ");
     }
     if (!string.IsNullOrEmpty(c.MODIFIER))
     {
         sb.Append(" AND MODIFIER LIKE '%").Append(c.MODIFIER).Append("%' ");
     }
     if (!string.IsNullOrEmpty(c.CREATETIME))
     {
         sb.Append(" AND CREATETIME LIKE '%").Append(c.CREATETIME).Append("%' ");
     }
     if (!string.IsNullOrEmpty(c.MODIFYTIME))
     {
         sb.Append(" AND MODIFYTIME LIKE '%").Append(c.MODIFYTIME).Append("%'  ");
     }
     sb.Append(p_partSql);
     System.Data.DataTable dt = this.DataAccessor.QueryDataTable(sb.ToString());
     return dt;
 }
        /// <summary>
        /// 初始化
        /// </summary>
        private void common_Init(string p_firstId, string p_secondId)
        {
            m_StructService = EAS.Services.ServiceContainer.GetService<IStructService>();
            m_AllProductService = EAS.Services.ServiceContainer.GetService<IAllProductService>();
            m_firstObj = m_AllProductService.GetById(p_firstId);
            m_secondObj = m_AllProductService.GetById(p_secondId);

            this.tb_firstNo.Text = m_firstObj.PRODUCTNO;
            this.tb_firstMemo.Text = m_firstObj.MEMO_ZH;
            this.tb_firstVersion.Text = m_firstObj.VERSION;

            this.tb_secondNo.Text = m_secondObj.PRODUCTNO;
            this.tb_secondMemo.Text = m_secondObj.MEMO_ZH;
            this.tb_secondVersion.Text = m_secondObj.VERSION;
        }
 public PDM_ALL_PRODUCT GetById(String p_id)
 {
     PDM_ALL_PRODUCT t_product = new PDM_ALL_PRODUCT();
     string sqlText = "select *  from  PDM_ALL_PRODUCT where PRODUCTID = '" + p_id + "'";
     System.Data.DataTable dt = this.DataAccessor.QueryDataTable(sqlText);
     if(dt.Rows.Count>0){
         t_product.PRODUCTID = dt.Rows[0]["PRODUCTID"].ToString();
         t_product.PRODUCTNO = dt.Rows[0]["PRODUCTNO"].ToString();
         t_product.MODELTYPE = dt.Rows[0]["MODELTYPE"].ToString();
         t_product.PRODUCTTYPE = dt.Rows[0]["PRODUCTTYPE"].ToString();
         t_product.PRODUCTLEVEL = Convert.ToInt16(dt.Rows[0]["PRODUCTLEVEL"].ToString());
         t_product.VERSION = dt.Rows[0]["VERSION"].ToString();
         t_product.STATUS = dt.Rows[0]["STATUS"].ToString();
         t_product.CREATER = dt.Rows[0]["CREATER"].ToString();
         t_product.MODIFIER = dt.Rows[0]["MODIFIER"].ToString();
         t_product.CREATETIME = dt.Rows[0]["CREATETIME"].ToString();
         t_product.MODIFYTIME = dt.Rows[0]["MODIFYTIME"].ToString();
         t_product.MEMO_ZH = dt.Rows[0]["MEMO_ZH"].ToString();
         t_product.MEMO_EN = dt.Rows[0]["MEMO_EN"].ToString();
         t_product.MEMO = dt.Rows[0]["MEMO"].ToString();
     }
     return t_product;
 }
        /// <summary>
        /// 调用存储过程,用于插入产品结构时排序的序号加1.
        /// </summary>
        /// <param name="p_productId"></param>
        /// <param name="p_sortNum"></param>
        public DataSet GetProductByPage(PDM_ALL_PRODUCT c,int currentpage, int pagesize)
        {
            string sqlText = "Select * from  PDM_ALL_PRODUCT WHERE PRODUCTLEVEL=1   AND DEL_FLAG = 'N' ";
            if (!string.IsNullOrEmpty(c.PRODUCTNO))
            {
                sqlText += " AND PRODUCTNO LIKE '%" + c.PRODUCTNO + "%' ";
            }
            if (!string.IsNullOrEmpty(c.VERSION))
            {
                sqlText += " AND VERSION LIKE '%" + c.VERSION + "%' ";
            }

            ParameterCollection pc = new ParameterCollection();
            pc.Add("sqlstr", sqlText);
            pc.Add("currentpage", currentpage);
            pc.Add("pagesize", pagesize);
            DataSet ds = this.DataAccessor.QueryDataSet("SqlPager", CommandType.StoredProcedure, pc);
            return ds;
        }
Exemple #24
0
        //简单查询按钮操作
        private void toolQuery_Click(object sender, EventArgs e)
        {
            if (this.toolProValue.Text.Equals("请输入属性值"))
            {
                MessageBox.Show("请输入属性值");
                return;
            }

            if (this.dgv_MaterialList.Visible)
            {
                PDM_MATERAIL p_materail = new PDM_MATERAIL();
                if (this.toolProComb.Text == "编号")
                {
                    p_materail.MATERIALNO = this.toolProValue.Text;
                }
                else if (this.toolProComb.Text.ToString().Equals("型号"))
                {
                    p_materail.MODELTYPE = this.toolProValue.Text;
                }
                else if (this.toolProComb.Text == "版本")
                {
                    p_materail.VERSION = this.toolProValue.Text;
                }
                else if (this.toolProComb.Text.ToString().Equals("描述"))
                {
                    p_materail.MEMO = this.toolProValue.Text;
                }
                this.dgv_MaterialList.DataSource = m_structService.GetMaterailList(p_materail);
            }
            else if (this.dgv_PartsList.Visible)
            {
                PDM_ALL_PRODUCT p_parts = new PDM_ALL_PRODUCT();
                if (this.toolProComb.Text == "编号")
                {
                    p_parts.PRODUCTNO = this.toolProValue.Text;
                }
                else if (this.toolProComb.Text.ToString().Equals("型号"))
                {
                    p_parts.MODELTYPE = this.toolProValue.Text;
                }
                else if (this.toolProComb.Text == "版本")
                {
                    p_parts.VERSION = this.toolProValue.Text;
                }
                else if (this.toolProComb.Text.ToString().Equals("描述"))
                {
                    p_parts.MEMO = this.toolProValue.Text;
                }
                this.dgv_PartsList.DataSource = m_structService.GetPartsList(p_parts);
            }
            else if (this.dgv_productList.Visible)
            {
                PDM_ALL_PRODUCT p_products = new PDM_ALL_PRODUCT();
                if (this.toolProComb.Text == "编号")
                {
                    p_products.PRODUCTNO = this.toolProValue.Text;
                }
                else if (this.toolProComb.Text.ToString().Equals("型号"))
                {
                    p_products.MODELTYPE = this.toolProValue.Text;
                }
                else if (this.toolProComb.Text == "版本")
                {
                    p_products.VERSION = this.toolProValue.Text;
                }
                else if (this.toolProComb.Text.ToString().Equals("描述"))
                {
                    p_products.MEMO = this.toolProValue.Text;
                }
                this.dgv_productList.DataSource = m_structService.GetProductList(p_products);
            }
        }
 //产品列表数据初始化
 private void dgvProductListInit()
 {
     HYPDM.Entities.PDM_ALL_PRODUCT t = new PDM_ALL_PRODUCT();
     this.dgv_productList.DataSource = m_structService.GetProductList(t);
 }
        //简单查询按钮操作
        private void toolQuery_Click(object sender, EventArgs e)
        {
            if (this.toolProValue.Text.Equals("请输入属性值"))
            {
                MessageBox.Show("请输入属性值");
                return;
            }

            if (this.dgv_MaterialList.Visible)
            {
                PDM_MATERAIL p_materail = new PDM_MATERAIL();
                if (this.toolProComb.Text == "编号")
                {
                    p_materail.MATERIALNO = this.toolProValue.Text;
                }
                else if (this.toolProComb.Text.ToString().Equals("型号"))
                {
                    p_materail.MODELTYPE = this.toolProValue.Text;
                }
                else if (this.toolProComb.Text == "版本")
                {
                    p_materail.VERSION = this.toolProValue.Text;
                }
                else if (this.toolProComb.Text.ToString().Equals("描述"))
                {
                    p_materail.MEMO = this.toolProValue.Text;
                }
                this.dgv_MaterialList.DataSource=m_structService.GetMaterailList(p_materail);

            }else if(this.dgv_PartsList.Visible)
            {
                PDM_ALL_PRODUCT p_parts = new PDM_ALL_PRODUCT();
                if (this.toolProComb.Text == "编号")
                {
                    p_parts.PRODUCTNO = this.toolProValue.Text;
                }
                else if (this.toolProComb.Text.ToString().Equals("型号"))
                {
                    p_parts.MODELTYPE = this.toolProValue.Text;
                }
                else if (this.toolProComb.Text == "版本")
                {
                    p_parts.VERSION = this.toolProValue.Text;
                }
                else if (this.toolProComb.Text.ToString().Equals("描述"))
                {
                    p_parts.MEMO = this.toolProValue.Text;
                }
                this.dgv_PartsList.DataSource=m_structService.GetPartsList(p_parts);
            }
            else if (this.dgv_productList.Visible)
            {
                PDM_ALL_PRODUCT p_products = new PDM_ALL_PRODUCT();
                if (this.toolProComb.Text == "编号")
                {
                    p_products.PRODUCTNO = this.toolProValue.Text;
                }
                else if (this.toolProComb.Text.ToString().Equals("型号"))
                {
                    p_products.MODELTYPE = this.toolProValue.Text;
                }
                else if (this.toolProComb.Text == "版本")
                {
                    p_products.VERSION = this.toolProValue.Text;
                }
                else if (this.toolProComb.Text.ToString().Equals("描述"))
                {
                    p_products.MEMO = this.toolProValue.Text;
                }
                this.dgv_productList.DataSource= m_structService.GetProductList(p_products);
            }
        }
Exemple #27
0
 private void CopyStrut(PDM_ALL_PRODUCT p_OldProduct, PDM_ALL_PRODUCT p_NewProduct)
 {
     string sqlText = " INSERT INTO PDM_STRUCT(OBJECTID, ASSOBJECTID, ASSONUM, ASSOWEIGHT, SORTNUM, MEMO,DEL_FLAG) "
                         + " SELECT '" + p_NewProduct.PRODUCTID + "', "
                         + " ASSOBJECTID, ASSONUM, ASSOWEIGHT, SORTNUM, MEMO,DEL_FLAG  "
                         + " FROM PDM_STRUCT  "
                         + " WHERE  DEL_FLAG='N'  "
                         + " AND    OBJECTID='" + p_OldProduct.PRODUCTID + "'  ";
     this.DataAccessor.Execute(sqlText);
 }
Exemple #28
0
 private void CopyDoc(PDM_ALL_PRODUCT p_OldProduct, PDM_ALL_PRODUCT p_NewProduct)
 {
     string sqlText = " INSERT INTO ObjectRelation(ORID, MASTEROBJECTID, MASTEROBJECTTYPE, MASTEROBJECTVERSION, RELATIONOBJECTID, RELATIONOBJECTTYPE, RELATIONOBJECTVERSION,OPT1, OPT2, DEL_FALG)  "
                         + " SELECT  NEWID(), MASTEROBJECTID, MASTEROBJECTTYPE, MASTEROBJECTVERSION, '" + p_NewProduct.PRODUCTID + "', "
                         + "  RELATIONOBJECTTYPE, '" + p_NewProduct.VERSION + "',"
                         + "  OPT1, OPT2, DEL_FALG  "
                         + " FROM  ObjectRelation "
                         + " WHERE DEL_FALG ='N' "
                         + " and RELATIONOBJECTID ='" + p_OldProduct.PRODUCTID + "' "
                         + " and  RELATIONOBJECTVERSION='" + p_OldProduct.VERSION + "' ";
     this.DataAccessor.Execute(sqlText);
 }
Exemple #29
0
 /// <summary>
 /// 更加对象查询半成品记录
 /// </summary>
 /// <param name="c"></param>
 /// <returns></returns>
 public DataTable GetProductList(PDM_ALL_PRODUCT c)
 {
     string sqlText = "Select * from  PDM_ALL_PRODUCT WHERE PRODUCTLEVEL=2  AND DEL_FLAG = 'N'  ";
     if (!string.IsNullOrEmpty(c.PRODUCTNO))
     {
         sqlText += " AND PRODUCTNO LIKE '%" + c.PRODUCTNO + "%' ";
     }
     if (!string.IsNullOrEmpty(c.VERSION))
     {
         sqlText += " AND VERSION LIKE '%" + c.VERSION + "%' ";
     }
     System.Data.DataTable dt = this.DataAccessor.QueryDataTable(sqlText);
     return dt;
 }
Exemple #30
0
 /// <summary>
 /// 获取符合条件的产品的列表
 /// </summary>
 /// <param name="p"></param>
 /// <returns></returns>
 public DataTable GetProductList(PDM_ALL_PRODUCT p)
 {
     string sqlText = "Select PRODUCTID,PRODUCTNO,MODELTYPE,PRODUCTTYPE from  PDM_ALL_PRODUCT WHERE  DEL_FLAG='N' AND PRODUCTLEVEL =1 ";
     if (!string.IsNullOrEmpty(p.PRODUCTNO)) {
         sqlText += "AND PRODUCTNO like '%" + p.PRODUCTNO + "%'  ";
     }
     if (!string.IsNullOrEmpty(p.MODELTYPE))
     {
         sqlText += "AND MODELTYPE  like '%" + p.MODELTYPE + "%'  ";
     }
     if (!string.IsNullOrEmpty(p.VERSION))
     {
         sqlText += "AND VERSION like '%" + p.VERSION + "%'  ";
     }
     if (!string.IsNullOrEmpty(p.MEMO))
     {
         sqlText += "AND MEMO like '%" + p.MEMO + "%'  ";
     }
     System.Data.DataTable dt = this.DataAccessor.QueryDataTable(sqlText);
     return dt;
 }
Exemple #31
0
 /********************************************************/
 /****************     复制产品结构操作       *******************/
 /********************************************************/
 public void CopyAllAsso(PDM_ALL_PRODUCT p_OldProduct, PDM_ALL_PRODUCT p_NewProduct)
 {
     CopyStrut(p_OldProduct, p_NewProduct);
     CopyDoc(p_OldProduct, p_NewProduct);
 }
Exemple #32
0
 /// <summary>
 /// 根据半成品对象更新记录
 /// </summary>
 /// <param name="c"></param>
 public void UpdateByID(PDM_ALL_PRODUCT c)
 {
     string sqlText = "update  PDM_ALL_PRODUCT SET  PRODUCTNO ='" +c.PRODUCTNO+"',"
                    + "MODELTYPE ='" + c.MODELTYPE + "',"
                    + "PRODUCTTYPE ='" + c.PRODUCTTYPE + "',"
                    + "MEMO_ZH ='" + c.MEMO_ZH + "',"
                    + "MEMO_EN ='" + c.MEMO_EN + "',"
                    + "MEMO ='" + c.MEMO + "',"
                    + "MODIFYTIME ='" + c.MODIFYTIME + "',"
                    + "MODIFIER ='" + c.MODIFIER + "'  "
                    + "where PRODUCTID = '" + c.PRODUCTID + "'";
     int temp = this.DataAccessor.Execute(sqlText);
 }
Exemple #33
0
        /********************************************************/
        /****************     复制产品结构操作       *******************/
        /********************************************************/

        public void CopyAllAsso(PDM_ALL_PRODUCT p_OldProduct, PDM_ALL_PRODUCT p_NewProduct)
        {
            CopyStrut(p_OldProduct, p_NewProduct);
            CopyDoc(p_OldProduct, p_NewProduct);
        }
Exemple #34
0
 //半成品列表数据初始化
 private void dgvPartsListInit()
 {
     HYPDM.Entities.PDM_ALL_PRODUCT t = new PDM_ALL_PRODUCT();
     this.dgv_PartsList.DataSource = m_structService.GetPartsList(t);
 }
        /// <summary>
        /// 基本信息--修改按钮操作
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void toolBaseEdit_Click(object sender, EventArgs e)
        {
            //
            if (this.m_product == null) {
                MessageBox.Show("该产品不存在,无法修改!"); return;
            }

            //判断是否需要修改
            if (MessageBox.Show("您确认要修改此产品基本信息?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No)
            {
                return;
            }

            //1.更新数据库产品基本信息记录
            PDM_ALL_PRODUCT t_product = new PDM_ALL_PRODUCT();
            t_product.PRODUCTID = this.m_product.PRODUCTID;
            t_product.PRODUCTNO = this.tb_productNo.Text;
            t_product.MODELTYPE = this.tb_modelType.Text;
            t_product.PRODUCTTYPE = this.tb_productType.Text;
            t_product.MEMO_ZH = this.tb_memoZh.Text;
            t_product.MEMO_EN = this.tb_memoEn.Text;
            t_product.MEMO = this.rtbMemo.Text;
            t_product.MODIFYTIME = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");
            t_product.MODIFIER = this.LoginInfo.LoginID;
            m_AllProductService.UpdateByID(t_product);

            //2.基本信息改变后更新基本信息显示
            this.tb_modifyTime.Text = t_product.MODIFYTIME;
            this.tb_modifier.Text = t_product.MODIFIER;

            //3.更新(派生历史记录,ERC,文档,图纸,技术任务单,产品结构,版本)等tab页面列表显示,更新基本属性信息
            this.m_product = m_AllProductService.GetById(t_product.PRODUCTID);
            allinit();
        }