Пример #1
0
        private void list_xm_SelectedValueChanged(object sender, EventArgs e)
        {
            selectedXm = (XM)list_xm.SelectedItem;
            List <LJZ> ljzList = ls.findByXmId(selectedXm.fId);

            loadLjzList(ljzList);
        }
Пример #2
0
        private void loadSingleData(XM xm)
        {
            List <XM> list = new List <XM>();

            list.Add(xm);
            loadDataList(list);
        }
Пример #3
0
 public void save(XM xm)
 {
     validate(xm);
     useTransaction(ctx =>
     {
         insertOrUpdate(xm, ctx);
         return(xm);
     });
 }
Пример #4
0
 private void b_ok_Click(object sender, EventArgs e)
 {
     if (dgv.SelectedRows == null || dgv.SelectedRows.Count < 1)
     {
         MessageBox.Show(this, "请选择一个项目");
         return;
     }
     selectedXm        = (XM)dgv.SelectedRows[0].DataBoundItem;
     this.DialogResult = DialogResult.OK;
     this.Close();
 }
Пример #5
0
        private void openCreateXmForm()
        {
            XM           xm = xs.newXm();
            FormXm       f  = new FormXm(xm);
            DialogResult r  = f.ShowDialog(this);

            if (r == DialogResult.OK)
            {
                loadSingleData(xm);
            }
        }
Пример #6
0
        public void validate(XM xm)
        {
            if (String.IsNullOrEmpty(xm.XMMC))
            {
                throw new Exception("项目名称不能为空。");
            }

            if (String.IsNullOrEmpty(xm.XMZL))
            {
                throw new Exception("项目坐落不能为空。");
            }
        }
Пример #7
0
        private void findXm()
        {
            FormXmList   f = new FormXmList();
            DialogResult r = f.ShowDialog(this);

            if (r == DialogResult.OK)
            {
                XM xm = f.selectedXm;
                zrz.XMMC = xm.XMMC;
                zrz.XMID = xm.fId;

                tb_xmmc.Text = xm.XMMC;
            }
        }
Пример #8
0
        private static IEnumerable <XM> AllOrders(string GetProductsQuery)
        {
            // The following is order summary data
            var xmlist = new ObservableCollection <XM>();

            try
            {
                using (SqlConnection conn = new SqlConnection(connectionString))
                {
                    conn.Open();
                    if (conn.State == System.Data.ConnectionState.Open)
                    {
                        using (SqlCommand cmd = conn.CreateCommand())
                        {
                            cmd.CommandText = GetProductsQuery;
                            using (SqlDataReader reader = cmd.ExecuteReader())
                            {
                                while (reader.Read())
                                {
                                    var product = new XM
                                    {
                                        xmbh = reader.GetString(0),
                                        xmmz = reader.GetString(1),
                                        xmlb = reader.GetString(2),
                                        qssj = reader.GetDateTime(3),
                                        jzsj = reader.GetDateTime(4),
                                        xmjb = reader.GetString(5),
                                        xmjf = reader.GetString(6),
                                    };
                                    xmlist.Add(product);
                                }
                            }
                        }
                    }
                }
                return(xmlist);
            }

            catch (Exception eSql)
            {
                string e = eSql.ToString();
                DisplayNoWifiDialog(e);
            }
            return(xmlist);
        }
Пример #9
0
        public XM newXm()
        {
            XM xm = new XM();

            return(xm);
        }
Пример #10
0
 public FormXm(XM xm)
 {
     this.xm = xm;
     InitializeComponent();
     init();
 }