private void Button_Commit_Click(object sender, RoutedEventArgs e)
        {
            string message = "";

            if (string.IsNullOrWhiteSpace(this.TextBox_编号.Text))
            {
                message += "请输入编号";
            }
            if (string.IsNullOrWhiteSpace(this.TextBox_直径.Text) || string.IsNullOrWhiteSpace(this.TextBox_厚度.Text))
            {
                message += "、直径、厚度";
            }
            if (!string.IsNullOrWhiteSpace(message))
            {
                MessageBox.Show(message);
                return;
            }
            Model_圆片资料 m = new Model_圆片资料();

            m.编号 = this.TextBox_编号.Text.Trim();
            m.直径 = this.TextBox_直径.Text.Trim();
            m.厚度 = this.TextBox_厚度.Text.Trim();
            m.备注 = this.TextBox_备注.Text.Trim();
            if (new ViewModel.MeansOfProduction.Vm_圆片().Add(m))
            {
                Event_圆片.OnUpdate圆片资料();
                PopUpEvent.OnHidePopUp();
            }
        }
Пример #2
0
        public bool Add(Model_圆片资料 m)
        {
            List <Model_圆片资料> data = new List <Model_圆片资料> {
                m
            };

            return(Add(data));
        }
Пример #3
0
        public List <Model_圆片资料> ReadList()
        {
            List <Model_圆片资料> data = new List <Model_圆片资料>();
            string            sql  = "Select * from T_ProductInfo_Wafer";
            DataSet           ds   = new DataSet();

            if (new Helper.SQLite.DBHelper().QueryData(sql, out ds))
            {
                int rowid = 1;
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    Model_圆片资料 m = new Model_圆片资料();
                    m.Guid = dr.Field <Guid>("Guid");
                    m.序号   = rowid++;
                    m.编号   = dr.Field <string>("Number");
                    m.直径   = dr.Field <string>("Diameter");
                    m.厚度   = dr.Field <string>("Thickness");
                    m.备注   = dr.Field <string>("Remark");
                    data.Add(m);
                }
            }
            return(data);
        }
Пример #4
0
        public Model_圆片资料 ReadInfo(string number)
        {
            Model_圆片资料 m   = new Model_圆片资料();
            string     sql = "select * from T_ProductInfo_Wafer where Number='" + number + "'";
            DataSet    ds  = new DataSet();

            if (new Helper.SQLite.DBHelper().QueryData(sql, out ds))
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    DataRow dr = ds.Tables[0].Rows[0];
                    m.Guid = dr.Field <Guid>("Guid");
                    m.编号   = number;
                    m.直径   = dr.Field <string>("Diameter");
                    m.厚度   = dr.Field <string>("Thickness");
                    m.备注   = dr.Field <string>("Remark");
                }
                else
                {
                    return(null);
                }
            }
            return(m);
        }