예제 #1
0
        private void InsertData()
        {
            data = new DTO.NhatKyMuaHang();
            data.IdUser = FormMain.user.Id;
            data.Ten = tbTen.Text;
            data.Date = DateTime.Now;
            data.ThanhTien = ConvertUtil.ConvertToLong(tbThanhTien.Text.Replace(Constant.SYMBOL_LINK_MONEY, string.Empty));
            data.GhiChu = tbGhiChu.Text;

            if (NhatKyMuaHangBus.Insert(data, FormMain.user))
            {
                if (MessageBox.Show(string.Format(Constant.MESSAGE_INSERT_SUCCESS, "Nhật ký mua hàng - " + data.Id) + Constant.MESSAGE_NEW_LINE + Constant.MESSAGE_CONTINUE, Constant.CAPTION_CONFIRMATION, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                {
                    this.Dispose();
                }
                else
                {
                    RefreshData();
                }
            }
            else
            {
                if (MessageBox.Show(string.Format(Constant.MESSAGE_INSERT_ERROR_DUPLICATED, tbTen.Text) +
                    Constant.MESSAGE_NEW_LINE + Constant.MESSAGE_EXIT, Constant.CAPTION_ERROR, MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK)
                {
                    this.Dispose();
                }
            }
        }
예제 #2
0
        public UcInfo()
        {
            InitializeComponent();

            data = new DTO.NhatKyMuaHang();
            isUpdate = false;

            if (Init())
            {
                RefreshData();
            }
            else
            {
                this.Visible = false;
            }
        }
예제 #3
0
        public UcInfo(DTO.NhatKyMuaHang data)
        {
            InitializeComponent();

            this.data = data;
            isUpdate = true;
            lbSelect.Text = Constant.DEFAULT_TITLE_EDIT;

            if (Init())
            {
                tbTen.Text = data.Ten;
                tbThanhTien.Text = data.ThanhTien.ToString(Constant.DEFAULT_FORMAT_MONEY);
                tbGhiChu.Text = data.GhiChu;
            }
            else
            {
                this.Visible = false;
            }
        }
예제 #4
0
 partial void DeleteNhatKyMuaHang(NhatKyMuaHang instance);
예제 #5
0
 partial void UpdateNhatKyMuaHang(NhatKyMuaHang instance);
예제 #6
0
 partial void InsertNhatKyMuaHang(NhatKyMuaHang instance);
예제 #7
0
		private void detach_NhatKyMuaHangs(NhatKyMuaHang entity)
		{
			this.SendPropertyChanging();
			entity.User = null;
		}
예제 #8
0
 public static bool Update(NhatKyMuaHang data, User user)
 {
     return NhatKyMuaHangDao.Update(data, user);
 }
예제 #9
0
 public static bool Insert(NhatKyMuaHang data, User user)
 {
     return NhatKyMuaHangDao.Insert(data, user);
 }