예제 #1
0
        //
        //选择物料
        //
        private void dgv_Source_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            try
            {
                txb_AliasName.Text            = "";
                txb_AliasName.IsEnabled       = false;
                btn_Save_AliasName.Visibility = System.Windows.Visibility.Hidden;
                lab_Emphasis.Visibility       = System.Windows.Visibility.Hidden;
                //

                // int selectIndex = dgv_Source.SelectedIndex;
                DataRowView dr = (DataRowView)dgv_Source.SelectedItem;
                _WTT_Orm_ID = dr["Orm_ID"].ToString();

                //
                txb_AliasName.Text   = dr["别名"].ToString();
                txb_MaterialNum.Text = dr["料号"].ToString();
                txb_ProductName.Text = dr["品名"].ToString();
                txb_Model.Text       = dr["规格"].ToString();
                lab_Unit.Content     = dr["单位"].ToString();


                double.TryParse(dr["需领数量"].ToString(), out _wantCount);      //需领用量
                txb_WantCount.Text = _wantCount.ToString("0.00");
                _yetCount          = _M_MaterReceive.Get_Count(_WTT_Orm_ID); //已领用量
                txb_YetCount.Text  = _yetCount.ToString("0.00");

                //
                DataSet temds = _M_MaterReceive.GetList("Orm_ID = '" + _WTT_Orm_ID + "'");
                dgv_Receive_Record.ItemsSource = temds.Tables[0].DefaultView;

                // 判断是否是重点管控料件
                string product = dr["品名"].ToString();
                if (product.Contains("FERRULE"))
                {
                    lab_Emphasis.Visibility = System.Windows.Visibility.Visible;
                    if (txb_AliasName.Text == "")
                    {
                        txb_AliasName.IsEnabled       = true;
                        btn_Save_AliasName.Visibility = System.Windows.Visibility.Visible;
                        My_MessageBox.My_MessageBox_Message("重点管控料件,出现此提示的原因是此料件未设置别名;\r\n请在别名设置窗口中设置别名后点击保存!");
                    }
                }
                //
                Set_IsEn(false, true);
            }
            catch (Exception ex) { My_MessageBox.My_MessageBox_Erry(ex.Message + "\r\n弹出此错题的原因是您选择的列为空列!"); }
        }
예제 #2
0
파일: List.aspx.cs 프로젝트: radtek/EicMcp
        public void BindData()
        {
            #region
            //if (!Context.User.Identity.IsAuthenticated)
            //{
            //    return;
            //}
            //AccountsPrincipal user = new AccountsPrincipal(Context.User.Identity.Name);
            //if (user.HasPermissionID(PermId_Modify))
            //{
            //    gridView.Columns[6].Visible = true;
            //}
            //if (user.HasPermissionID(PermId_Delete))
            //{
            //    gridView.Columns[7].Visible = true;
            //}
            #endregion

            DataSet       ds       = new DataSet();
            StringBuilder strWhere = new StringBuilder();
            if (txtKeyword.Text.Trim() != "")
            {
                #warning 代码生成警告:请修改 keywordField 为需要匹配查询的真实字段名称
                //strWhere.AppendFormat("keywordField like '%{0}%'", txtKeyword.Text.Trim());
            }
            ds = bll.GetList(strWhere.ToString());
            gridView.DataSource = ds;
            gridView.DataBind();
        }