コード例 #1
0
        private void SaveData(LoadOperation<ma_xa> lo)
        {

            if (lo.Entities.Count() > 0)
            {
                MessageBox.Show("Mã xã phường " + this.txtmaxa.Text.Trim().ToUpper() + " đã tồn tại");
            }
            else
            {

                if (txtmaxa.Text.Trim() != "" || txtten.Text.Trim() != "")
                {
                    ma_xa xa = new ma_xa
                    {
                        maxa = txtmaxa.Text.Trim().ToUpper(),
                        ten = txtten.Text.Trim(),
                        tientb = 20000,
                        vtci=false,
                        ma_huyen = App.ma_huyen
                    };
                    dstb.ma_xas.Add(xa);
                    dstb.SubmitChanges(OnSubmitCompleted, true);
                }
                else
                    MessageBox.Show("Nhập chưa đủ thông tin");
            }
        }
コード例 #2
0
 /// <summary>
 /// Create a new ma_xa object.
 /// </summary>
 /// <param name="ma_huyen">Initial value of the ma_huyen property.</param>
 /// <param name="maxa">Initial value of the maxa property.</param>
 /// <param name="ten">Initial value of the ten property.</param>
 /// <param name="vtci">Initial value of the vtci property.</param>
 /// <param name="id">Initial value of the id property.</param>
 public static ma_xa Createma_xa(global::System.String ma_huyen, global::System.String maxa, global::System.String ten, global::System.Boolean vtci, global::System.Decimal id)
 {
     ma_xa ma_xa = new ma_xa();
     ma_xa.ma_huyen = ma_huyen;
     ma_xa.maxa = maxa;
     ma_xa.ten = ten;
     ma_xa.vtci = vtci;
     ma_xa.id = id;
     return ma_xa;
 }
コード例 #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the ma_xa EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToma_xa(ma_xa ma_xa)
 {
     base.AddObject("ma_xa", ma_xa);
 }