/// <summary> /// Create a new Gphone object. /// </summary> /// <param name="so_dt">Initial value of the so_dt property.</param> public static Gphone CreateGphone(global::System.String so_dt) { Gphone gphone = new Gphone(); gphone.so_dt = so_dt; return gphone; }
void SaveData() { try { // get_hopdong(App.ma_huyen + "/" + this.dngayhd.DateTime.Year.ToString().Substring(2, 2)); Gphone ds = new Gphone { so_dt = this.txtsdt.Text, SoSim= this.txtsosim.Text.Trim(), ten_dktb = this.txttentb.Text.Trim(), ten_dkdb = this.txttendb.Text.Trim(), dia_chitb = this.txtdctb.Text.Trim(), dc_tbld = this.txtdcld.Text.Trim(), tuyen_tc = "", ma_tram = cmbtramvt.GetKeyValue(cmbtramvt.SelectedIndex).ToString(), pl = Getplkhachhang(cmbnhom.GetKeyValue(cmbnhom.SelectedIndex).ToString().Trim()), village = "", tien_tb = 0, tienno = 0, tb_dv = 0, ngay_ld = null, ngay_mo = null, may_ngung = "M", ngay_ngung = null, keo_may = false, mo_may = false, ma_huyen = App.ma_huyen, stt = 0, sohopdong = this.txtsohd.Text.Trim(), ngay_hd = this.dngayhd.DateTime, thangbd = "", inct = false, ma_kh = this.txtmakh.Text, ngay_kn = dngaykn.Text.Trim() == "" ? D_null : this.dngaykn.DateTime, note_ngay_kn = this.txtghichu.Text.Trim(), tenkhkd = FunAndPro.KhongDau(this.txttentb.Text.Trim()), dckd = FunAndPro.KhongDau(this.txtdctb.Text.Trim()), ms_thue = FunAndPro.ma_st(this.txtmst.Text.Trim()), khg_vat = false, cuoc = 0, ngay = null, duong = App.duong, xa_phuong = App.phuong, khom_ap = App.khom, tbdc = false, kh_db = "", ma_nhom = cmbnhom.GetKeyValue(cmbnhom.SelectedIndex).ToString(), ma_nghe = cmbnganh.GetKeyValue(cmbnganh.SelectedIndex).ToString(), socmnd = this.txtcmnd.Text.Trim(), noi_cap = this.txtnoicap.Text.Trim(), ngay_cap = this.dngaycap.DateTime, ngan_hang = this.txtNH.Text.Trim(), e_mail = this.txtemail.Text.Trim(), camket = Convert.ToInt16(this.spcamket.Text), ma_km = cmbkm.GetKeyValue(cmbkm.SelectedIndex).ToString(), loai_tb = Convert.ToBoolean(Convert.ToInt16(cmbloaitb.Text.Substring(0,1))), ma_nvcs = cmbcbcs.SelectedIndex == -1 ? S_null : cmbcbcs.GetKeyValue(cmbcbcs.SelectedIndex).ToString(), ma_nvkt = cmbcbkt.SelectedIndex == -1 ? S_null : cmbcbkt.GetKeyValue(cmbcbkt.SelectedIndex).ToString(), dt_lh = this.txtdtlh.Text.Trim(), goi_th = cmbgoith.SelectedIndex == -1 ? S_null : this.cmbgoith.GetKeyValue(cmbgoith.SelectedIndex).ToString().Trim(), id_goicuoc = App.id_goicuoc }; dstb.Gphones.Add(ds); Gphone_log dsl = new Gphone_log { so_dt = this.txtsdt.Text.Trim(), SoSim = this.txtsosim.Text.Trim(), ten_dktb = this.txttentb.Text.Trim(), ten_dkdb = this.txttendb.Text.Trim(), dia_chitb = this.txtdctb.Text.Trim(), dc_tbld = this.txtdcld.Text.Trim(), tuyen_tc = null, pl = Getplkhachhang(cmbnhom.GetKeyValue(cmbnhom.SelectedIndex).ToString().Trim()), may_ngung = "M", ma_huyen = App.ma_huyen, sohopdong = this.txtsohd.Text, ngay_hd = this.dngayhd.DateTime, ma_kh = this.txtmakh.Text, ngay_kn = dngaykn.Text.Trim() == "" ? D_null : this.dngaykn.DateTime, note_ngay_kn = this.txtghichu.Text.Trim(), ms_thue = FunAndPro.ma_st(this.txtmst.Text.Trim()), socmnd = this.txtcmnd.Text.Trim(), noi_cap = this.txtnoicap.Text.Trim(), ngay_cap = this.dngaycap.DateTime, e_mail = this.txtemail.Text.Trim(), camket = Convert.ToInt16(this.spcamket.Text), thoi_gian = App.Current_d, ma_km = cmbkm.GetKeyValue(cmbkm.SelectedIndex).ToString(), ma_nhom = cmbnhom.GetKeyValue(cmbnhom.SelectedIndex).ToString(), ma_nghe = cmbnganh.GetKeyValue(cmbnganh.SelectedIndex).ToString(), loai_tb = Convert.ToBoolean(Convert.ToInt16(cmbloaitb.Text.Substring(0, 1))), ma_nvcs = cmbcbcs.SelectedIndex == -1 ? S_null : cmbcbcs.GetKeyValue(cmbcbcs.SelectedIndex).ToString(), ma_nvkt = cmbcbkt.SelectedIndex == -1 ? S_null : cmbcbkt.GetKeyValue(cmbcbkt.SelectedIndex).ToString(), users = App.User_name, dt_lh = this.txtdtlh.Text.Trim(), goi_th = cmbgoith.SelectedIndex == -1 ? S_null : this.cmbgoith.GetKeyValue(cmbgoith.SelectedIndex).ToString().Trim(), id_goicuoc = App.id_goicuoc }; dstb.Gphone_logs.Add(dsl); dstb.SubmitChanges(OnSubmitCompleted,true); } catch(Exception e) { MessageBox.Show(string.Format("Exception Failed: {0}",e)); } }
/// <summary> /// Deprecated Method for adding a new object to the Gphones EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToGphones(Gphone gphone) { base.AddObject("Gphones", gphone); }