Exemple #1
0
 public static Com.DataPack.DataRsp <string> getcode(string PerCode)
 {
     Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>();
     if (Com.Session.userid == null)
     {
         rsp.code = "expire";
         rsp.msg  = "页面已经过期,请重新登录";
     }
     else
     {
         try
         {
             SchSystem.BLL.SysGrade bll = new SchSystem.BLL.SysGrade();
             DataTable dt = bll.GetList(" top 1 GradeCode", "  GradeType=" + int.Parse(PerCode) + " order by GradeCode desc").Tables[0];
             if (dt != null && dt.Rows.Count > 0)
             {
                 string Code   = dt.Rows[0]["GradeCode"].ToString().Substring(dt.Rows[0]["GradeCode"].ToString().Length - 3);
                 string docode = PerCode + (int.Parse(Code) + 1).ToString("000");
                 rsp.data = docode + "(" + Com.Public.NumberToChinese(int.Parse(Code) + 1) + "年级)";
             }
             else
             {
                 rsp.data = PerCode + "001" + "(一年级)";
             }
         }
         catch (Exception ex)
         {
             rsp.code = "error";
             rsp.msg  = ex.Message;
         }
     }
     return(rsp);
 }
        public static string getschsub(string schid)
        {
            string ret = "";

            Com.DataPack.DataRsp <Com.DataPack.UserInfo> rsp = Com.Public.UserFuncSoure(Com.SoureSession.jsid, Com.SoureSession.jstoken);
            if (rsp.code == "ERROR_TOKEN")
            {
                ret = "expire";
            }
            else
            {
                //获取学校的科目
                SchSystem.BLL.SchSub SchSubBll = new SchSystem.BLL.SchSub();
                DataTable            dtschsub  = SchSubBll.GetList("SubName", "Stat=1 and SchId='" + schid + "'").Tables[0];
                if (dtschsub.Rows.Count > 0)
                {
                    StringBuilder sbSubName = new StringBuilder();
                    foreach (DataRow drSubName in dtschsub.Rows)
                    {
                        sbSubName.Append(drSubName["SubName"] + "、");
                    }
                    ret = sbSubName.ToString().Substring(0, sbSubName.Length - 1);
                }
            }
            return(ret);
        }
 public static Com.DataPack.DataRsp <string> UserOrderSave(List <string> arr)
 {
     Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>();
     if (Com.Session.userid == null)
     {
         rsp.code = "expire";
         rsp.msg  = "你现在登录已过期,请重新登录!";
     }
     else
     {
         try
         {
             SchSystem.BLL.ServUserFor   ssBll   = new SchSystem.BLL.ServUserFor();
             SchSystem.Model.ServUserFor ssModel = new SchSystem.Model.ServUserFor();
             ssModel.FromType = "客服修改";
             foreach (string str in arr)
             {
                 string[] strarr = str.Split('#');
                 if (strarr[0] == "autoid")
                 {
                     ssModel.AutoId = int.Parse(strarr[1]);
                 }
                 if (strarr[0] == "Stat")
                 {
                     ssModel.ServStat = int.Parse(strarr[1]);
                 }
                 if (strarr[0] == "Note")
                 {
                     ssModel.DoNote = strarr[1];
                 }
             }
             //bool resbool = ssBll.Exists(ssModel.SysCode);
             //if (!resbool)
             //{
             bool result = ssBll.Update(ssModel);
             if (result)
             {
                 rsp.code = "success";
                 rsp.msg  = "操作成功";
             }
             else
             {
                 rsp.code = "error";
                 rsp.msg  = "操作失败";
             }
             //}
             //else
             //{
             //    rsp.code = "PlatCodeRepeat";
             //    rsp.msg = "平台代码不允许重复";
             //}
         }
         catch (Exception ex)
         {
             rsp.code = "ExcepError";
             rsp.msg  = ex.Message;
         }
     }
     return(rsp);
 }
Exemple #4
0
 public static Com.DataPack.DataRsp <string> getclass(string gradecode)
 {
     Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>();
     if (Com.Session.userid == null)
     {
         rsp.code = "expire";
         rsp.msg  = "页面已经过期,请重新登录";
     }
     else
     {
         try
         {
             SchSystem.BLL.SchClassInfo schclass = new SchSystem.BLL.SchClassInfo();
             DataTable dtSchClass     = schclass.GetList("ClassName,ClassId", "IsFinish=0 and GradeCode='" + gradecode + "' and SchId='" + SchId + "'").Tables[0];
             string    optionSchClass = "";
             for (int i = 0; i < dtSchClass.Rows.Count; i++)
             {
                 optionSchClass += "<option value=\"" + dtSchClass.Rows[i]["ClassId"].ToString() + "\">" + dtSchClass.Rows[i]["ClassName"].ToString() + "</option>";
             }
             rsp.data = optionSchClass.ToString();
         }
         catch (Exception ex)
         {
             rsp.code = "ExcepError";
             rsp.msg  = ex.Message;
         }
     }
     return(rsp);
 }
Exemple #5
0
 /// <summary>
 /// 获取本地IP
 /// </summary>
 /// <returns></returns>
 public static Com.DataPack.DataRsp <string> GetLocalIP()
 {
     Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>();
     if (Com.Session.userid == null)
     {
         rsp.code = "expire";
         rsp.msg  = "页面已经过期,请重新登录";
     }
     else
     {
         try
         {
             string      HostName = Dns.GetHostName(); //得到主机名
             IPHostEntry IpEntry  = Dns.GetHostEntry(HostName);
             for (int i = 0; i < IpEntry.AddressList.Length; i++)
             {
                 //从IP地址列表中筛选出IPv4类型的IP地址
                 //AddressFamily.InterNetwork表示此IP为IPv4,
                 //AddressFamily.InterNetworkV6表示此地址为IPv6类型
                 if (IpEntry.AddressList[i].AddressFamily == AddressFamily.InterNetwork)
                 {
                     rsp.data = IpEntry.AddressList[i].ToString();
                 }
             }
         }
         catch (Exception ex)
         {
             rsp.code = "ExcepError";
             rsp.msg  = ex.Message;
         }
     }
     return(rsp);
 }
Exemple #6
0
 public static Com.DataPack.DataRsp <string> page(string PageIndex, string PageSize, string txtname, string ustat, string schid)
 {
     Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>();
     if (Com.Session.userid == null)
     {
         rsp.code = "expire";
         rsp.msg  = "你现在登录已过期,请重新登录!";
     }
     else
     {
         try
         {
             SchSystem.BLL.ServType servtypebll = new SchSystem.BLL.ServType();
             string strwhere = " ";
             Com.Public.PageModelResp pages = new Com.Public.PageModelResp();
             pages.PageIndex = int.Parse(PageIndex);
             pages.PageSize  = int.Parse(PageSize);
             int       rowc = 0; int pc = 0;
             DataTable dt = servtypebll.GetListCols("AutoId,TypeName,TypeCode", strwhere, "AutoId", "DESC", pages.PageIndex, pages.PageSize, ref rowc, ref pc).Tables[0];
             pages.PageCount = pc;
             pages.RowCount  = rowc;
             if (dt.Rows.Count > 0)
             {
                 pages.list = dt;
             }
             rsp.RspData = Newtonsoft.Json.JsonConvert.SerializeObject(pages);
         }
         catch (Exception ex)
         {
             rsp.code = "excepError";
             rsp.msg  = ex.Message;
         }
     }
     return(rsp);
 }
 public static Com.DataPack.DataRsp <string> save(string Name, string stat, string AutoId)
 {
     Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>();
     if (Com.Session.userid == null)
     {
         rsp.code = "expire";
         rsp.msg  = "页面已经过期,请重新登录";
     }
     else
     {
         try
         {
             SchSystem.BLL.SysSub   SysSub_bll   = new SchSystem.BLL.SysSub();
             SchSystem.Model.SysSub SysSub_model = new SchSystem.Model.SysSub();
             SysSub_model.SubName = Com.Public.SqlEncStr(Name).ToString();
             SysSub_model.Stat    = Convert.ToInt32(Com.Public.SqlEncStr(stat));
             if (AutoId != "")
             {
                 SysSub_model.AutoId = Convert.ToInt32(AutoId);
                 if (SysSub_bll.Update(SysSub_model))
                 {
                     rsp.code = "success";
                     rsp.msg  = "修改成功";
                 }
             }
             else
             {
                 DataTable dt = SysSub_bll.GetList("top 1 SubCode", " 1=1 order by SubCode DESC").Tables[0];
                 if (dt != null && dt.Rows.Count > 0)
                 {
                     string Code  = dt.Rows[0]["SubCode"].ToString();
                     int    scode = int.Parse(Code) + 1;
                     if (scode < 100)
                     {
                         SysSub_model.SubCode = (int.Parse(Code) + 1).ToString("00");
                     }
                     else
                     {
                         SysSub_model.SubCode = (int.Parse(Code) + 1).ToString("0000");
                     }
                 }
                 else
                 {
                     SysSub_model.SubCode = "01";
                 }
                 if (SysSub_bll.Add(SysSub_model) != 0)
                 {
                     rsp.code = "success";
                     rsp.msg  = "添加成功";
                 }
             }
         }
         catch (Exception ex)
         {
             rsp.code = "error";
             rsp.msg  = ex.Message;
         }
     }
     return(rsp);
 }
        public static string getarea(string typecode, string pcode)
        {
            string ret = "";

            Com.DataPack.DataRsp <Com.DataPack.UserInfo> rsp = Com.Public.UserFuncSoure(Com.SoureSession.jsid, Com.SoureSession.jstoken);
            if (rsp.code == "ERROR_TOKEN")
            {
                ret = "expire";
            }
            else
            {
                try
                {
                    string selp = "";
                    if (typecode != "4")
                    {
                        ret = Com.Public.GetDrpArea(Com.Public.SqlEncStr(typecode), Com.Public.SqlEncStr(pcode), ref selp, false);
                    }
                    else
                    {
                        dptsub ds = new dptsub();
                        ds.dpt = Com.Public.GetDrp("dpt", Com.Public.SqlEncStr(pcode), "1", true, "", "");
                        ds.sub = Com.Public.GetDrp("sub", Com.Public.SqlEncStr(pcode), "1", true, "", "");
                        ret    = Newtonsoft.Json.JsonConvert.SerializeObject(ds);
                    }
                }
                catch (Exception ex)
                {
                    ret = "";
                }
            }
            return(ret);
        }
Exemple #9
0
 public static Com.DataPack.DataRsp <string> AccountIsExist(string account)
 {
     Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>();
     if (Com.Session.userid == null)
     {
         rsp.code = "expire";
         rsp.msg  = "你现在登录已过期,请重新登录!";
     }
     else
     {
         try
         {
             SchSystem.BLL.ServUser suBll = new SchSystem.BLL.ServUser();
             bool result = suBll.Exists(account);//判斷手機號碼是否存在
             if (!result)
             {
                 rsp.code = "success";
                 rsp.msg  = "可以添加";
             }
             else
             {
                 rsp.code = "error";
                 rsp.msg  = "已存在";
             }
         }
         catch (Exception ex)
         {
             rsp.code = "excepError";
             rsp.msg  = ex.Message;
         }
     }
     return(rsp);
 }
 public static Com.DataPack.DataRsp <string> page(string PageIndex, string PageSize, string uname, string ustat)
 {
     Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>();
     try
     {
         BLL.UserInfo user_bll            = new BLL.UserInfo();
         Com.DataPack.PageModelResp pages = new Com.DataPack.PageModelResp();
         pages.PageIndex = int.Parse(PageIndex);
         pages.PageSize  = int.Parse(PageSize);
         int rowc = 0; int pc = 0;
         // ,DepartId,Address,HeadImg,inssj,udsj
         string    cols   = "UserId,UserName,Name,Status,Email,inssj";
         DataTable userdt = user_bll.GetListCols(cols, "1=1", "UserId", "", pages.PageIndex, pages.PageSize, ref rowc, ref pc).Tables[0];
         pages.PageCount = pc;
         pages.RowCount  = rowc;
         if (userdt.Rows.Count > 0)
         {
             pages.list = userdt;
         }
         rsp.data = Newtonsoft.Json.JsonConvert.SerializeObject(pages).Replace("\n\r", "");
     }
     catch (Exception ex)
     {
         throw;
     }
     return(rsp);
 }
        public static Com.DataPack.DataRsp <string> schDatasave(List <string> arr)
        {
            int schid = 0;

            Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>();
            if (Com.Session.userid == null)
            {
                rsp.code = "expire";
                rsp.msg  = "页面已经过期,请重新登录";
            }
            else
            {
                SchSystem.BLL.SchGradeInfo schgradebll = new SchSystem.BLL.SchGradeInfo();

                foreach (string str in arr)
                {
                    string[] strarr = str.Split('#');
                    if (strarr[0] == "schid")
                    {
                        schid = int.Parse(strarr[1]);
                    }
                }
                schgradebll.SupportSysSchGradeAdd(schid);//添加年级
                rsp.code = "Success";
                rsp.msg  = "升级成功";
            }
            return(rsp);
        }
Exemple #12
0
        public static string getarea(string typecode, string pcode)
        {
            string ret = "";

            Com.DataPack.DataRsp <Com.DataPack.UserInfo> rsp = Com.Public.UserFuncSoure(Com.SoureSession.jsid, Com.SoureSession.jstoken);
            if (rsp.code == "ERROR_TOKEN")
            {
                ret = "expire";
            }
            else
            {
                try
                {
                    string selp = "";
                    if (typecode != "6")
                    {
                        ret = Com.Public.GetDrpAreaStu(Com.Public.SqlEncStr(typecode), Com.Public.SqlEncStr(pcode), ref selp, true);
                    }
                    else
                    {
                        ret = Com.Public.GetDrp("dpt", pcode, "1", true, "", "");
                    }
                }
                catch (Exception ex)
                {
                    ret = "";
                }
            }
            return(ret);
        }
Exemple #13
0
 public static Com.DataPack.DataRsp <string> schsubsave(string arr)
 {
     Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>();
     if (Com.Session.userid == null)
     {
         rsp.code = "expire";
         rsp.msg  = "页面已经过期,请重新登录";
     }
     else
     {
         string[] datas = arr.Split('|');
         try
         {
             if (datas.Length > 1)
             {
                 SchSystem.BLL.SchInfo schbll = new SchSystem.BLL.SchInfo();
                 schbll.UpdateSchXXTServStat(int.Parse(datas[0]), int.Parse(datas[1]));
                 rsp.code = "success";
                 rsp.msg  = "操作成功";
             }
         }
         catch (Exception ex)
         {
             rsp.code = "error";
             rsp.msg  = ex.Message;
         }
     }
     return(rsp);
 }
Exemple #14
0
        public static string uprole(string schid, string roleid, string rolename, string rolestr, string rolextstr)
        {
            if (!Com.Public.isVa(schid, ""))
            {
                return("无跨界权限;");
            }
            string ret = "success";

            Com.DataPack.DataRsp <Com.DataPack.UserInfo> rsp = Com.Public.UserFuncSoure(Com.SoureSession.jsid, Com.SoureSession.jstoken);
            if (rsp.code == "ERROR_TOKEN")
            {
                ret = "expire";
            }
            else
            {
                try
                {
                    SchSystem.BLL.SchRole   bll   = new SchSystem.BLL.SchRole();
                    SchSystem.Model.SchRole model = new SchSystem.Model.SchRole();
                    model.RoleId      = int.Parse(roleid);
                    model.RoleName    = Com.Public.SqlEncStr(rolename);
                    model.RoleStr     = rolestr;
                    model.RoleExtStr  = rolextstr;
                    model.Stat        = 1;
                    model.LastRecTime = DateTime.Now;
                    model.LastRecUser = Com.SoureSession.Soureuserid;
                    bll.Update(model);
                }
                catch (Exception ex)
                {
                    ret = ex.Message;
                }
            }
            return(ret);
        }
Exemple #15
0
        public static string studel(int id)
        {
            string ret = "";

            Com.DataPack.DataRsp <Com.DataPack.UserInfo> rsp = Com.Public.UserFuncSoure(Com.SoureSession.jsid, Com.SoureSession.jstoken);
            if (rsp.code == "ERROR_TOKEN")
            {
                ret = "expire";
            }
            else
            {
                try
                {
                    List <string> LstError = new List <string>();

                    if (LstError.Count == 0)
                    {
                        SchSystem.BLL.SchStuInfo bll_stu = new SchSystem.BLL.SchStuInfo();
                        bool Prirow = bll_stu.DeleteRec(Convert.ToInt32(id));
                        if (Prirow == true)
                        {
                            ret = "Success";
                        }
                    }
                }
                catch (Exception)
                {
                    throw;
                }
            }
            return(ret);
        }
 public static Com.DataPack.DataRsp <string> thdel(string AutoId)
 {
     Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>();
     if (Com.Session.userid == null)
     {
         rsp.code = "expire";
         rsp.msg  = "页面已经过期,请重新登录";
     }
     else
     {
         try
         {
             SchSystem.BLL.SchThdInfo bll_th = new SchSystem.BLL.SchThdInfo();
             if (bll_th.Delete(Convert.ToInt32(AutoId)))
             {
                 rsp.code = "success";
                 rsp.msg  = "页面已经过期,请重新登录";
             }
             else
             {
                 rsp.code = "error";
                 rsp.msg  = "操作失败";
             }
         }
         catch (Exception ex)
         {
             rsp.code = "error";
             rsp.msg  = ex.Message;
         }
     }
     return(rsp);
 }
        public static string MoveUpDown(string dptid, string moveType)
        {
            dptid    = Com.Public.SqlEncStr(dptid);
            moveType = Com.Public.SqlEncStr(moveType);
            string ret = "";

            Com.DataPack.DataRsp <Com.DataPack.UserInfo> rsp = Com.Public.UserFuncSoure(Com.SoureSession.jsid, Com.SoureSession.jstoken);
            if (rsp.code == "ERROR_TOKEN")
            {
                ret = "expire";
            }
            else
            {
                if (moveType == "up")//上移
                {
                    moveType = "1";
                }
                else if (moveType == "down")//下移
                {
                    moveType = "0";
                }
                SchSystem.BLL.SchDepartInfo dptbll = new SchSystem.BLL.SchDepartInfo();
                int s = dptbll.ChangeOrderBy(dptid, moveType);
                if (s > 0)
                {
                    ret = "success";
                }
                else if (s == 0)
                {
                    ret = "success01";
                }
            }
            return(ret);
        }
        public static string updpt(string schid, string id, string dptname, string pid, string stat)
        {
            string ret = "";

            Com.DataPack.DataRsp <Com.DataPack.UserInfo> rsp = Com.Public.UserFuncSoure(Com.SoureSession.jsid, Com.SoureSession.jstoken);
            if (rsp.code == "ERROR_TOKEN")
            {
                ret = "expire";
            }
            else
            {
                try
                {
                    SchSystem.BLL.SchDepartInfo   bll   = new SchSystem.BLL.SchDepartInfo();
                    SchSystem.Model.SchDepartInfo model = new SchSystem.Model.SchDepartInfo();
                    model.DepartId    = int.Parse(id);
                    model.Pid         = int.Parse(pid);
                    model.Stat        = int.Parse(stat);
                    model.DepartName  = Com.Public.SqlEncStr(dptname);
                    model.LastRecTime = DateTime.Now;
                    model.LastRecUser = Com.SoureSession.Soureuserid;
                    bll.Update(model);
                    ret = "success";
                }
                catch (Exception ex)
                {
                    ret = ex.Message;
                }
            }
            return(ret);
        }
 public static Com.DataPack.DataRsp <string> UserOrderRenSave(List <string> arr)
 {
     Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>();
     if (Com.Session.userid == null)
     {
         rsp.code = "expire";
         rsp.msg  = "你现在登录已过期,请重新登录!";
     }
     else
     {
         SchSystem.BLL.ServUserFor sufBll = new SchSystem.BLL.ServUserFor();
         string autoid = "";
         string servm  = "";
         string feem   = "";
         string donote = "";
         foreach (string str in arr)
         {
             string[] strarr = str.Split('#');
             if (strarr[0] == "autoid")
             {
                 autoid = strarr[1];
             }
             else if (strarr[0] == "ordertimelen")
             {
                 servm = strarr[1];
             }
             else if (strarr[0] == "payamountren")
             {
                 feem = strarr[1];
             }
             else if (strarr[0] == "note")
             {
                 donote = strarr[1];
             }
         }
         SchSystem.Model.ServUserFor sufModel = sufBll.GetModel(int.Parse(autoid));
         try
         {
             int result = sufBll.ProcAdd(sufModel.UserName, Com.Session.userid, "客服续订", sufModel.ServiceId, int.Parse(servm), int.Parse(feem), donote);
             //bool result = sufBll.UpdateRenewals(sufModel);
             if (result > 0)
             {
                 rsp.code = "success";
                 rsp.msg  = "操作成功";
             }
             else
             {
                 rsp.code = "error";
                 rsp.msg  = "操作失败";
             }
         }
         catch (Exception ex)
         {
             rsp.code = "excepError";
             rsp.msg  = ex.Message;
         }
     }
     return(rsp);
 }
Exemple #20
0
 public static Com.DataPack.DataRsp <string> isalone(string id, string isalone)
 {
     Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>();
     if (Com.Session.userid == null)
     {
         rsp.code = "expire";
         rsp.msg  = "页面已经过期,请重新登录";
     }
     else
     {
         try
         {
             if (!Com.Public.isVa(id, ""))
             {
                 rsp.code = "error";
                 rsp.msg  = "无跨界权限";
             }
             else if (id == Com.Public.getKey("adminschid"))
             {
                 rsp.code = "error";
                 rsp.msg  = "此为系统学校,不允许操作";
             }
             else
             {
                 SchSystem.BLL.SchInfo   bll   = new SchSystem.BLL.SchInfo();
                 SchSystem.Model.SchInfo model = new SchSystem.Model.SchInfo();
                 model.SchId = int.Parse(id);
                 if (isalone == "&times;")//如果传值为×时,则需要修改为单独部署
                 {
                     model.IsAlone = 1;
                 }
                 else//如果传值为√时,则需要取消单独部署
                 {
                     model.IsAlone = 0;
                 }
                 model.AloneTime = DateTime.Now;
                 model.AloneUser = Com.Session.userid;
                 if (bll.UpdateAlone(model))
                 {
                     rsp.code = "success";
                     rsp.msg  = "操作成功";
                 }
                 else
                 {
                     rsp.code = "error";
                     rsp.msg  = "操作失败";
                 }
             }
         }
         catch (Exception ex)
         {
             rsp.code = "error";
             rsp.msg  = ex.Message;
         }
     }
     return(rsp);
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>();
     if (Com.Session.UserId == null)
     {
         rsp.code = "expire";
         rsp.msg  = "页面已经过期,请重新登录";
     }
 }
Exemple #22
0
        public static Com.DataPack.DataRsp <string> udel(string id)
        {
            Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>();
            if (Com.Session.userid == null)
            {
                rsp.code = "expire";
                rsp.msg  = "页面已经过期,请重新登录";
            }
            else
            {
                try
                {
                    //看是否已有新闻关联,需要补


                    SchSystem.BLL.WebSchChn   bll   = new SchSystem.BLL.WebSchChn();
                    SchSystem.Model.WebSchChn model = new SchSystem.Model.WebSchChn();
                    model.ChnId = int.Parse(id);
                    model.Stat  = 2;
                    //删除时判断是否有子栏目
                    if (!bll.Exists(int.Parse(id)))
                    {
                        SchSystem.BLL.WebSchNews bllnew = new SchSystem.BLL.WebSchNews();
                        if (!bllnew.ExistsChn(int.Parse(id)))
                        {
                            if (bll.UpdateStat(model))
                            {
                                rsp.code = "success";
                                rsp.msg  = "操作成功";
                            }
                            else
                            {
                                rsp.code = "error";
                                rsp.msg  = "操作失败";
                            }
                        }
                        else
                        {
                            rsp.code = "error";
                            rsp.msg  = "该栏目下还有文章,请删除文章后再删除该栏目!";
                        }
                    }
                    else
                    {
                        rsp.code = "error";
                        rsp.msg  = "请先删除子栏目!";
                    }
                }
                catch (Exception ex)
                {
                    rsp.code = "error";
                    rsp.msg  = ex.Message;
                }
            }
            return(rsp);
        }
        public static string getarea(string typecode, string pcode, string ustat, string gradecode)
        {
            typecode  = Com.Public.SqlEncStr(typecode);
            pcode     = Com.Public.SqlEncStr(pcode);
            ustat     = Com.Public.SqlEncStr(ustat);
            gradecode = Com.Public.SqlEncStr(gradecode);
            string ret = "";

            Com.DataPack.DataRsp <Com.DataPack.UserInfo> rsp = Com.Public.UserFuncSoure(Com.SoureSession.jsid, Com.SoureSession.jstoken);
            if (rsp.code == "ERROR_TOKEN")
            {
                ret = "expire";
            }
            else
            {
                try
                {
                    string selp = "";
                    if (typecode != "4")
                    {
                        ret = Com.Public.GetDrpArea(typecode, pcode, ref selp, false);
                    }
                    else
                    {
                        SchSystem.BLL.SchClassInfo sciBll = new SchSystem.BLL.SchClassInfo();
                        string strWhere = " IsFinish=0 ";
                        if (pcode != "")
                        {
                            strWhere += " and Schid=" + pcode;
                        }
                        if (gradecode != "" || gradecode != "0")
                        {
                            strWhere += " and GradeId='" + gradecode + "'";
                        }
                        //获取科目组长
                        SchSystem.BLL.SchSubLeader scuBll = new SchSystem.BLL.SchSubLeader();
                        DataTable dssubUser = scuBll.GetListTecSub("*", "schid='" + pcode + "' and Stat=1").Tables[0];

                        DataTable scids = sciBll.GetList("ClassId,ClassName", strWhere).Tables[0];
                        //scids.Select();
                        gradsub ds = new gradsub();
                        ds.grade    = Com.Public.GetDrp("grade", pcode, ustat, true, "", "");//是否已毕业,1毕业,0未毕业
                        ds.subs     = Com.Public.GetDrp("sub", pcode, "1", true, "", "");
                        ds.schclass = scids;
                        ret         = Newtonsoft.Json.JsonConvert.SerializeObject(ds);
                        //ret = Com.Public.GetDrp("sub", Com.Public.SqlEncStr(pcode), "1", true, "", "");
                    }
                }
                catch (Exception ex)
                {
                    ret = "";
                }
            }
            return(ret);
        }
        public static string schsave(string dotype, string schid, string username, string usertid, string password)
        {
            string ret = "";

            Com.DataPack.DataRsp <Com.DataPack.UserInfo> rsp = Com.Public.UserFuncSoure(Com.SoureSession.jsid, Com.SoureSession.jstoken);
            if (rsp.code == "ERROR_TOKEN")
            {
                ret = "expire";
            }
            else
            {
                try
                {
                    //学校名不能为空,
                    if (string.IsNullOrEmpty(username))
                    {
                        ret += "名称不能为空!";
                    }
                    //学校名不能为空,
                    if (password == "123456")
                    {
                        ret += "修改的密码不能为初始密码!";
                    }
                    if (ret == "")
                    {
                        if (dotype == "UpdatePw")
                        {
                            if (Com.SoureSession.Soureuserpw != password)
                            {
                                SchSystem.BLL.SchUserInfo schbll = new SchSystem.BLL.SchUserInfo();
                                bool result = schbll.UpdatePw(int.Parse(usertid), Com.Public.StrToMD5(password));
                                Com.SoureSession.Soureuserpw = password;
                                if (result)
                                {
                                    ret = "success";
                                }
                                else
                                {
                                    ret = "error";
                                }
                            }
                            else
                            {
                                ret = "与原来密码一样";
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    ret = ex.Message;
                }
            }
            return(ret);
        }
        public static string getdpt(string schid, string stat, string selfid, string selid)
        {
            string ret = "";

            Com.DataPack.DataRsp <Com.DataPack.UserInfo> rsp = Com.Public.UserFuncSoure(Com.SoureSession.jsid, Com.SoureSession.jstoken);
            if (rsp.code == "ERROR_TOKEN")
            {
                ret = "expire";
            }
            else
            {
                schid  = Com.Public.SqlEncStr(schid);
                stat   = Com.Public.SqlEncStr(stat);
                selfid = Com.Public.SqlEncStr(selfid);
                selid  = Com.Public.SqlEncStr(selid);

                try
                {
                    if (selfid == "")
                    {
                        SchSystem.BLL.SchDepartInfo dptbll = new SchSystem.BLL.SchDepartInfo();
                        string sqlstr = "stat=1 and SchId=" + Com.Public.SqlEncStr(schid);
                        //if (stat != "")
                        //{
                        //    sqlstr += " and Stat=" + Com.Public.SqlEncStr(stat);
                        //}
                        DataTable dtdept = dptbll.GetList("Pid pId,DepartId id,DepartName name,'false' checked,stat,OrderId ", sqlstr + " Order by OrderId").Tables[0];
                        if (dtdept.Rows.Count == 0)
                        {
                            //给个默认根节点
                            //DataRow dr = dtdept.NewRow();
                            //dr["id"] = "0";
                            //dr["pId"] = DBNull.Value;
                            //dr["name"] = "顶级部门";
                            //dr["checked"] = "false";
                            //dtdept.Rows.Add(dr);
                        }
                        ret = Newtonsoft.Json.JsonConvert.SerializeObject(dtdept);
                    }
                    else if (selfid == "0")//添加时取全部节点的部门树
                    {
                        ret = Com.Public.GetDrp("dpt", schid, "1", true, "", selid);
                    }
                    else//修改时,取没有该节点下的所有子节点的树
                    {
                        ret = Com.Public.GetDrp("dpt", schid, "1", true, selfid, selid);
                    }
                }
                catch (Exception ex)
                {
                    ret = "";
                }
            }
            return(ret.Replace("全部", "顶级部门"));
        }
        public static string getSearch(string schid, string gradecode, string subcode, string ustat)
        {
            schid     = Com.Public.SqlEncStr(schid);
            gradecode = Com.Public.SqlEncStr(gradecode);
            subcode   = Com.Public.SqlEncStr(subcode);
            ustat     = Com.Public.SqlEncStr(ustat);
            string ret = "";

            Com.DataPack.DataRsp <Com.DataPack.UserInfo> rsp = Com.Public.UserFuncSoure(Com.SoureSession.jsid, Com.SoureSession.jstoken);
            if (rsp.code == "ERROR_TOKEN")
            {
                ret = "expire";
            }
            else
            {
                try
                {
                    //年级
                    SchSystem.BLL.SchGradeInfo sgiBLL = new SchSystem.BLL.SchGradeInfo();
                    DataTable dtSchGrade = sgiBLL.GetList(" IsFinish=0 and SchId=" + schid + " order by GradeCode").Tables[0];//得到年级数据列表,并且是为非毕业的年级
                    //年级领导
                    SchSystem.BLL.SchGradeUsers sguBLL = new SchSystem.BLL.SchGradeUsers();
                    dtSchGrade.Columns.Add("GradeBoss");
                    if (dtSchGrade.Rows.Count > 0)
                    {
                        for (int i = 0; i < dtSchGrade.Rows.Count; i++)
                        {
                            dtSchGrade.Rows[i]["GradeBoss"] = sguBLL.GetNames("GradeId=" + dtSchGrade.Rows[i]["GradeId"].ToString());
                        }
                    }
                    //grades = Newtonsoft.Json.JsonConvert.SerializeObject(dtSchGrade);
                    //当前学校所开设的科目
                    SchSystem.BLL.SchSub schsubBll = new SchSystem.BLL.SchSub();
                    DataSet dsSchSub = schsubBll.GetList("Stat=1 and SchId=" + schid);
                    //subs = Newtonsoft.Json.JsonConvert.SerializeObject(dsSchSub);
                    //获取科目教师
                    SchSystem.BLL.SchSubLeader scuBll = new SchSystem.BLL.SchSubLeader();
                    DataSet dssubUser = scuBll.GetListTecSub("*", "schid='" + schid + "' and Stat=1");
                    //subUser = Newtonsoft.Json.JsonConvert.SerializeObject(dssubUser);

                    searchgradsub ds = new searchgradsub();
                    ds.grade  = dtSchGrade;
                    ds.subs   = dsSchSub;
                    ds.subtec = dssubUser;
                    ret       = Newtonsoft.Json.JsonConvert.SerializeObject(ds);
                }
                catch (Exception ex)
                {
                    ret = ex.Message;
                }
            }
            return(ret);
        }
Exemple #27
0
 public static Com.DataPack.DataRsp <string> page(string PageIndex, string PageSize)
 {
     Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>();
     if (Com.Session.userid == null)
     {
         rsp.code = "expire";
         rsp.msg  = "页面已经过期,请重新登录";
     }
     else
     {
         try
         {
             SchSystem.BLL.SysGrade sysarts = new SchSystem.BLL.SysGrade();
             string strwhere = "1=1 ";
             Com.Public.PageModelResp pages = new Com.Public.PageModelResp();
             pages.PageIndex = int.Parse(PageIndex);
             pages.PageSize  = int.Parse(PageSize);
             int       rowc = 0;
             int       pc   = 0;
             DataTable dt   = sysarts.GetListCols("AutoId,GradeName,GradeCode,GradeType,'' PerName", strwhere, "GradeType,GradeCode", "ASC", pages.PageIndex, pages.PageSize, ref rowc, ref pc).Tables[0];
             pages.PageCount = pc;
             pages.RowCount  = rowc;
             if (dt.Rows.Count > 0)
             {
                 SchSystem.BLL.SysPer bllper = new SchSystem.BLL.SysPer();
                 DataTable            dtper  = bllper.GetList("PerName,PerCode", " Stat=1 ").Tables[0];
                 if (dtper.Rows.Count > 0)
                 {
                     for (int i = 0; i < dt.Rows.Count; i++)
                     {
                         dt.Rows[i]["GradeCode"] = dt.Rows[i]["GradeCode"].ToString() + "(" + Com.Public.NumberToChinese(int.Parse(dt.Rows[i]["GradeCode"].ToString().Substring(dt.Rows[i]["GradeCode"].ToString().Length - 3))) + "年级)";
                         DataRow[] dtr = dtper.Select("PerCode='" + dt.Rows[i]["GradeType"].ToString() + "'");
                         if (dtr.Length > 0)
                         {
                             dt.Rows[i]["PerName"] = dtr[0]["PerName"].ToString();
                         }
                     }
                 }
                 //转换所属学段
                 pages.list = dt;
             }
             rsp.data = Newtonsoft.Json.JsonConvert.SerializeObject(pages);
         }
         catch (Exception ex)
         {
             rsp.code = "error";
             rsp.msg  = ex.Message;
         }
     }
     return(rsp);
 }
Exemple #28
0
        public static Com.DataPack.DataRsp <string> page(string PageIndex, string PageSize, string txtname, string ustat, string txtcode)
        {
            Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>();
            if (Com.Session.userid == null)
            {
                rsp.code = "expire";
                rsp.msg  = "页面已经过期,请重新登录";
            }
            else
            {
                try
                {
                    //Stat:0废弃,1正常,2被删除,正常界面不显示删除,超管界面可以考虑
                    string strwhere = "Stat<2 and SchId='" + Com.Session.schid + "' ";

                    if (!string.IsNullOrEmpty(txtcode))
                    {
                        strwhere += " and ChnCode = " + int.Parse(Com.Public.SqlEncStr(txtcode));
                    }
                    if (!string.IsNullOrEmpty(txtname))
                    {
                        strwhere += " and ChnName like '%" + Com.Public.SqlEncStr(txtname) + "%'";
                    }
                    if (!string.IsNullOrEmpty(ustat))
                    {
                        strwhere += " and Stat='" + Com.Public.SqlEncStr(ustat) + "'";
                    }
                    Com.Public.PageModelResp pages = new Com.Public.PageModelResp();
                    pages.PageIndex = int.Parse(PageIndex);
                    pages.PageSize  = int.Parse(PageSize);
                    int rowc = 0;
                    int pc   = 0;
                    SchSystem.BLL.WebSchChn userbll = new SchSystem.BLL.WebSchChn();
                    string    dbcols = "ChnId,Pid,SchId,ChnName,ChnCode,OrderId,Stat,Note";
                    DataTable dt     = userbll.GetListCols(dbcols, strwhere, "ChnCode", "ASC", pages.PageIndex, pages.PageSize, ref rowc, ref pc).Tables[0];
                    pages.PageCount = pc;
                    pages.RowCount  = rowc;
                    if (dt.Rows.Count > 0)
                    {
                        pages.list = dt;
                    }
                    rsp.data = Newtonsoft.Json.JsonConvert.SerializeObject(pages).Replace("\n\r", "");
                }
                catch (Exception ex)
                {
                    rsp.code = "error";
                    rsp.msg  = ex.Message;
                }
            }
            return(rsp);
        }
Exemple #29
0
 public static Com.DataPack.DataRsp <string> udel(string id)
 {
     Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>();
     if (Com.Session.userid == null)
     {
         rsp.code = "expire";
         rsp.msg  = "页面已经过期,请重新登录";
     }
     else
     {
         try
         {
             if (!Com.Public.isVa(id, ""))
             {
                 rsp.code = "error";
                 rsp.msg  = "无跨界权限";
             }
             else if (id == Com.Public.getKey("adminschid"))
             {
                 rsp.code = "error";
                 rsp.msg  = "此为系统学校,不允许操作";
             }
             else
             {
                 SchSystem.BLL.SchInfo   bll   = new SchSystem.BLL.SchInfo();
                 SchSystem.Model.SchInfo model = new SchSystem.Model.SchInfo();
                 model.SchId       = int.Parse(id);
                 model.Stat        = 2;
                 model.LastRecTime = DateTime.Now;
                 model.LastRecUser = Com.Session.userid;
                 if (bll.UpdateStat(model))
                 {
                     rsp.code = "success";
                     rsp.msg  = "操作成功";
                 }
                 else
                 {
                     rsp.code = "error";
                     rsp.msg  = "操作失败";
                 }
             }
         }
         catch (Exception ex)
         {
             rsp.code = "error";
             rsp.msg  = ex.Message;
         }
     }
     return(rsp);
 }
 public static Com.DataPack.DataRsp <string> udel(string id, string stat)
 {
     Com.DataPack.DataRsp <string> rsp = new Com.DataPack.DataRsp <string>();
     if (Com.Session.userid == null)
     {
         rsp.code = "expire";
         rsp.msg  = "页面已经过期,请重新登录";
     }
     else
     {
         try
         {
             bool rel = false;
             SchSystem.BLL.WebSchNews schnewsbll = new SchSystem.BLL.WebSchNews();
             if (stat == "1" || stat == "2" || stat == "0")
             {
                 rel = schnewsbll.Update(int.Parse(id), int.Parse(stat));//软删除
             }
             else
             {
                 if (stat == "5")
                 {
                     stat = "1";
                 }
                 else
                 {
                     stat = "0";
                 }
                 rel = schnewsbll.UpdateIsTop(int.Parse(id), int.Parse(stat));//软删除
             }
             if (!rel)
             {
                 rsp.code = "error";
                 rsp.msg  = "操作失败";
             }
             else
             {
                 rsp.code = "success";
                 rsp.msg  = "操作成功";
             }
         }
         catch (Exception ex)
         {
             rsp.code = "error";
             rsp.msg  = ex.Message;
         }
     }
     return(rsp);
 }