void OperationInfo(CE_OperatorMode mode, Control cl)
        {
            try
            {
                if (GlobalObject.GeneralFunction.ParentControlIsExist <TabPage>(cl, tpSubjects.Name))
                {
                    if (txtSubjects_Code.Text.Trim().Length == 0)
                    {
                        MessageDialog.ShowPromptMessage("请录入【科目代码】");
                        return;
                    }

                    if (txtSubjects_Name.Text.Trim().Length == 0)
                    {
                        MessageDialog.ShowPromptMessage("请录入【科目名称】");
                        return;
                    }

                    if (txtSubjects_Parent.Text.Trim().Length == 0)
                    {
                        MessageDialog.ShowPromptMessage("请选择【父级科目】");
                        return;
                    }

                    Business_Base_FinanceSubjects subjects = new Business_Base_FinanceSubjects();

                    subjects.SubjectsName = txtSubjects_Name.Text;
                    subjects.SubjectsCode = txtSubjects_Code.Text;
                    subjects.ParentCode   = txtSubjects_Parent.Tag == null ? "" : txtSubjects_Parent.Tag.ToString();

                    _serviceParametersSetting.Operation_FinanceSubjects(mode, subjects);
                }
                else if (GlobalObject.GeneralFunction.ParentControlIsExist <TabPage>(cl, tpPurpose.Name))
                {
                    if (txtPurpose_Code.Text.Trim().Length == 0)
                    {
                        MessageDialog.ShowPromptMessage("请输入【用途代码】");
                        return;
                    }

                    if (txtPurpose_Name.Text.Trim().Length == 0)
                    {
                        MessageDialog.ShowPromptMessage("请输入【用途名称】");
                        return;
                    }

                    if (txtPurpose_ParentName.Text.Trim().Length == 0)
                    {
                        MessageDialog.ShowPromptMessage("请选择【父级用途】");
                        return;
                    }

                    if (txtPurpose_Parent.Text.Trim().Length >= txtPurpose_Code.Text.Trim().Length ||
                        txtPurpose_Code.Text.Trim().Substring(0, txtPurpose_Parent.Text.Trim().Length) != txtPurpose_Parent.Text.ToString())
                    {
                        MessageDialog.ShowPromptMessage("【用途代码】中前面字符未包含【父级用途】代码,例如:【父级代码】:99,则【用途代码】应为:9901、 9902等等");
                        return;
                    }

                    BASE_MaterialRequisitionPurpose purpose = new BASE_MaterialRequisitionPurpose();

                    purpose.Inventory             = chb_Inventory.Checked;
                    purpose.Code                  = txtPurpose_Code.Text;
                    purpose.IsDisable             = true;
                    purpose.IsEnd                 = true;
                    purpose.Purpose               = txtPurpose_Name.Text;
                    purpose.DestructiveInspection = chb_DestructiveInspection.Checked;
                    purpose.ThreeOutSideFit       = chb_ThreeOutSideFit.Checked;
                    purpose.ThreeOutSideRepair    = chb_ThreeOutSideRepair.Checked;
                    purpose.ApplicableDepartment  = txtApplicableDepartment.Tag == null ? "" : txtApplicableDepartment.Tag.ToString();
                    purpose.RemindWord            = txtRemindWord.Text;

                    _serviceParametersSetting.Operation_MaterialRequisitionPurpose(mode, purpose, txtPurpose_Parent.Text.Trim());
                }
                else if (GlobalObject.GeneralFunction.ParentControlIsExist <TabPage>(cl, tpStorage.Name))
                {
                    if (txtStorage_Code.Text.Trim().Length == 0)
                    {
                        MessageDialog.ShowPromptMessage("请录入【库房代码】");
                        return;
                    }

                    if (txtStorage_Name.Text.Trim().Length == 0)
                    {
                        MessageDialog.ShowPromptMessage("请录入【库房名称】");
                        return;
                    }

                    if (txtStorage_Subjects.Text.Trim().Length == 0)
                    {
                        MessageDialog.ShowPromptMessage("请选择【所属科目】");
                        return;
                    }

                    BASE_Storage storage = new BASE_Storage();

                    storage.Aftermarket                   = chbAftermarket.Checked;
                    storage.AftermarketParts              = chbAftermarketParts.Checked;
                    storage.AssemblyWarehouse             = chbAssemblyWarehouse.Checked;
                    storage.FinancialAccountingFlag       = chbFinancialAccountingFlag.Checked;
                    storage.PartInPlanCalculation         = chbPartInPlanCalculation.Checked;
                    storage.SingleFinancialAccountingFlag = chbSingleFinancialAccountingFlag.Checked;
                    storage.WorkShopCurrentAccount        = chbWorkShopCurrentAccount.Checked;
                    storage.ZeroCostFlag                  = chbZeroCostFlag.Checked;

                    storage.StorageID   = txtStorage_Code.Text;
                    storage.StorageName = txtStorage_Name.Text;

                    storage.StorageLv = 1;


                    Business_Base_FinanceRelationInfo_Subjects_Storage storageSubjects =
                        new Business_Base_FinanceRelationInfo_Subjects_Storage();

                    storageSubjects.StorageID    = txtStorage_Code.Text;
                    storageSubjects.SubjectsCode = txtStorage_Subjects.Tag == null ? "" : txtStorage_Subjects.Tag.ToString();

                    _serviceParametersSetting.Operation_StorageInfo(mode, storage, storageSubjects);
                }
                else if (GlobalObject.GeneralFunction.ParentControlIsExist <TabPage>(cl, tpSubjectsPurpose.Name))
                {
                    if (txtSubjectsPurpose_Code.Text.Trim().Length == 0)
                    {
                        MessageDialog.ShowPromptMessage("请选择【领料用途】");
                        return;
                    }

                    if (txtSubjectsPurpose_Subjects.Text.Trim().Length == 0)
                    {
                        MessageDialog.ShowPromptMessage("请选择【所属科目】");
                        return;
                    }

                    Business_Base_FinanceRelationInfo_Subjects_Purpose purposeSubjects =
                        new Business_Base_FinanceRelationInfo_Subjects_Purpose();

                    purposeSubjects.PurposeCode  = txtSubjectsPurpose_Code.Text;
                    purposeSubjects.SubjectsCode = txtSubjectsPurpose_Subjects.Tag == null ?
                                                   "" : txtSubjectsPurpose_Subjects.Tag.ToString();

                    _serviceParametersSetting.Operation_SubjectsPurpose(mode, purposeSubjects);
                }
                else if (GlobalObject.GeneralFunction.ParentControlIsExist <TabPage>(cl, tpBudgetProject.Name))
                {
                    if (txtBudgetProject.Text.Trim().Length == 0)
                    {
                        MessageDialog.ShowPromptMessage("请录入【科目名称】");
                        return;
                    }

                    if (txtBudgetProject_Parent.Text.Trim().Length == 0)
                    {
                        MessageDialog.ShowPromptMessage("请选择【父级科目】");
                        return;
                    }

                    if (txtBudgetProject_Code.Text.Trim().Length == 0)
                    {
                        MessageDialog.ShowPromptMessage("请录入【科目代码】");
                        return;
                    }

                    Business_Base_Finance_Budget_ProjectItem project = new Business_Base_Finance_Budget_ProjectItem();

                    project.PerentProjectID = txtBudgetProject_Parent.Tag == null ? "" : txtBudgetProject_Parent.Tag.ToString();
                    project.ProjectName     = txtBudgetProject.Text;
                    project.ProjectID       = txtBudgetProject_Code.Text;

                    _serviceParametersSetting.Operation_BudgetProject(mode, project);
                }

                MessageDialog.ShowPromptMessage("操作成功");
                ShowInfo();
            }
            catch (Exception ex)
            {
                MessageDialog.ShowPromptMessage(ex.Message);
                return;
            }
        }
        public void Operation_StorageInfo(CE_OperatorMode mode, BASE_Storage info, Business_Base_FinanceRelationInfo_Subjects_Storage info_Relation)
        {
            DepotManagementDataContext ctx = CommentParameter.DepotDataContext;

            var varData = from a in ctx.BASE_Storage
                          where a.StorageID == info.StorageID
                          select a;

            switch (mode)
            {
            case CE_OperatorMode.添加:

                if (varData.Count() > 0)
                {
                    throw new Exception("【代码】:" + info.StorageID + "重复, 无法录入");
                }

                ctx.BASE_Storage.InsertOnSubmit(info);
                ctx.Business_Base_FinanceRelationInfo_Subjects_Storage.InsertOnSubmit(info_Relation);

                break;

            case CE_OperatorMode.修改:

                if (varData.Count() != 1)
                {
                    throw new Exception("【代码】:" + info.StorageID + "为空或者不唯一, 无法录入");
                }

                BASE_Storage temp = varData.Single();

                temp.StorageName = info.StorageName;
                temp.StorageLv   = 1;

                temp.Aftermarket                   = info.Aftermarket;
                temp.AftermarketParts              = info.AftermarketParts;
                temp.AssemblyWarehouse             = info.AssemblyWarehouse;
                temp.FinancialAccountingFlag       = info.FinancialAccountingFlag;
                temp.PartInPlanCalculation         = info.PartInPlanCalculation;
                temp.SingleFinancialAccountingFlag = info.SingleFinancialAccountingFlag;
                temp.WorkShopCurrentAccount        = temp.WorkShopCurrentAccount;
                temp.ZeroCostFlag                  = temp.ZeroCostFlag;

                var varDataX = from a in ctx.Business_Base_FinanceRelationInfo_Subjects_Storage
                               where a.StorageID == info.StorageID
                               select a;

                ctx.Business_Base_FinanceRelationInfo_Subjects_Storage.DeleteAllOnSubmit(varDataX);
                ctx.Business_Base_FinanceRelationInfo_Subjects_Storage.InsertOnSubmit(info_Relation);

                break;

            case CE_OperatorMode.除:

                var varData1 = from a in ctx.S_Stock
                               where a.StorageID == info.StorageID
                               select a;

                var varData2 = from a in ctx.S_InDepotDetailBill
                               where a.StorageID == info.StorageID
                               select a;

                var varData3 = from a in ctx.S_FetchGoodsDetailBill
                               where a.StorageID == info.StorageID
                               select a;

                if (varData1.Count() > 0 || varData2.Count() > 0 || varData3.Count() > 0)
                {
                    throw new Exception("已产生业务,无法删除");
                }

                ctx.BASE_Storage.DeleteAllOnSubmit(varData);

                varDataX = from a in ctx.Business_Base_FinanceRelationInfo_Subjects_Storage
                           where a.StorageID == info.StorageID
                           select a;

                ctx.Business_Base_FinanceRelationInfo_Subjects_Storage.DeleteAllOnSubmit(varDataX);

                break;

            default:
                break;
            }

            ctx.SubmitChanges();
        }