private void SaveData() { if (_id != 0) { PROFILE_MEMBER i = new PROFILE_MEMBER(); i.MEM_TYPE = Utils.CIntDef(rdbType.SelectedValue); i.MEM_FULLNAME = txtHovaTen.Text; i.MEM_BIRTHDAY = pickdate_deli.returnDate; i.MEM_FIELD1 = txtDanToc.Text; i.MEM_SEX = Utils.CIntDef(rdbGioiTinh.SelectedValue); i.MEM_NATIONALITY = txtQuocTich.Text; i.MEM_CMND = txtCMND.Text; i.MEM_DATE_CMND = pickdate_CMND.returnDate; i.MEM_ADDRESS_CMND = txtNoiCapCMND.Text; i.MEM_HOUSEHOLD = txtHKTT.Text; i.MEM_ADDRESS = txtTamTru.Text; i.MEM_CAPITAL = Utils.CDecDef(txtVonGop.Text.Replace(",", "")); i.MEM_PERCENT = Utils.CIntDef(txtTyLe.Text.Replace(",", "")); i.MEM_ACTIVE = 1; i.MEM_STATUS = 1; i.MEM_DATE = DateTime.Now; i.PROF_ID = _id; if (rdbType.SelectedValue == "0") { i.MEM_POSTION = txtChucDanh.Text; i.MEM_FIELD2 = txtNguoiGiuChucConLai.Text; } member.Create(i); } else { } }
public virtual void Remove(int id) { try { PROFILE_MEMBER b = this.GetById(id); this.Remove(b); } catch (Exception e) { throw new Exception(e.Message); } }
public virtual void Remove(PROFILE_MEMBER b) { try { db.PROFILE_MEMBERs.DeleteOnSubmit(b); db.SubmitChanges(); } catch (Exception e) { throw new Exception(e.Message); } }
public virtual void Create(PROFILE_MEMBER cus) { try { this.db.PROFILE_MEMBERs.InsertOnSubmit(cus); db.SubmitChanges(); } catch //(Exception e) { //throw new Exception(e.Message); } }
public virtual void Update(PROFILE_MEMBER cus) { try { PROFILE_MEMBER cusOld = this.GetById(cus.ID); cusOld = cus; db.SubmitChanges(); } catch //(Exception e) { //throw new Exception(e.Message); } }