Esempio n. 1
0
        protected void lnkEdit_Click(object sender, EventArgs e)
        {
            if (Utils.LoggedUser == null)
            {
                Response.Redirect("~/login");
            }
            if (Utils.CheckPermission(3, 6, Utils.LoggedUser.Roles) < 1)
            {
                ClientScript.RegisterStartupScript(GetType(), "alert", "lmis.notification.error('" + GetGlobalResourceObject("MessagesResource", "X_NotAuthorized") + @"');", true);

                return;
            }
            var result = MgrSub.GetSubCode(txthdfEdited.Text);

            foreach (var item in result)
            {
                if (item.LanguageID == 1)
                {
                    txtNameEn.Text = item.Name;
                }
                else if (item.LanguageID == 2)
                {
                    txtNameFr.Text = item.Name;
                }
                else if (item.LanguageID == 3)
                {
                    txtNameAr.Text = item.Name;
                }
            }
            ddlGeneralCodesParent.SelectedValue = result[0].GeneralID;
            if (!string.IsNullOrEmpty(result[0].ParentSubCodeID))
            {
                ddlGeneralCodesParent_SelectedIndexChanged(sender, e);
                ddlSubCodesParent.SelectedValue = result[0].ParentSubCodeID;
            }

            MultiView1.ActiveViewIndex = 1;
        }
        public string  Excelcolumns(ReportVM fixedVariables)
        {
            string columns = "";

            columns += fixedVariables.YearID == null || (fixedVariables.YearTo != null && fixedVariables.YearID != null) ? "" : fixedVariables.YearID + "-" + Utils.VariableName("YearID") + ":" + MgrSubCode.GetSubCode(fixedVariables.YearID, 1) + ",";
            columns += fixedVariables.GenderID == null? "": fixedVariables.GenderID + "-" + Utils.VariableName("GenderID") + ":" + MgrSubCode.GetSubCode(fixedVariables.GenderID, 1) + ",";
            columns += fixedVariables.GovID == null ? "": fixedVariables.GovID + "-" + Utils.VariableName("GovID") + ":" + MgrSubCode.GetSubCode(fixedVariables.GovID, 1) + ",";
            columns += fixedVariables.MaritalStatusID == null ? "": fixedVariables.MaritalStatusID + "-" + Utils.VariableName("MaritalStatusID") + ":" + MgrSubCode.GetSubCode(fixedVariables.MaritalStatusID, 1) + ",";
            columns += fixedVariables.EducationLevelID == null ? "": fixedVariables.EducationLevelID + "-" + Utils.VariableName("EducationLevelID") + ":" + MgrSubCode.GetSubCode(fixedVariables.EducationLevelID, 1) + ",";
            columns += fixedVariables.AgeID == null ? "": fixedVariables.AgeID + "-" + Utils.VariableName("AgeID") + ":" + MgrSubCode.GetSubCode(fixedVariables.AgeID, 1) + ",";
            columns += fixedVariables.SectorID == null? "": fixedVariables.SectorID + "-" + Utils.VariableName("SectorID") + ":" + MgrSubCode.GetSubCode(fixedVariables.SectorID, 1) + ",";
            columns += fixedVariables.CountryID == null? "": fixedVariables.CountryID + "-" + Utils.VariableName("CountryID") + ":" + MgrSubCode.GetSubCode(fixedVariables.CountryID, 1) + ",";
            columns += fixedVariables.MonthID == null? "": fixedVariables.MonthID + "-" + Utils.VariableName("MonthID") + ":" + MgrSubCode.GetSubCode(fixedVariables.MonthID, 1) + ",";
            columns += fixedVariables.NationailtyID == null? "": fixedVariables.NationailtyID + "-" + Utils.VariableName("NationailtyID") + ":" + MgrSubCode.GetSubCode(fixedVariables.NationailtyID, 1) + ",";
            columns += fixedVariables.SchoolTypeID == null? "": fixedVariables.SchoolTypeID + "-" + Utils.VariableName("SchoolTypeID") + ":" + MgrSubCode.GetSubCode(fixedVariables.SchoolTypeID, 1) + ",";
            columns += fixedVariables.EconomicActivityID == null? "": fixedVariables.EconomicActivityID + "-" + Utils.VariableName("EconomicActivityID") + ":" + MgrSubCode.GetSubCode(fixedVariables.EconomicActivityID, 1) + ",";
            columns += fixedVariables.GeographicalDistributionID == null? "": fixedVariables.GeographicalDistributionID + "-" + Utils.VariableName("GeographicalDistributionID") + ":" + MgrSubCode.GetSubCode(fixedVariables.GeographicalDistributionID, 1) + ",";
            columns += fixedVariables.GovernoratesGroupID == null? "": fixedVariables.GovernoratesGroupID + "-" + Utils.VariableName("GovernoratesGroupID") + ":" + MgrSubCode.GetSubCode(fixedVariables.GovernoratesGroupID, 1) + ",";
            columns += fixedVariables.GenderRatioID == null? "": fixedVariables.GenderRatioID + "-" + Utils.VariableName("GenderRatioID") + ":" + MgrSubCode.GetSubCode(fixedVariables.GenderRatioID, 1) + ",";
            columns += fixedVariables.EstablishmentID == null? "": fixedVariables.EstablishmentID + "-" + Utils.VariableName("EstablishmentID") + ":" + MgrSubCode.GetSubCode(fixedVariables.EstablishmentID, 1) + ",";
            columns += fixedVariables.UniversityID == null? "": fixedVariables.UniversityID + "-" + Utils.VariableName("UniversityID") + ":" + MgrSubCode.GetSubCode(fixedVariables.UniversityID, 1) + ",";
            columns += fixedVariables.FacultyID == null? "": fixedVariables.FacultyID + "-" + Utils.VariableName("FacultyID") + ":" + MgrSubCode.GetSubCode(fixedVariables.FacultyID, 1) + ",";
            columns += fixedVariables.InistitueID == null? "": fixedVariables.InistitueID + "-" + Utils.VariableName("InistitueID") + ":" + MgrSubCode.GetSubCode(fixedVariables.InistitueID, 1) + ",";
            columns += fixedVariables.DropOutID == null? "": fixedVariables.DropOutID + "-" + Utils.VariableName("DropOutID") + ":" + MgrSubCode.GetSubCode(fixedVariables.DropOutID, 1) + ",";
            columns += fixedVariables.TeahcingPositionsID == null? "": fixedVariables.TeahcingPositionsID + "-" + Utils.VariableName("TeahcingPositionsID") + ":" + MgrSubCode.GetSubCode(fixedVariables.TeahcingPositionsID, 1) + ",";
            columns += fixedVariables.WaterID == null? "": fixedVariables.WaterID + "-" + Utils.VariableName("WaterID") + ":" + MgrSubCode.GetSubCode(fixedVariables.WaterID, 1) + ",";
            columns += fixedVariables.WaterProducerID == null? "": fixedVariables.WaterProducerID + "-" + Utils.VariableName("WaterProducerID") + ":" + MgrSubCode.GetSubCode(fixedVariables.WaterProducerID, 1) + ",";
            columns += fixedVariables.RoadID == null? "": fixedVariables.RoadID + "-" + Utils.VariableName("RoadID") + ":" + MgrSubCode.GetSubCode(fixedVariables.RoadID, 1) + ",";
            columns += fixedVariables.VehicleID == null? "": fixedVariables.VehicleID + "-" + Utils.VariableName("VehicleID") + ":" + MgrSubCode.GetSubCode(fixedVariables.VehicleID, 1) + ",";
            columns += fixedVariables.TransportedItemID == null? "": fixedVariables.TransportedItemID + "-" + Utils.VariableName("TransportedItemID") + ":" + MgrSubCode.GetSubCode(fixedVariables.TransportedItemID, 1) + ",";
            columns += fixedVariables.CargoStatusTravelingID == null? "": fixedVariables.CargoStatusTravelingID + "-" + Utils.VariableName("CargoStatusTravelingID") + ":" + MgrSubCode.GetSubCode(fixedVariables.CargoStatusTravelingID, 1) + ",";
            columns += fixedVariables.TravelStatusID == null? "": fixedVariables.TravelStatusID + "-" + Utils.VariableName("TravelStatusID") + ":" + MgrSubCode.GetSubCode(fixedVariables.TravelStatusID, 1) + ",";
            columns += fixedVariables.CommodityID == null? "": fixedVariables.CommodityID + "-" + Utils.VariableName("CommodityID") + ":" + MgrSubCode.GetSubCode(fixedVariables.CommodityID, 1) + ",";
            columns += fixedVariables.CommodityGroupID == null? "": fixedVariables.CommodityGroupID + "-" + Utils.VariableName("CommodityGroupID") + ":" + MgrSubCode.GetSubCode(fixedVariables.CommodityGroupID, 1) + ",";
            columns += fixedVariables.CaseTypeID == null? "": fixedVariables.CaseTypeID + "-" + Utils.VariableName("CaseTypeID") + ":" + MgrSubCode.GetSubCode(fixedVariables.CaseTypeID, 1) + ",";
            columns += fixedVariables.CaseStatusID == null? "": fixedVariables.CaseStatusID + "-" + Utils.VariableName("CaseStatusID") + ":" + MgrSubCode.GetSubCode(fixedVariables.CaseStatusID, 1) + ",";
            columns += fixedVariables.AssociationsActivityID == null? "": fixedVariables.AssociationsActivityID + "-" + Utils.VariableName("AssociationsActivityID") + ":" + MgrSubCode.GetSubCode(fixedVariables.AssociationsActivityID, 1) + ",";
            columns += fixedVariables.CulturalServiceAssociationsID == null? "": fixedVariables.CulturalServiceAssociationsID + "-" + Utils.VariableName("CulturalServiceAssociationsID") + ":" + MgrSubCode.GetSubCode(fixedVariables.CulturalServiceAssociationsID, 1) + ",";
            columns += fixedVariables.SocialServiceAssociationsID == null? "": fixedVariables.SocialServiceAssociationsID + "-" + Utils.VariableName("SocialServiceAssociationsID") + ":" + MgrSubCode.GetSubCode(fixedVariables.SocialServiceAssociationsID, 1) + ",";
            columns += fixedVariables.IssuedCapitalID == null? "": fixedVariables.IssuedCapitalID + "-" + Utils.VariableName("IssuedCapitalID") + ":" + MgrSubCode.GetSubCode(fixedVariables.IssuedCapitalID, 1) + ",";
            columns += fixedVariables.WaterPollutionIndicatorID == null? "": fixedVariables.WaterPollutionIndicatorID + "-" + Utils.VariableName("WaterPollutionIndicatorID") + ":" + MgrSubCode.GetSubCode(fixedVariables.WaterPollutionIndicatorID, 1) + ",";
            columns += fixedVariables.TransportingFacilityID == null? "": fixedVariables.TransportingFacilityID + "-" + Utils.VariableName("TransportingFacilityID") + ":" + MgrSubCode.GetSubCode(fixedVariables.TransportingFacilityID, 1) + ",";
            columns += fixedVariables.PortNameID == null? "": fixedVariables.PortNameID + "-" + Utils.VariableName("PortNameID") + ":" + MgrSubCode.GetSubCode(fixedVariables.PortNameID, 1) + ",";
            columns += fixedVariables.AirPollutionID == null? "": fixedVariables.AirPollutionID + "-" + Utils.VariableName("AirPollutionID") + ":" + MgrSubCode.GetSubCode(fixedVariables.AirPollutionID, 1) + ",";
            columns += fixedVariables.AreaDateID == null? "": fixedVariables.AreaDateID + "-" + Utils.VariableName("AreaDateID") + ":" + MgrSubCode.GetSubCode(fixedVariables.AreaDateID, 1) + ",";
            columns += fixedVariables.CropsSeasonID == null? "": fixedVariables.CropsSeasonID + "-" + Utils.VariableName("CropsSeasonID") + ":" + MgrSubCode.GetSubCode(fixedVariables.CropsSeasonID, 1) + ",";
            columns += fixedVariables.liveStockID == null? "": fixedVariables.liveStockID + "-" + Utils.VariableName("liveStockID") + ":" + MgrSubCode.GetSubCode(fixedVariables.liveStockID, 1) + ",";
            columns += fixedVariables.OriginPlaceID == null? "": fixedVariables.OriginPlaceID + "-" + Utils.VariableName("OriginPlaceID") + ":" + MgrSubCode.GetSubCode(fixedVariables.OriginPlaceID, 1) + ",";
            columns += fixedVariables.BorrowingPurposeID == null? "": fixedVariables.BorrowingPurposeID + "-" + Utils.VariableName("BorrowingPurposeID") + ":" + MgrSubCode.GetSubCode(fixedVariables.BorrowingPurposeID, 1) + ",";
            columns += fixedVariables.AuthoritySurveillanceID == null? "": fixedVariables.AuthoritySurveillanceID + "-" + Utils.VariableName("AuthoritySurveillanceID") + ":" + MgrSubCode.GetSubCode(fixedVariables.AuthoritySurveillanceID, 1) + ",";
            columns += fixedVariables.ServiceID == null? "": fixedVariables.ServiceID + "-" + Utils.VariableName("ServiceID") + ":" + MgrSubCode.GetSubCode(fixedVariables.ServiceID, 1) + ",";
            columns += fixedVariables.FisheryRegionID == null? "": fixedVariables.FisheryRegionID + "-" + Utils.VariableName("FisheryRegionID") + ":" + MgrSubCode.GetSubCode(fixedVariables.FisheryRegionID, 1) + ",";
            columns += fixedVariables.FoodProductsID == null? "": fixedVariables.FoodProductsID + "-" + Utils.VariableName("FoodProductsID") + ":" + MgrSubCode.GetSubCode(fixedVariables.FoodProductsID, 1) + ",";
            columns += fixedVariables.ChemicalProductID == null? "": fixedVariables.ChemicalProductID + "-" + Utils.VariableName("ChemicalProductID") + ":" + MgrSubCode.GetSubCode(fixedVariables.ChemicalProductID, 1) + ",";
            columns += fixedVariables.PaperPrintingProductID == null? "": fixedVariables.PaperPrintingProductID + "-" + Utils.VariableName("PaperPrintingProductID") + ":" + MgrSubCode.GetSubCode(fixedVariables.PaperPrintingProductID, 1) + ",";
            columns += fixedVariables.RubberPlasticProductID == null? "": fixedVariables.RubberPlasticProductID + "-" + Utils.VariableName("RubberPlasticProductID") + ":" + MgrSubCode.GetSubCode(fixedVariables.RubberPlasticProductID, 1) + ",";
            columns += fixedVariables.TextileProductID == null? "": fixedVariables.TextileProductID + "-" + Utils.VariableName("TextileProductID") + ":" + MgrSubCode.GetSubCode(fixedVariables.TextileProductID, 1) + ",";
            columns += fixedVariables.MetalicEngineeringElectricProductID == null? "": fixedVariables.MetalicEngineeringElectricProductID + "-" + Utils.VariableName("MetalicEngineeringElectricProductID") + ":" + MgrSubCode.GetSubCode(fixedVariables.MetalicEngineeringElectricProductID, 1) + ",";
            columns += fixedVariables.ConstrcutionsMaterialRefractoryProductID == null? "": fixedVariables.ConstrcutionsMaterialRefractoryProductID + "-" + Utils.VariableName("ConstrcutionsMaterialRefractoryProductID") + ":" + MgrSubCode.GetSubCode(fixedVariables.ConstrcutionsMaterialRefractoryProductID, 1) + ",";
            columns += fixedVariables.PetroluemNaturalGasProductID == null? "": fixedVariables.PetroluemNaturalGasProductID + "-" + Utils.VariableName("PetroluemNaturalGasProductID") + ":" + MgrSubCode.GetSubCode(fixedVariables.PetroluemNaturalGasProductID, 1) + ",";
            columns += fixedVariables.TradeID == null? "": fixedVariables.TradeID + "-" + Utils.VariableName("TradeID") + ":" + MgrSubCode.GetSubCode(fixedVariables.TradeID, 1) + ",";
            columns += fixedVariables.CountriesGroupID == null? "": fixedVariables.CountriesGroupID + "-" + Utils.VariableName("CountriesGroupID") + ":" + MgrSubCode.GetSubCode(fixedVariables.CountriesGroupID, 1) + ",";
            columns += fixedVariables.ArrivalMethodID == null? "": fixedVariables.ArrivalMethodID + "-" + Utils.VariableName("ArrivalMethodID") + ":" + MgrSubCode.GetSubCode(fixedVariables.ArrivalMethodID, 1) + ",";
            columns += fixedVariables.HotelTypeID == null? "": fixedVariables.HotelTypeID + "-" + Utils.VariableName("HotelTypeID") + ":" + MgrSubCode.GetSubCode(fixedVariables.HotelTypeID, 1) + ",";
            columns += fixedVariables.RadioStationID == null? "": fixedVariables.RadioStationID + "-" + Utils.VariableName("RadioStationID") + ":" + MgrSubCode.GetSubCode(fixedVariables.RadioStationID, 1) + ",";
            columns += fixedVariables.ProgramTypeID == null? "": fixedVariables.ProgramTypeID + "-" + Utils.VariableName("ProgramTypeID") + ":" + MgrSubCode.GetSubCode(fixedVariables.ProgramTypeID, 1) + ",";
            columns += fixedVariables.SubjectTypeID == null? "": fixedVariables.SubjectTypeID + "-" + Utils.VariableName("SubjectTypeID") + ":" + MgrSubCode.GetSubCode(fixedVariables.SubjectTypeID, 1) + ",";
            columns += fixedVariables.MuseumTypeID == null? "": fixedVariables.MuseumTypeID + "-" + Utils.VariableName("MuseumTypeID") + ":" + MgrSubCode.GetSubCode(fixedVariables.MuseumTypeID, 1) + ",";
            columns += fixedVariables.IndustrySectionsID == null? "": fixedVariables.IndustrySectionsID + "-" + Utils.VariableName("IndustrySectionsID") + ":" + MgrSubCode.GetSubCode(fixedVariables.IndustrySectionsID, 1) + ",";
            columns += fixedVariables.EducationalTypeID == null? "": fixedVariables.EducationalTypeID + "-" + Utils.VariableName("EducationalTypeID") + ":" + MgrSubCode.GetSubCode(fixedVariables.EducationalTypeID, 1) + ",";

            return(columns);
        }