コード例 #1
0
        private void LoadTonBoDuLieu()
        {
            // add footer
            GridColumn column = grvrootmuahang.Columns["Thành Tiền"];

            column.SummaryItem.SummaryType   = SummaryItemType.Sum;
            column.SummaryItem.DisplayFormat = "{0}";

            column = grvrootmuahang.Columns["Số Lượng"];
            column.SummaryItem.SummaryType   = SummaryItemType.Sum;
            column.SummaryItem.DisplayFormat = "{0}";

            int tag      = int.Parse(this.Tag.ToString());
            var roleform = GlobalVar.distRoleForm[tag];

            btntaomoi.Enabled    = roleform.Them;
            btnin.Enabled        = roleform.In_DL;
            btnluuvathem.Enabled = roleform.Sua;
            // load data
            loadata();
            LoaddataTenNCC();
            LoadKhoHang();
            muaHangBUS.XoaChiTietPhieuNhapHangAO();
            grvctmuahang.DataSource = muaHangBUS.LayThongTinHoaDonAo();
            //comboxedit grid control
            LayThongTinHangHoaTruyenVoCombox();
            // format ngay
            cbngay.Properties.NullText      = DateTime.Today.ToString();
            cbngay.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.DateTime;
            cbngay.Properties.Mask.EditMask = "dd/MM/yyyy";
            cbngay.Properties.Mask.UseMaskAsDisplayFormat = true;

            txthanthanhtoan.Properties.NullText      = DateTime.Today.ToString();
            txthanthanhtoan.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.DateTime;
            txthanthanhtoan.Properties.Mask.EditMask = "dd/MM/yyyy";
            txthanthanhtoan.Properties.Mask.UseMaskAsDisplayFormat = true;
        }