示例#1
0
        private void Load_KichBanKetChuyen_GridView()
        {
            KichBanKetChuyentableController controller = new KichBanKetChuyentableController();

            KichBanKetChuyentableData = new BindingList <KichBanKetChuyentable>(controller.KichBanKetChuyentableSelect(CommonInfo.CompanyInfo.CompanyID));
            KetChuyenKichBan_GridControl.DataSource = KichBanKetChuyentableData;
            this.KichBanKetChuyentableDelete        = new List <KichBanKetChuyentable>();
        }
示例#2
0
        private void KichBanKC_SaveData_simpleButton_Click(object sender, EventArgs e)
        {
            int checkAction = 0;
            KichBanKetChuyentableController controller = new KichBanKetChuyentableController();
            List <KichBanKetChuyentable>    detailData = new List <KichBanKetChuyentable>();

            detailData = this.KichBanKetChuyentableData.Where(item => item.Status == ModifyMode.Insert || item.Status == ModifyMode.Delete).ToList();
            if (controller.SaveKichBanKetChuyentable(detailData))
            {
                checkAction++;
            }
            else
            {
                MessageBoxHelper.ShowInfoMessage(BSMessage.BSM000002);
            }

            #region delete KichBanKC
            if (this.KichBanKetChuyentableDelete?.Count > 0)
            {
                if (controller.SaveKichBanKetChuyentable(KichBanKetChuyentableDelete))
                {
                    checkAction++;
                }
                else
                {
                    checkAction = 0;
                    MessageBoxHelper.ShowInfoMessage(BSMessage.BSM000002);
                }
            }
            #endregion delete KichBanKC

            if (checkAction != 0)
            {
                MessageBoxHelper.ShowInfoMessage(BSMessage.BSM000001);
            }
            Load_KichBanKetChuyen_GridView();
        }