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 IMaterailService m_MaterailService; //材料服务类 #endregion Fields #region Constructors public DrawAddForm(String p_MaterailId) { InitializeComponent(); m_MaterailService = EAS.Services.ServiceContainer.GetService<IMaterailService>(); m_Materail = m_MaterailService.GetById(p_MaterailId); this.tsb_type.SelectedIndex = 0; DocList_Init(); }
private void bt_query_Click(object sender, EventArgs e) { PDM_MATERAIL t_materail = new PDM_MATERAIL(); t_materail.MATERIALNO = this.tb_materailNo.Text; t_materail.MODELTYPE = this.tb_modelType.Text; t_materail.MATERIALSRC = this.tb_materailSrc.Text; t_materail.MATERIALTYPE = this.tb_materailType.Text; t_materail.MEMO_ZH = this.tb_memoZh.Text; t_materail.MEMO_EN = this.tb_memoEn.Text; t_materail.CREATER = this.tb_creater.Text; t_materail.RAWMATERIAL = this.tb_rawMaterail.Text.Trim(); m_dt = m_materailService.GetMaterailList(t_materail, this.AdvanceQueryString); this.DialogResult = DialogResult.OK; }
/// <summary> /// 根据材料实体类更新一条记录 /// </summary> /// <param name="p_id"></param> /// <returns></returns> public void UpdateByID(PDM_MATERAIL c) { string sqlText = "update PDM_MATERAIL SET MATERIALNO ='" + c.MATERIALNO + "'," + "MODELTYPE ='" + c.MODELTYPE + "'," + "MATERIALTYPE ='" + c.MATERIALTYPE + "'," + "MEMO_ZH ='" + c.MEMO_ZH + "'," + "RAWMATERIAL ='" + c.RAWMATERIAL + "'," + "MATERIALSRC ='" + c.MATERIALSRC + "'," + "MEMO_EN ='" + c.MEMO_EN + "'," + "MEMO ='" + c.MEMO + "'," + "MODIFYTIME ='" + c.MODIFYTIME + "'," + "MODIFIER ='" + c.MODIFIER + "' " + "where MATERIALID = '" + c.MATERIALID + "'"; int temp = this.DataAccessor.Execute(sqlText); }
//查询按钮操作 private void bt_query_Click(object sender, EventArgs e) { /*Condition condition = PDM_MATERAIL.Create().CreateCondition(); * * if (!string.IsNullOrEmpty(this.tb_materailNo.Text)) * { * condition.AddElement("MATERIALNO", this.tb_materailNo.Text, ElementType.Match); * } * if (!string.IsNullOrEmpty(this.tb_modelType.Text)) * { * condition.AddElement("MODELTYPE", this.tb_modelType.Text); * } * if (!string.IsNullOrEmpty(this.tb_materailSrc.Text)) * { * condition.AddElement("MATERIALSRC", tb_materailSrc.Text); * } * if (!string.IsNullOrEmpty(this.tb_materailType.Text)) * { * condition.AddElement("MATERIALTYPE", tb_materailType.Text); * } * if (!string.IsNullOrEmpty(this.tb_memoEn.Text)) * { * condition.AddElement("MEMO_ZH", this.tb_memoEn.Text, ElementType.Match); * } * if (!string.IsNullOrEmpty(this.tb_memoEn.Text)) * { * condition.AddElement("MEMO_EN", this.tb_memoEn.Text); * } * if (!string.IsNullOrEmpty(this.tb_creater.Text)) * { * condition.AddElement("CREATER", this.tb_creater.Text); * }*/ PDM_MATERAIL t_materail = new PDM_MATERAIL(); t_materail.MATERIALNO = this.tb_materailNo.Text; t_materail.MODELTYPE = this.tb_modelType.Text; t_materail.MATERIALSRC = this.tb_materailSrc.Text; t_materail.MATERIALTYPE = this.tb_materailType.Text; t_materail.MEMO_ZH = this.tb_memoZh.Text; t_materail.MEMO_EN = this.tb_memoEn.Text; t_materail.CREATER = this.tb_creater.Text; t_materail.RAWMATERIAL = this.tb_rawMaterail.Text.Trim(); m_dt = m_materailService.GetMaterailList(t_materail); this.DialogResult = DialogResult.OK; }
//查询按钮操作 private void bt_query_Click(object sender, EventArgs e) { /*Condition condition = PDM_MATERAIL.Create().CreateCondition(); if (!string.IsNullOrEmpty(this.tb_materailNo.Text)) { condition.AddElement("MATERIALNO", this.tb_materailNo.Text, ElementType.Match); } if (!string.IsNullOrEmpty(this.tb_modelType.Text)) { condition.AddElement("MODELTYPE", this.tb_modelType.Text); } if (!string.IsNullOrEmpty(this.tb_materailSrc.Text)) { condition.AddElement("MATERIALSRC", tb_materailSrc.Text); } if (!string.IsNullOrEmpty(this.tb_materailType.Text)) { condition.AddElement("MATERIALTYPE", tb_materailType.Text); } if (!string.IsNullOrEmpty(this.tb_memoEn.Text)) { condition.AddElement("MEMO_ZH", this.tb_memoEn.Text, ElementType.Match); } if (!string.IsNullOrEmpty(this.tb_memoEn.Text)) { condition.AddElement("MEMO_EN", this.tb_memoEn.Text); } if (!string.IsNullOrEmpty(this.tb_creater.Text)) { condition.AddElement("CREATER", this.tb_creater.Text); }*/ PDM_MATERAIL t_materail = new PDM_MATERAIL(); t_materail.MATERIALNO = this.tb_materailNo.Text; t_materail.MODELTYPE = this.tb_modelType.Text; t_materail.MATERIALSRC = this.tb_materailSrc.Text; t_materail.MATERIALTYPE= this.tb_materailType.Text; t_materail.MEMO_ZH= this.tb_memoZh.Text; t_materail.MEMO_EN = this.tb_memoEn.Text; t_materail.CREATER = this.tb_creater.Text; t_materail.RAWMATERIAL = this.tb_rawMaterail.Text.Trim(); m_dt = m_materailService.GetMaterailList(t_materail); this.DialogResult = DialogResult.OK; }
public DataTable GetMaterailList(PDM_MATERAIL c, String p_partSql) { StringBuilder sb = new StringBuilder(); sb.Append("Select A.* from PDM_MATERAIL A Left join PDM_Params_DETAIL on PK_VALUE =MATERIALID where DEL_FLAG ='N' "); if (!string.IsNullOrEmpty(c.MATERIALNO)) { sb.Append(" AND MATERIALNO LIKE '%").Append(c.MATERIALNO).Append("%' "); } if (!string.IsNullOrEmpty(c.MATERIALTYPE)) { sb.Append(" AND MATERIALTYPE LIKE '%").Append(c.MATERIALTYPE).Append("%' "); } if (!string.IsNullOrEmpty(c.RAWMATERIAL)) { sb.Append(" AND RAWMATERIAL LIKE '%").Append(c.RAWMATERIAL).Append("%' "); } if (!string.IsNullOrEmpty(c.MATERIALTYPE)) { sb.Append(" AND MATERIALTYPE LIKE '%").Append(c.MATERIALTYPE).Append("%' "); } if (!string.IsNullOrEmpty(c.MATERIALSRC)) { sb.Append(" AND MATERIALSRC LIKE '%").Append(c.MATERIALSRC).Append("%' "); } if (!string.IsNullOrEmpty(c.CREATER)) { sb.Append(" AND CREATER LIKE '%").Append(c.CREATER).Append("%' "); } if (!string.IsNullOrEmpty(c.MEMO_EN)) { sb.Append(" AND MEMO_EN LIKE '%").Append(c.MEMO_EN).Append("%' "); } if (!string.IsNullOrEmpty(c.MEMO_ZH)) { sb.Append(" AND MEMO_ZH LIKE '%").Append(c.MEMO_ZH).Append("%' "); } sb.Append(p_partSql); System.Data.DataTable dt = this.DataAccessor.QueryDataTable(sb.ToString()); return(dt); }
public DataTable GetMaterailList(PDM_MATERAIL c) { StringBuilder sb = new StringBuilder(); sb.Append("Select * from PDM_MATERAIL where DEL_FLAG ='N' "); if (!string.IsNullOrEmpty(c.MATERIALNO)) { sb.Append(" AND MATERIALNO LIKE '%").Append(c.MATERIALNO).Append("%' "); } if (!string.IsNullOrEmpty(c.MATERIALTYPE)) { sb.Append(" AND MATERIALTYPE LIKE '%").Append(c.MATERIALTYPE).Append("%' "); } if (!string.IsNullOrEmpty(c.RAWMATERIAL)) { sb.Append(" AND RAWMATERIAL LIKE '%").Append(c.RAWMATERIAL).Append("%' "); } if (!string.IsNullOrEmpty(c.MATERIALTYPE)) { sb.Append(" AND MATERIALTYPE LIKE '%").Append(c.MATERIALTYPE).Append("%' "); } if (!string.IsNullOrEmpty(c.MATERIALSRC)) { sb.Append(" AND MATERIALSRC LIKE '%").Append(c.MATERIALSRC).Append("%' "); } if (!string.IsNullOrEmpty(c.CREATER)) { sb.Append(" AND CREATER LIKE '%").Append(c.CREATER).Append("%' "); } if (!string.IsNullOrEmpty(c.MEMO_EN)) { sb.Append(" AND MEMO_EN LIKE '%").Append(c.MEMO_EN).Append("%' "); } if (!string.IsNullOrEmpty(c.MEMO_ZH)) { sb.Append(" AND MEMO_ZH LIKE '%").Append(c.MEMO_ZH).Append("%' "); } System.Data.DataTable dt = this.DataAccessor.QueryDataTable(sb.ToString()); return(dt); }
/// <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_MATERAIL t_product = new PDM_MATERAIL(); t_product.MATERIALID = this.m_product.MATERIALID; t_product.MATERIALNO = this.tb_productNo.Text; t_product.MODELTYPE = this.tb_modelType.Text; t_product.MATERIALTYPE = this.tb_productType.Text; t_product.RAWMATERIAL = this.tb_rawMaterail.Text; t_product.MATERIALSRC = this.tb_materailSrc.Text; t_product.VERSION = this.tb_version.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 = LoginInfo.LoginID;// LoginInfo.LoginID;//CommonVar.userName; m_MaterailService.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_MaterailService.GetById(t_product.MATERIALID); allinit(); }
/// <summary> /// 根据条件分页查询记录 /// </summary> /// <param name="c"></param> /// <param name="currentpage"></param> /// <param name="pagesize"></param> /// <returns></returns> public DataSet GetProductByPage(PDM_MATERAIL c, int currentpage, int pagesize) { string sqlText = "Select * from PDM_MATERAIL where 1=1 "; if (!string.IsNullOrEmpty(c.MATERIALNO)) { sqlText += " AND MATERIALNO LIKE '%" + c.MATERIALNO + "%' "; } 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); }
/// <summary> /// 获取符合条件的材料的列表 /// </summary> /// <param name="p"></param> /// <returns></returns> public DataTable GetMaterailList(PDM_MATERAIL p) { string sqlText = "Select MATERIALID,MATERIALNO,MODELTYPE,MATERIALTYPE from PDM_MATERAIL WHERE DEL_FLAG='N' "; if (!string.IsNullOrEmpty(p.MATERIALNO)) { sqlText += "AND MATERIALNO like '%" + p.MATERIALNO + "%' "; } 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; }
/// <summary> /// 获取符合条件的材料的列表 /// </summary> /// <param name="p"></param> /// <returns></returns> public DataTable GetMaterailList(PDM_MATERAIL p) { string sqlText = "Select MATERIALID,MATERIALNO,MODELTYPE,MATERIALTYPE from PDM_MATERAIL WHERE DEL_FLAG='N' "; if (!string.IsNullOrEmpty(p.MATERIALNO)) { sqlText += "AND MATERIALNO like '%" + p.MATERIALNO + "%' "; } 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); }
//材料列表数据初始化 private void dgvMaterailListInit() { HYPDM.Entities.PDM_MATERAIL t = new PDM_MATERAIL(); this.dgv_MaterialList.DataSource = m_structService.GetMaterailList(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); } }
public DataTable GetMaterailList(PDM_MATERAIL c) { StringBuilder sb = new StringBuilder(); sb.Append("Select * from PDM_MATERAIL where DEL_FLAG ='N' "); if (!string.IsNullOrEmpty(c.MATERIALNO)) { sb.Append(" AND MATERIALNO LIKE '%").Append(c.MATERIALNO).Append("%' "); } if (!string.IsNullOrEmpty(c.MATERIALTYPE)) { sb.Append(" AND MATERIALTYPE LIKE '%").Append(c.MATERIALTYPE).Append("%' "); } if (!string.IsNullOrEmpty(c.RAWMATERIAL)) { sb.Append(" AND RAWMATERIAL LIKE '%").Append(c.RAWMATERIAL).Append("%' "); } if (!string.IsNullOrEmpty(c.MATERIALTYPE)) { sb.Append(" AND MATERIALTYPE LIKE '%").Append(c.MATERIALTYPE).Append("%' "); } if (!string.IsNullOrEmpty(c.MATERIALSRC)) { sb.Append(" AND MATERIALSRC LIKE '%").Append(c.MATERIALSRC).Append("%' "); } if (!string.IsNullOrEmpty(c.CREATER)) { sb.Append(" AND CREATER LIKE '%").Append(c.CREATER).Append("%' "); } if (!string.IsNullOrEmpty(c.MEMO_EN)) { sb.Append(" AND MEMO_EN LIKE '%").Append(c.MEMO_EN).Append("%' "); } if (!string.IsNullOrEmpty(c.MEMO_ZH)) { sb.Append(" AND MEMO_ZH LIKE '%").Append(c.MEMO_ZH).Append("%' "); } System.Data.DataTable dt = this.DataAccessor.QueryDataTable(sb.ToString()); return dt; }
public DataTable GetMaterailList(PDM_MATERAIL c,String p_partSql) { StringBuilder sb = new StringBuilder(); sb.Append("Select A.* from PDM_MATERAIL A Left join PDM_Params_DETAIL on PK_VALUE =MATERIALID where DEL_FLAG ='N' "); if (!string.IsNullOrEmpty(c.MATERIALNO)) { sb.Append(" AND MATERIALNO LIKE '%").Append(c.MATERIALNO).Append("%' "); } if (!string.IsNullOrEmpty(c.MATERIALTYPE)) { sb.Append(" AND MATERIALTYPE LIKE '%").Append(c.MATERIALTYPE).Append("%' "); } if (!string.IsNullOrEmpty(c.RAWMATERIAL)) { sb.Append(" AND RAWMATERIAL LIKE '%").Append(c.RAWMATERIAL).Append("%' "); } if (!string.IsNullOrEmpty(c.MATERIALTYPE)) { sb.Append(" AND MATERIALTYPE LIKE '%").Append(c.MATERIALTYPE).Append("%' "); } if (!string.IsNullOrEmpty(c.MATERIALSRC)) { sb.Append(" AND MATERIALSRC LIKE '%").Append(c.MATERIALSRC).Append("%' "); } if (!string.IsNullOrEmpty(c.CREATER)) { sb.Append(" AND CREATER LIKE '%").Append(c.CREATER).Append("%' "); } if (!string.IsNullOrEmpty(c.MEMO_EN)) { sb.Append(" AND MEMO_EN LIKE '%").Append(c.MEMO_EN).Append("%' "); } if (!string.IsNullOrEmpty(c.MEMO_ZH)) { sb.Append(" AND MEMO_ZH LIKE '%").Append(c.MEMO_ZH).Append("%' "); } sb.Append(p_partSql); System.Data.DataTable dt = this.DataAccessor.QueryDataTable(sb.ToString()); return dt; }
//简单查询按钮操作 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); } }
/// <summary> /// 根据条件分页查询记录 /// </summary> /// <param name="c"></param> /// <param name="currentpage"></param> /// <param name="pagesize"></param> /// <returns></returns> public DataSet GetProductByPage(PDM_MATERAIL c, int currentpage, int pagesize) { string sqlText = "Select * from PDM_MATERAIL where 1=1 "; if (!string.IsNullOrEmpty(c.MATERIALNO)) { sqlText += " AND MATERIALNO LIKE '%" + c.MATERIALNO + "%' "; } 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; }