コード例 #1
0
 //
 //查找治具信息
 //
 private void btn_Search_Aseet_Click(object sender, System.Windows.RoutedEventArgs e)
 {
     Maticsoft.Model.Equipment_TypeList _temFindType = (Maticsoft.Model.Equipment_TypeList)cmb_Search_Type.SelectedItem;
     dgv_FixtureInfo.ItemsSource = MCP_CS.FixtureInfo.GetModelList(_temFindType.Remarks + " LIKE '%" + txb_Search_Value.Text.Trim() + "%'");
     IsEnControl(false);
     ClearControlValue();
 }
コード例 #2
0
ファイル: Equipment_TypeList.cs プロジェクト: radtek/EicMcp
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Maticsoft.Model.Equipment_TypeList model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update tb_Equipment_TypeList set ");
            strSql.Append("ID=@ID,");
            strSql.Append("Type=@Type,");
            strSql.Append("Value=@Value,");
            strSql.Append("Remarks=@Remarks");
            strSql.Append(" where ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@ID",      SqlDbType.Decimal,  9),
                new SqlParameter("@Type",    SqlDbType.VarChar, 50),
                new SqlParameter("@Value",   SqlDbType.VarChar, 50),
                new SqlParameter("@Remarks", SqlDbType.VarChar, 255)
            };
            parameters[0].Value = model.ID;
            parameters[1].Value = model.Type;
            parameters[2].Value = model.Value;
            parameters[3].Value = model.Remarks;

            int rows = dbs.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #3
0
ファイル: Equipment_TypeList.cs プロジェクト: radtek/EicMcp
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(Maticsoft.Model.Equipment_TypeList model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into tb_Equipment_TypeList(");
            strSql.Append("ID,Type,Value,Remarks)");
            strSql.Append(" values (");
            strSql.Append("@ID,@Type,@Value,@Remarks)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@ID",      SqlDbType.Decimal,  9),
                new SqlParameter("@Type",    SqlDbType.VarChar, 50),
                new SqlParameter("@Value",   SqlDbType.VarChar, 50),
                new SqlParameter("@Remarks", SqlDbType.VarChar, 255)
            };
            parameters[0].Value = model.ID;
            parameters[1].Value = model.Type;
            parameters[2].Value = model.Value;
            parameters[3].Value = model.Remarks;

            int rows = dbs.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #4
0
        //
        //选择查询条件
        //
        private void cmb_SearchConition_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
            Maticsoft.Model.Equipment_TypeList _temEquipment_Typelist = (Maticsoft.Model.Equipment_TypeList)cmb_SearchConition.SelectedItem;
            DataSet temds = MCP_CS.FixtureList.Get_Distinct_List(_temEquipment_Typelist.Remarks);

            cmb_SerachValue.DisplayMemberPath = _temEquipment_Typelist.Remarks;
            if (temds != null)
            {
                cmb_SerachValue.ItemsSource = temds.Tables[0].DefaultView;
            }
        }
コード例 #5
0
 /// <summary>
 /// 获取查找结果
 /// </summary>
 /// <param name="_SearchConition">查找选项</param>
 /// <param name="_SearchValue">值</param>
 /// <param name="IsFuzzySearch">是否模糊查询</param>
 /// <returns></returns>
 private List <Maticsoft.Model.ConsumableInfo> GetSearchResult(Maticsoft.Model.Equipment_TypeList _SearchConition, string _SearchValue)
 {
     if (_SearchValue != "" || _SearchConition.Value != "所有耗材")
     {
         return(MCP_CS.ConsumableInfo.GetModelList(_SearchConition.Remarks + " LIKE '%" + _SearchValue + "%'"));
     }
     else
     {
         return(MCP_CS.ConsumableInfo.GetModelList(""));
     }
 }
コード例 #6
0
 //
 //查找
 //
 private void btn_Search_Click(object sender, RoutedEventArgs e)
 {
     //获取用于查询的Sql列名称
     Maticsoft.Model.Equipment_TypeList _temFindType = (Maticsoft.Model.Equipment_TypeList)cmb_SearchConition.SelectedItem;
     //给DataView 控件指定数据源
     if (cmb_SerachValue.Text != "")
     {
         dgv_Date.ItemsSource = MCP_CS.UserInfo.GetModelList(_temFindType.Remarks + " LIKE '%" + cmb_SerachValue.Text.Trim() + "%'");
     }
     else
     {
         dgv_Date.ItemsSource = MCP_CS.UserInfo.GetModelList("");
     }
     lab_UserCount.Content = "记录 " + (dgv_Date.Items.Count - 1) + "条";
 }
コード例 #7
0
 private ObservableCollection <Maticsoft.Model.FixtureList> GetSearchResult(Maticsoft.Model.Equipment_TypeList _SearchConition, string _SearchValue)
 {
     if (_SearchConition != null)
     {
         if (_SearchValue != "" || _SearchConition.Value != "所有设备")
         {
             return(MCP_CS.FixtureList.GetModelList1(_SearchConition.Remarks + " LIKE '%" + _SearchValue + "%'"));
         }
         else
         {
             return(MCP_CS.FixtureList.GetModelList1(""));
         }
     }
     else
     {
         return(MCP_CS.FixtureList.GetModelList1(""));
     }
 }
コード例 #8
0
 /// <summary>
 /// 获取查找结果
 /// </summary>
 /// <param name="_SearchConition">查找选项</param>
 /// <param name="_SearchValue">值</param>
 /// <param name="IsFuzzySearch">是否模糊查询</param>
 /// <returns></returns>
 private List <Maticsoft.Model.EquipmentInfo> GetSearchResult(Maticsoft.Model.Equipment_TypeList _SearchConition, string _SearchValue)
 {
     if (_SearchValue != "" || _SearchConition.Value != "所有设备")
     {
         if (IsFuzzySearch)
         {
             return(MCP_CS._M_Equipment.GetModelList(_SearchConition.Remarks + " = '" + _SearchValue + "'"));
         }
         else
         {
             return(MCP_CS._M_Equipment.GetModelList(_SearchConition.Remarks + " LIKE '%" + _SearchValue + "%'"));
         }
     }
     else
     {
         return(MCP_CS._M_Equipment.GetModelList(""));
     }
 }
コード例 #9
0
ファイル: Equipment_TypeList.cs プロジェクト: radtek/EicMcp
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Maticsoft.Model.Equipment_TypeList GetModel()
        {
            //该表无主键信息,请自定义主键/条件字段
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 ID,Type,Value,Remarks from tb_Equipment_TypeList ");
            strSql.Append(" where ");
            SqlParameter[] parameters =
            {
            };

            Maticsoft.Model.Equipment_TypeList model = new Maticsoft.Model.Equipment_TypeList();
            DataSet ds = dbs.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["ID"] != null && ds.Tables[0].Rows[0]["ID"].ToString() != "")
                {
                    model.ID = decimal.Parse(ds.Tables[0].Rows[0]["ID"].ToString());
                }
                if (ds.Tables[0].Rows[0]["Type"] != null && ds.Tables[0].Rows[0]["Type"].ToString() != "")
                {
                    model.Type = ds.Tables[0].Rows[0]["Type"].ToString();
                }
                if (ds.Tables[0].Rows[0]["Value"] != null && ds.Tables[0].Rows[0]["Value"].ToString() != "")
                {
                    model.Value = ds.Tables[0].Rows[0]["Value"].ToString();
                }
                if (ds.Tables[0].Rows[0]["Remarks"] != null && ds.Tables[0].Rows[0]["Remarks"].ToString() != "")
                {
                    model.Remarks = ds.Tables[0].Rows[0]["Remarks"].ToString();
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
コード例 #10
0
 //
 //查找治具
 //
 private void btn_Search_Click(object sender, System.Windows.RoutedEventArgs e)
 {
     Maticsoft.Model.Equipment_TypeList _tem = (Maticsoft.Model.Equipment_TypeList)cmb_SearchConition.SelectedItem;
     dgv_FixtureList.ItemsSource = GetSearchResult(_tem, cmb_SerachValue.Text.Trim());
 }
コード例 #11
0
 //
 //查找
 //
 private void btn_Search_Click(object sender, RoutedEventArgs e)
 {
     Maticsoft.Model.Equipment_TypeList _temFindType = (Maticsoft.Model.Equipment_TypeList)cmb_Search_Type.SelectedItem;
     dgv_FixInfo_List.ItemsSource = MCP_CS.FixtureInfo.GetModelList(_temFindType.Remarks + "= '" + txb_Search_Value.Text.Trim() + "'");
 }