Ejemplo n.º 1
0
        /// <summary>
        /// 添加专业信息
        /// </summary>
        /// <param name="sp_Id">专业编号</param>
        /// <param name="dp_Id">所属学院</param>
        /// <param name="sp_Name">专业名字</param>
        /// <param name="sp_Remark">专业备注</param>
        /// <param name="sp_Grade">专业所属年级</param>
        /// <returns></returns>
        public void AddSpeciality(string sp_Id, string dp_Id, string sp_Name, string sp_Remark, string sp_Grade)
        {
            int returnMessage = department.AddSpeciality(sp_Id, dp_Id, sp_Name, sp_Remark, sp_Grade);

            switch (returnMessage)
            {
            case -1: JScript.Alert("学院不存在");
                JScript.GoHistory(-1);
                break;

            case 1: JScript.AlertAndRedirect("添加成功!", "AddSpeciality.aspx");
                break;

            case 0: JScript.Alert("添加失败,请重试!");
                JScript.GoHistory(-1);
                break;

            case -2: JScript.Alert("专业编号已存在,请换其他编号!");
                JScript.GoHistory(-1);
                break;
            }
        }