Exemple #1
0
        public static int UpdateCampaign(int id, string save, string EduForm, string StsName, string CmgnTypes, string deleteCmp, int compID, int selectDate = 0)
        {
            int rowsAffected = 0;

            if (save != null)
            {
                SqlDataAccess <int> editCampaign = new SqlDataAccess <int>();

                string[] sqlArr = { @"UPDATE Campaign SET ", " EducationFormFlag = ",
                                    " StatusID = ",          " CampaignTypeID = ", " WHERE Campaign.CampaignID = @CampaignID" };


                string sql = CheckFields(sqlArr, EduForm, StsName, CmgnTypes);


                var p = new
                {
                    CampaignID = compID,
                };

                editCampaign.ChangeInfo(sql, p);

                return(rowsAffected = editCampaign.rowsAffected);
            }
            return(rowsAffected);
        }
        public static int EditMinScore(int minScore, int testItemID, string submitButton)
        {
            int rowsAffected = 0;

            SqlDataAccess <int> editEntrTestItem = new SqlDataAccess <int>();

            string editMinscore = "";

            var minScoreParams = new
            {
                MinScore   = minScore,
                TestitemID = testItemID
            };

            if (submitButton != null)
            {
                editMinscore = @"UPDATE EntranceTestItemC set MinScore = @MinScore  
                          WHERE EntranceTestItemC.EntranceTestItemID = @TestitemID ";


                editEntrTestItem.ChangeInfo(editMinscore, minScoreParams);
                rowsAffected = editEntrTestItem.rowsAffected;
            }

            return(rowsAffected);
        }
        public static int EditCompetitiveGroup(int id, int compGrpId, string EdLvlId, string EdFrmId, string DrctnId, string save)
        {
            int rowsAffected = 0;

            if (save != null)
            {
                var compGroups = new List <CompetitiveGroup>();

                SqlDataAccess <int> editCompGroup = new SqlDataAccess <int>();
                string[]            sqlArr        = { @"UPDATE CompetitiveGroup SET ", " EducationLevelID = ",
                                                      " EducationFormId = ",                             " DirectionID = ", " WHERE CompetitiveGroupID = @CompetitiveGroupID" };

                string sql = CheckFields(sqlArr, EdLvlId, EdFrmId, DrctnId);

                var cgParams = new
                {
                    CompetitiveGroupID = compGrpId
                };

                editCompGroup.ChangeInfo(sql, cgParams);

                return(rowsAffected = editCompGroup.rowsAffected);
            }
            return(rowsAffected);
        }