Esempio n. 1
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                if (!GlobalFunctions.checkRights("tsm" + lType.Name, "Update"))
                {
                    return;
                }

                for (int i = 0; i < lCountCol; i++)
                {
                    lRecord[i] = dgvLists.CurrentRow.Cells[i].Value.ToString();
                }

                if (lRecord.Length > 0)
                {
                    if (lRecord[0].ToString() != "")
                    {
                        switch (lType.Name)
                        {
                        case "ChartOfAccount":
                            ChartOfAccountDetailUI loChartOfAccountDetail = new ChartOfAccountDetailUI(lRecord);
                            loChartOfAccountDetail.ParentList = this;
                            loChartOfAccountDetail.ShowDialog();
                            break;

                        case "MainAccount":
                            MainAccountDetailUI loMainAccountDetail = new MainAccountDetailUI(lRecord);
                            loMainAccountDetail.ParentList = this;
                            loMainAccountDetail.ShowDialog();
                            break;

                        case "Classification":
                            ClassificationDetailUI loClassificationDetail = new ClassificationDetailUI(lRecord);
                            loClassificationDetail.ParentList = this;
                            loClassificationDetail.ShowDialog();
                            break;

                        case "SubClassification":
                            SubClassificationDetailUI loSubClassificationDetail = new SubClassificationDetailUI(lRecord);
                            loSubClassificationDetail.ParentList = this;
                            loSubClassificationDetail.ShowDialog();
                            break;

                        case "Bank":
                            BankDetailUI loBankDetail = new BankDetailUI(lRecord);
                            loBankDetail.ParentList = this;
                            loBankDetail.ShowDialog();
                            break;

                        case "Equipment":
                            EquipmentDetailUI loEquipmentDetail = new EquipmentDetailUI(lRecord);
                            loEquipmentDetail.ParentList = this;
                            loEquipmentDetail.ShowDialog();
                            break;

                        case "Building":
                            BuildingDetailUI loBuildingDetail = new BuildingDetailUI(lRecord);
                            loBuildingDetail.ParentList = this;
                            loBuildingDetail.ShowDialog();
                            break;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorMessageUI em = new ErrorMessageUI(ex.Message, this.Name, "btnUpdate_Click");
                em.ShowDialog();
                return;
            }
        }
Esempio n. 2
0
        private void btnCreate_Click(object sender, EventArgs e)
        {
            try
            {
                if (!GlobalFunctions.checkRights("tsm" + lType.Name, "Create"))
                {
                    return;
                }
                if (dgvLists.Rows.Count == 0)
                {
                    refresh("ViewAll", "", "", false);
                }
                switch (lType.Name)
                {
                case "ChartOfAccount":
                    ChartOfAccountDetailUI loChartOfAccountDetail = new ChartOfAccountDetailUI();
                    loChartOfAccountDetail.ParentList = this;
                    loChartOfAccountDetail.ShowDialog();
                    break;

                case "MainAccount":
                    MainAccountDetailUI loMainAccountDetail = new MainAccountDetailUI();
                    loMainAccountDetail.ParentList = this;
                    loMainAccountDetail.ShowDialog();
                    break;

                case "Classification":
                    ClassificationDetailUI loClassificationDetail = new ClassificationDetailUI();
                    loClassificationDetail.ParentList = this;
                    loClassificationDetail.ShowDialog();
                    break;

                case "SubClassification":
                    SubClassificationDetailUI loSubClassificationDetail = new SubClassificationDetailUI();
                    loSubClassificationDetail.ParentList = this;
                    loSubClassificationDetail.ShowDialog();
                    break;

                case "Bank":
                    BankDetailUI loBankDetail = new BankDetailUI();
                    loBankDetail.ParentList = this;
                    loBankDetail.ShowDialog();
                    break;

                case "Equipment":
                    EquipmentDetailUI loEquipmentDetail = new EquipmentDetailUI();
                    loEquipmentDetail.ParentList = this;
                    loEquipmentDetail.ShowDialog();
                    break;

                case "Building":
                    BuildingDetailUI loBuildingDetail = new BuildingDetailUI();
                    loBuildingDetail.ParentList = this;
                    loBuildingDetail.ShowDialog();
                    break;
                }
            }
            catch (Exception ex)
            {
                ErrorMessageUI em = new ErrorMessageUI(ex.Message, this.Name, "btnCreate_Click");
                em.ShowDialog();
                return;
            }
        }