Exemplo n.º 1
0
 /// <summary>
 /// Create a new mytv object.
 /// </summary>
 /// <param name="user_name">Initial value of the user_name property.</param>
 /// <param name="goi_cuoc">Initial value of the goi_cuoc property.</param>
 /// <param name="ma_huyen">Initial value of the ma_huyen property.</param>
 /// <param name="ma_kh">Initial value of the ma_kh property.</param>
 public static mytv Createmytv(global::System.String user_name, global::System.String goi_cuoc, global::System.String ma_huyen, global::System.String ma_kh)
 {
     mytv mytv = new mytv();
     mytv.user_name = user_name;
     mytv.goi_cuoc = goi_cuoc;
     mytv.ma_huyen = ma_huyen;
     mytv.ma_kh = ma_kh;
     return mytv;
 }
Exemplo n.º 2
0
        void SaveData()
        {
            if (App.id_goicuoc == "" && cmbgoith.SelectedIndex >-1)
            {
                MessageBox.Show("Chưa chọn thuê bao tích hợp !");
                return;
            }
            try
            {
                // get_hopdong(App.ma_huyen + "/" + this.dngayhd.DateTime.Year.ToString().Substring(2, 2));
                mytv ds = new mytv
                {
                    user_name = this.txtusr.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(),
                    sohopdong = this.txtsohd.Text.Trim(),
                    ngay_hd = this.dngayhd.DateTime,
                    tuyen_tc = "",
                    goi_cuoc = cmbgoicuoc.GetKeyValue(cmbgoicuoc.SelectedIndex).ToString(),
                    so_dt=this.txtsdt.Text.Trim(),
                    stb_serial = this.txtseri.Text.Trim(),
                   // loai_cap=this.cmbloaicap.Text.Trim().Substring(0,1),
                    ht_ld = this.cmbhtld.Text.Trim().Substring(0, 1),
                    ma_huyen = App.ma_huyen,
                    socmnd = this.txtcmnd.Text.Trim(),
                    noi_cap = this.txtnoicap.Text.Trim(),
                    ngay_cap = this.dngaycap.DateTime,
                    ma_kh = this.txtmakh.Text,
                    ma_tram = cmbtramvt.GetKeyValue(cmbtramvt.SelectedIndex).ToString(),
                    pl = Getplkhachhang(cmbnhom.GetKeyValue(cmbnhom.SelectedIndex).ToString().Trim()),                    
                    tinh_trang="M",                    
                    ngay_kn = this.dngaykn.DateTime,
                    note_ngay_kn = this.txtghichu.Text,                    
                    tenkhkd = FunAndPro.KhongDau(this.txttentb.Text.Trim()),
                    dckd = FunAndPro.KhongDau(this.txtdctb.Text.Trim()),
                    ms_thue = FunAndPro.ma_st(this.txtmst.Text.Trim()),                  
                    duong = App.duong,
                    xa_phuong = App.phuong,
                    khom_ap = App.khom, 
                    maxa=m_phuong,
                    ma_nhom = cmbnhom.GetKeyValue(cmbnhom.SelectedIndex).ToString(),
                    ma_nghe = cmbnganh.GetKeyValue(cmbnganh.SelectedIndex).ToString(),
                    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(),
                    ma_nvcs = cmbcbcs.SelectedIndex == -1 ? "" : cmbcbcs.GetKeyValue(cmbcbcs.SelectedIndex).ToString(),
                    user_login = App.User_name,
                    dt_lh = this.txtdtlh.Text.Trim(),
                    so_119 = so_119,
                    goi_th = cmbgoith.SelectedIndex == -1 ? S_null : this.cmbgoith.GetKeyValue(cmbgoith.SelectedIndex).ToString().Trim(),
                    id_goicuoc = App.id_goicuoc

                };
                dstb.mytvs.Add(ds);


                mytv_log dsl = new mytv_log
                {
                    user_name = this.txtusr.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(),
                    sohopdong = this.txtsohd.Text.Trim(),
                    ngay_hd = this.dngayhd.DateTime,
                    tuyen_tc = "",
                    goi_cuoc = cmbgoicuoc.GetKeyValue(cmbgoicuoc.SelectedIndex).ToString(),
                    so_dt = this.txtsdt.Text.Trim(),
                    stb_serial = this.txtseri.Text.Trim(),
                   // loai_cap = this.cmbloaicap.Text.Trim().Substring(0, 1),
                    ht_ld = this.cmbhtld.Text.Trim().Substring(0, 1),
                    ma_huyen = App.ma_huyen,
                    socmnd = this.txtcmnd.Text.Trim(),
                    noi_cap = this.txtnoicap.Text.Trim(),
                    ngay_cap = this.dngaycap.DateTime,
                    ma_kh = this.txtmakh.Text,                    
                    pl = Getplkhachhang(cmbnhom.GetKeyValue(cmbnhom.SelectedIndex).ToString().Trim()),
                    tinh_trang = "M",
                    ngay_kn = this.dngaykn.DateTime,
                    note_ngay_kn = this.txtghichu.Text,                    
                    ms_thue = FunAndPro.ma_st(this.txtmst.Text.Trim()),                    
                    ngan_hang = this.txtNH.Text.Trim(),
                    ma_km = cmbkm.GetKeyValue(cmbkm.SelectedIndex).ToString(),
                    ma_nhom = cmbnhom.GetKeyValue(cmbnhom.SelectedIndex).ToString(),
                    ma_nghe = cmbnganh.GetKeyValue(cmbnganh.SelectedIndex).ToString(),
                    camket = Convert.ToInt16(this.spcamket.Text),
                    user_login = App.User_name,
                    ma_nvcs = cmbcbcs.SelectedIndex == -1 ? "" : cmbcbcs.GetKeyValue(cmbcbcs.SelectedIndex).ToString(),
                    thoi_gian=App.Current_d,
                    dt_lh = this.txtdtlh.Text.Trim(),
                    goi_th = cmbgoith.SelectedIndex == -1 ? S_null : this.cmbgoith.GetKeyValue(cmbgoith.SelectedIndex).ToString().Trim(),
                    id_goicuoc = cmbgoith.SelectedIndex == -1 ? S_null : App.id_goicuoc
                };
                dstb.mytv_logs.Add(dsl);
                dstb.SubmitChanges(OnSubmitCompleted,true);                
            }
            catch(Exception e)
            {
                MessageBox.Show(string.Format("Exception Failed: {0}",e));
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the mytvs EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTomytvs(mytv mytv)
 {
     base.AddObject("mytvs", mytv);
 }