コード例 #1
0
ファイル: TB_Project.cs プロジェクト: tonyyzz/UQingHrMng
        public string GetSlidePicture(string _StrJson)
        {
            StringBuilder sbStr = new StringBuilder();

            sbStr.Append("[{\"msg\":\"获取失败,无匹配数据。\",\"data\":\"\",\"state\":\"1\"}]");
            CommonJsonModel        model = new CommonJsonModel(Regex.Replace(_StrJson, @"\r\n", ""));
            List <CommonJsonModel> lst   = model.GetCollection();

            foreach (CommonJsonModel item in lst)
            {
                string    tempPage     = item.GetValue("_Page");
                string    tempPageSize = item.GetValue("_PageSize");
                int       _Page        = (tempPage != "" && Convert.ToInt32(tempPage) > 0)? Convert.ToInt32(item.GetValue("_Page")) : 1;
                int       _PageSize    = (tempPageSize != "" && Convert.ToInt32(tempPageSize) > 0) ? Convert.ToInt32(item.GetValue("_PageSize")) : 100;
                DataTable dt           = new DataTable();
                DataSet   ds           = new ZhouFu.Bll.DataHandler().GetList("dbo.TB_SlidePicture", "ID,FilePath,Url", "sort", _PageSize, _Page, false, false, "");
                if (ds != null && ds.Tables[0].Rows.Count > 0)
                {
                    dt = ds.Tables[0];
                    sbStr.Clear();
                    sbStr.Append(EasyUIJsonHelper.TableToJson(dt));
                }
            }
            return(sbStr.ToString());
        }
コード例 #2
0
ファイル: sys_manager.cs プロジェクト: tonyyzz/UQingHrMng
        public string GetUserLetter(int _LoginId, int _Page, int _PageSize)
        {
            if (_Page == 0)
            {
                _Page = 1;
            }
            if (_PageSize == 0)
            {
                _PageSize = 10;
            }
            StringBuilder sbStr = new StringBuilder();
            DataSet       ds    = bll.GetList("TB_UsersLog", "id,title,content,read_status,send_time", "send_time", _PageSize, _Page, false, true, string.Format(" receiv_userid={0} and isdel=0", _LoginId));

            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                DataTable dt = ds.Tables[0];
                sbStr.Append("[{\"msg\":\"查询成功,没匹配数据。\",\"data\":");
                sbStr.Append(EasyUIJsonHelper.TableToJson(dt));
                sbStr.Append(",\"state\":\"0\"}]");
            }
            else
            {
                sbStr.Append("[{\"msg\":\"查询成功,没匹配数据。\",\"data\":\"\",\"state\":\"0\"}]");
            }
            return(sbStr.ToString());
        }
コード例 #3
0
ファイル: sys_manager.cs プロジェクト: tonyyzz/UQingHrMng
        public string GetCompanyInformation(int _UserId)
        {
            ZhouFu.Bll.DataHandler bll   = new Bll.DataHandler();
            StringBuilder          sbStr = new StringBuilder();
            string  _Fields   = "ID as CompanyId,MonadName,LogoUrl,Phone,MailBox,Type,NumberOfPeople,Nature,Province,City,County,Address,Describe,Url,userid as LoginId,RegisteredCapital,RunRange";
            string  _SqlWhere = string.Format(" userid='{0}'", _UserId);
            DataSet ds        = bll.GetList("Sm_Monad", _Fields, "ID", 1, 1, false, false, _SqlWhere);

            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                DataTable dt = ds.Tables[0];
                sbStr.Append("[{\"msg\":\"查询成功\",");
                sbStr.Append("\"data\":");
                string  strTemp = EasyUIJsonHelper.TableToJson(dt);
                DataSet dsFile  = bll.GetList("Sm_CaseInformation", "ID,Name,FilePath,bigFilePath", "ID", 100, 1, false, false, "MonadID=" + dt.Rows[0]["LoginId"]);
                if (dsFile != null && dsFile.Tables[0].Rows.Count > 0)
                {
                    DataTable dtFile      = dsFile.Tables[0];
                    string    strTempFile = EasyUIJsonHelper.TableToJson(dtFile);
                    strTemp = strTemp.Insert((strTemp.Length - 2), ",\"FileList\":" + strTempFile);
                }
                sbStr.Append(strTemp);
                sbStr.Append(",\"state\":\"0\"}]");
            }
            else
            {
                sbStr.Append("[{\"msg\":\"查询失败,企业信息不存在\",\"data\":\"\",\"state\":\"1\"}]");
            }
            return(sbStr.ToString());
        }
コード例 #4
0
ファイル: sys_dictionary.cs プロジェクト: tonyyzz/UQingHrMng
        public string GetCitys(string _Action, string _Code)
        {
            StringBuilder sbStr    = new StringBuilder();
            string        Fields   = string.Empty;
            string        SqlWhere = string.Empty;

            switch (_Action)
            {
            case "_Province":
                Fields   = "Code,Province as Name";
                SqlWhere = "LEN(Code)=2";
                break;

            case "_City":
                Fields   = "Code,City as Name";
                SqlWhere = string.Format("LEN(Code)=4 and Code like '{0}%'", _Code);
                break;

            case "_County":
                Fields   = "Code,county as Name";
                SqlWhere = string.Format("LEN(Code)=7 and Code like '{0}%'", _Code);
                break;
            }
            DataTable dt = bll.GetList("sys_City", Fields, "Code", 100, 1, false, false, SqlWhere).Tables[0];

            if (dt.Rows.Count > 0)
            {
                sbStr.Append("[{\"msg\":\"获取成功\",\"data\":" + EasyUIJsonHelper.TableToJson(dt) + ",\"state\":\"0\"}]");
            }
            else
            {
                sbStr.Append("[{\"msg\":\"获取成功,无对应数据,请核实传入参数.\",\"data\":\"\",\"state\":\"1\"}]");
            }
            return(sbStr.ToString());
        }
コード例 #5
0
ファイル: TB_Project.cs プロジェクト: tonyyzz/UQingHrMng
        public string GetApplyForProList(string _StrJson)
        {
            StringBuilder sbStr = new StringBuilder();

            sbStr.Append("[{\"msg\":\"获取失败,内部处理错误。\",\"data\":\"\",\"state\":\"2\"}]");
            try {
                StringBuilder          SqlWhere = new StringBuilder();
                string                 Fields   = "id,title,pro_money,hk_type,hk_month,hope_rate,status";
                CommonJsonModel        model    = new CommonJsonModel(Regex.Replace(_StrJson, @"\r\n", ""));
                List <CommonJsonModel> lst      = model.GetCollection();
                Model.TB_Project       proModel = new Model.TB_Project();
                foreach (CommonJsonModel item in lst)
                {
                    int    Page     = Convert.ToInt32(item.GetValue("_Page"));
                    int    PageSize = Convert.ToInt32(item.GetValue("_PageSize"));
                    string LoginId  = item.GetValue("_LoginId");
                    SqlWhere.AppendFormat("status<=4 and  pub_user={0}", LoginId);
                    DataTable dt = new DataTable();
                    DataSet   ds = new ZhouFu.Bll.DataHandler().GetList("TB_Project", Fields, "id", PageSize, Page, false, true, SqlWhere.ToString());
                    if (ds != null && ds.Tables.Count > 0)
                    {
                        sbStr.Append("[{\"msg\":\"获取数据成功。\",\"data\":" + EasyUIJsonHelper.TableToJson(ds.Tables[0]) + ",\"state\":\"0\"}]");
                    }
                    else
                    {
                        sbStr.Append("[{\"msg\":\"获取数据成功,无匹配数据。\",\"data\":\"\",\"state\":\"1\"}]");
                    }
                }
            }
            catch { }
            return(sbStr.ToString());
        }
コード例 #6
0
ファイル: TB_Project.cs プロジェクト: tonyyzz/UQingHrMng
        public string GetAccountDetails(int _Page, int _PageSize, int _Type, int _LoginId)
        {
            StringBuilder sbStr = new StringBuilder();

            if (_Page == 0)
            {
                _Page = 1;
            }
            if (_PageSize == 0)
            {
                _PageSize = 10;
            }
            string  Fields   = "cz_money,overmoney,add_time,case [jy_type] when 1 then '充值' when 2 then '佣金' when 3 then '奖励' when 4 then '投资' when 5 then '提现' else '' end as [jy_type],case cz_type when 1 then '收入' when 2 then '支出' else '' end as cz_type";
            string  sqlWhere = string.Format("userid={0} and zh_type={1}", _LoginId, _Type);
            DataSet ds       = bll.GetList("TB_AccountDetails", Fields, "add_time", _PageSize, _Page, false, true, sqlWhere);

            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                DataTable dt = ds.Tables[0];
                sbStr.Append("[{\"msg\":\"获取成功。\",\"data\":");
                sbStr.Append(EasyUIJsonHelper.TableToJson(dt));
                sbStr.Append(",\"state\":\"0\"}]");
            }
            else
            {
                sbStr.Append("[{\"msg\":\"获取失败,无匹配数据。\",\"data\":\"\",\"state\":\"1\"}]");
            }
            return(sbStr.ToString());
        }
コード例 #7
0
ファイル: sys_manager.cs プロジェクト: tonyyzz/UQingHrMng
        public string AddCompanyFiles(string _StrJson)
        {
            StringBuilder          sbResult  = new StringBuilder();
            string                 filepath  = string.Empty;
            int                    iRowCount = 0;
            string                 strTemp   = string.Empty;
            CommonJsonModel        model     = new CommonJsonModel(Regex.Replace(_StrJson, @"\r\n", ""));
            List <CommonJsonModel> lst       = model.GetCollection();

            foreach (CommonJsonModel item in lst)
            {
                #region 图片上传
                byte[] imgStream = Convert.FromBase64String(item.GetValue("_Stream"));
                if (!imgStream.Equals(""))
                {
                    string imgname = DateTime.Now.ToString("yyyyMMddHHmmss") + ".png";
                    filepath = "/Upload/" + DateTime.Now.ToString("yyyyMM") + "/" + DateTime.Now.Date.Day.ToString().PadLeft(2, '0') + "/";
                    string webpath = System.Web.HttpContext.Current.Server.MapPath("/" + filepath);
                    if (!Directory.Exists(webpath))    //不存在此目录则创建目录
                    {
                        Directory.CreateDirectory(webpath);
                    }

                    FileStream   fStream = new FileStream((webpath + imgname), FileMode.Create, FileAccess.Write);
                    BinaryWriter bw      = new BinaryWriter(fStream);
                    bw.Write(imgStream);
                    bw.Close();
                    fStream.Close();
                    filepath = filepath + imgname;
                }
                #endregion
                Model.Sm_CaseInformation modelCase = new Model.Sm_CaseInformation();
                modelCase.Add_Time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                modelCase.Describe = item.GetValue("_Describe");
                modelCase.MonadID  = Convert.ToInt32(item.GetValue("_LoginId"));
                modelCase.FilePath = filepath;
                iRowCount          = new Bll.Sm_CaseInformation().Add(modelCase);
                if (iRowCount > 0)
                {
                    DataSet dsFile = new Bll.DataHandler().GetList("Sm_CaseInformation", "ID,Name,FilePath,bigFilePath", "ID", 100, 1, false, false, "MonadID=" + item.GetValue("_LoginId"));
                    if (dsFile != null && dsFile.Tables[0].Rows.Count > 0)
                    {
                        DataTable dtFile = dsFile.Tables[0];
                        strTemp = EasyUIJsonHelper.TableToJson(dtFile);
                    }
                    sbResult.Append("[{\"msg\":\"添加成功\",\"data\":" + strTemp + ",\"state\":\"0\"}]");
                }
                else
                {
                    sbResult.Append("[{\"msg\":\"添加失败,服务器处理出错\",\"data\":\"\",\"state\":\"1\"}]");
                }
            }
            return(sbResult.ToString());
        }
コード例 #8
0
ファイル: sys_dictionary.cs プロジェクト: tonyyzz/UQingHrMng
        public string GetDictionaryList(int _ParentId)
        {
            StringBuilder sbStr = new StringBuilder();

            if (_ParentId > 0)
            {
                DataSet ds = bll.GetList("sys_Dictionary", "ID,DtyName,ParentId", "ID", 100, 1, false, false, "ParentId=" + _ParentId);
                if (ds != null)
                {
                    DataTable dt = ds.Tables[0];
                    if (dt.Rows.Count > 0)
                    {
                        sbStr.Append("[{\"msg\":\"获取成功\",\"data\":" + EasyUIJsonHelper.TableToJson(dt) + ",\"state\":\"0\"}]");
                    }
                    else
                    {
                        sbStr.Append("[{\"msg\":\"获取成功,无对应数据,请核实传入参数.\",\"data\":\"\",\"state\":\"1\"}]");
                    }
                }
            }
            return(sbStr.ToString());
        }
コード例 #9
0
ファイル: TB_Project.cs プロジェクト: tonyyzz/UQingHrMng
        public string GetProjectList(int _Page, int _PageSize, string _Type, string _OrderField, bool _OrderBy)
        {
            StringBuilder sbStr = new StringBuilder();

            if (_Page == 0)
            {
                _Page = 0;
            }
            if (_PageSize == 0)
            {
                _PageSize = 10;
            }
            if (_OrderField == "")
            {
                _OrderField = "pro_starttime";
            }
            StringBuilder sbSqlWhere = new StringBuilder();

            sbSqlWhere.AppendFormat(" status in({0})", "4,6,7");//4,6,7
            sbSqlWhere.AppendFormat(" and pro_type in({0})", _Type);
            sbSqlWhere.Append(" and pro_starttime <= GETDATE() and GETDATE()<=dateadd(dd,1,pro_endtime)");
            string _Fields = "id,pro_number,pro_title,pro_datum_gain,pro_starttime,pro_endtime,pro_Stars,status,pro_money,hk_month,isnull((select user_picture from sys_manager where id=TB_Project.pub_user),'') as pubuserpic,isnull((select SUM(tz_money) from TB_ProjectFinancing where tz_proid=TB_Project.id),0) as nowMoney";
            //true 降序 false 升序
            DataSet ds = bll.GetList("TB_Project", _Fields, _OrderField, _PageSize, _Page, false, _OrderBy, sbSqlWhere.ToString());

            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                DataTable dt = ds.Tables[0];
                sbStr.Append("[{\"msg\":\"获取成功。\",\"data\":");
                sbStr.Append(EasyUIJsonHelper.TableToJson(dt));
                sbStr.Append(",\"state\":\"0\"}]");
            }
            else
            {
                sbStr.Append("[{\"msg\":\"获取失败,无匹配数据。\",\"data\":\"\",\"state\":\"1\"}]");
            }
            return(sbStr.ToString());
        }
コード例 #10
0
ファイル: sys_manager.cs プロジェクト: tonyyzz/UQingHrMng
        public string Login(string _LoginName, string _LoginPassword)
        {
            ZhouFu.Bll.DataHandler bll   = new Bll.DataHandler();
            StringBuilder          sbStr = new StringBuilder();

            try
            {
                string  _Fields   = "ID,user_name,user_mobile,user_email,user_sex,user_province,user_city,user_county,user_address,user_picture,(select LinkPicture from sys_ManagerGrade where ID=sys_manager.user_category) as user_category,(select picture from dbo.TB_HonorSet where  (dbo.sys_Manager.HonorPoints)  BETWEEN  startnumber and endnumber)as HonorSetPic,AccountBalance,DJAccountBalance,JLAccountBalance,IsEmailVerify,IsMobileVerify,IsPersonVerify,RealName,CodeNumber,DealPassword,bank_id,bank_province,bank_city,bank_address,bank_card,login_category,LastTime";
                string  _SqlWhere = string.Format(" login_name='{0}' and login_password='******'", _LoginName, DESEncrypt.GetStringMD5(_LoginPassword));
                DataSet ds        = bll.GetList("sys_manager", _Fields, "ID", 1, 1, false, false, _SqlWhere);
                if (ds != null && ds.Tables[0].Rows.Count > 0)
                {
                    DataTable dt = ds.Tables[0];

                    if (dt.Columns["DealPassword"].ColumnName == "DealPassword")
                    {
                        dt.Rows[0]["DealPassword"] = DESEncrypt.GetStringMD5(dt.Rows[0]["DealPassword"].ToString());
                    }
                    sbStr.Append("[{\"msg\":\"登陆成功\",");
                    sbStr.Append("\"data\":");
                    sbStr.Append(EasyUIJsonHelper.TableToJson(dt));
                    sbStr.Append(",\"state\":\"0\"}]");
                    ZhouFu.Model.sys_Manager mModel = new ZhouFu.Bll.sys_Manager().GetModel(Convert.ToInt32(dt.Rows[0]["ID"]));
                    mModel.LastTime = DateTime.Now;
                    new ZhouFu.Bll.sys_Manager().Update(mModel);
                }
                else
                {
                    sbStr.Append("[{\"msg\":\"登陆失败,用户名或密码错误\",\"data\":\"\",\"state\":\"1\"}]");
                }
            }
            catch
            {
                sbStr.Append("[{\"msg\":\"登陆失败,服务器处理错误\",\"data\":\"\",\"state\":\"2\"}]");
            }
            return(sbStr.ToString());
        }
コード例 #11
0
ファイル: TB_Project.cs プロジェクト: tonyyzz/UQingHrMng
        public string GetNowInvestment(int _Page, int _PageSize, int _LoginId)
        {
            StringBuilder sbStr   = new StringBuilder();
            string        finaIds = new ZhouFu.Bll.TB_ProjectFinancing().GetFieldFormTable("tz_proid", "tz_person=" + _LoginId, "", " group by tz_proid");//获取当前用户投资项目

            if (finaIds != "")
            {
                if (_Page == 0)
                {
                    _Page = 1;
                }                             //当前页
                if (_PageSize == 0)
                {
                    _PageSize = 10;
                }
                ;                                       //每页行数
                StringBuilder sbSqlWhere = new StringBuilder();
                sbSqlWhere.Append("id in (" + finaIds.Trim(',') + ")");
                sbSqlWhere.Append("and status=4");
                DataTable dt = new DataTable();
                DataSet   ds = bll.GetList("dbo.TB_Project", "id as pro_Id,pro_number,pro_title,pro_datum_gain,pro_money,hk_month,[status],pro_Stars,pro_endtime,isnull((select COUNT(tz_person) from TB_ProjectFinancing where tz_proid=TB_Project.id ),0) as allps,isnull((select SUM(tz_money) from TB_ProjectFinancing where tz_proid=TB_Project.id),0) as allmoney", "id", _PageSize, _Page, false, true, sbSqlWhere.ToString());
                if (ds != null && ds.Tables[0].Rows.Count > 0)
                {
                    dt = ds.Tables[0];
                    sbStr.Append("[{\"msg\":\"获取成功。\",\"data\":" + EasyUIJsonHelper.TableToJson(dt) + ",\"state\":\"0\"}]");
                }
                else
                {
                    sbStr.Append("[{\"msg\":\"获取成功,无匹配数据。\",\"data\":\"\",\"state\":\"1\"}]");
                }
            }
            else
            {
                sbStr.Append("[{\"msg\":\"获取成功,无匹配数据。\",\"data\":\"\",\"state\":\"1\"}]");
            }
            return(sbStr.ToString());
        }
コード例 #12
0
ファイル: sys_News.cs プロジェクト: tonyyzz/UQingHrMng
        public string GetNewsList(int _ClassId, int _Page, int _PageSize)
        {
            StringBuilder sbStr = new StringBuilder();

            if (_Page == 0)
            {
                _Page = 1;
            }
            if (_PageSize == 0)
            {
                _PageSize = 10;
            }
            StringBuilder sbSqlWhere = new StringBuilder();

            sbSqlWhere.AppendFormat(" Isdel=0 and ClassId={0} and IsApp=1", _ClassId);
            ZhouFu.Bll.DataHandler bll = new Bll.DataHandler();
            DataSet ds = bll.GetList("sys_News", "ID,Title,Url,AddTime", "AddTime", _PageSize, _Page, false, false, sbSqlWhere.ToString());

            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                DataTable dt = ds.Tables[0];
                sbStr.AppendFormat("[{\"msg\":\"查询成功,无相应的数据。\",\"data\":\"{0}\",\"state\":\"0\"}]", EasyUIJsonHelper.TableToJson(dt));
            }
            else
            {
                sbStr.Append("[{\"msg\":\"查询成功,无相应的数据。\",\"data\":\"\",\"state\":\"0\"}]");
            }
            return(sbStr.ToString());
        }
コード例 #13
0
ファイル: TB_Project.cs プロジェクト: tonyyzz/UQingHrMng
        public string GetNowBackInterest(int _LoginId, int _Page, int _PageSize, int _State)
        {
            StringBuilder sbStr = new StringBuilder();

            if (_LoginId > 0)
            {
                if (_Page == 0)
                {
                    _Page = 1;
                }
                if (_PageSize == 0)
                {
                    _PageSize = 1;
                }
                int           notTop     = (_Page - 1) * _PageSize;                                                                                                                //sql分页
                string        strFields  = "a.id as fcid,a.tz_money,a.tz_jh_money,a.tz_time,a.tz_yield,b.id as proid,b.pro_number,b.pro_title,b.pro_money,b.hk_month,b.pro_money"; //需要查询的字段
                string        strOrderBy = " a.tz_time desc";                                                                                                                      //按投资时间降序
                StringBuilder sbSqlWhere = new StringBuilder();                                                                                                                    //查询条件
                sbSqlWhere.AppendFormat(" a.tz_person={0}", _LoginId);
                sbSqlWhere.AppendFormat(" and b.status={0}", _State);
                StringBuilder sbNotSql = new StringBuilder(); //sql分页语句
                sbNotSql.AppendFormat("select top {0} a.id from TB_ProjectFinancing as a left join TB_Project as b on a.tz_proid=b.id where {1} order by {2}", notTop, sbSqlWhere.ToString(), strOrderBy);
                StringBuilder sbSql = new StringBuilder();    //SQL语句
                sbSql.AppendFormat("select top {0} {1} from TB_ProjectFinancing as a left join TB_Project as b on a.tz_proid=b.id where {2} and a.id not in({3}) order by {4}", _PageSize, strFields, sbSqlWhere.ToString(), sbNotSql.ToString(), strOrderBy);

                DataSet ds = new ZhouFu.Bll.TB_ProjectFinancing().GetListBySQL(sbSql.ToString());
                if (ds != null && ds.Tables[0].Rows.Count > 0)
                {
                    DataTable dt = ds.Tables[0];
                    sbStr.Append("[{\"msg\":\"查询成功。\",\"data\":[");
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        sbStr.Append("{");
                        sbStr.Append("\"pro_title\":\"" + dt.Rows[i]["pro_title"] + "\",");
                        sbStr.Append("\"pro_number\":\"" + dt.Rows[i]["pro_number"] + "\",");
                        sbStr.Append("\"hk_month\":\"" + dt.Rows[i]["hk_month"] + "\",");
                        sbStr.Append("\"tz_money\":\"" + dt.Rows[i]["tz_money"] + "\",");
                        sbStr.Append("\"tz_jh_money\":\"" + dt.Rows[i]["tz_jh_money"] + "\",");
                        sbStr.Append("\"tz_yield\":\"" + dt.Rows[i]["tz_yield"] + "\",");
                        sbStr.Append("\"tz_time\":\"" + dt.Rows[i]["tz_time"] + "\",");
                        sbStr.Append("\"detailedList\":");
                        sbStr.Append(EasyUIJsonHelper.TableToJson(GetCreateTable(dt.Rows[i]["proid"], Convert.ToInt32(dt.Rows[i]["hk_month"]), dt.Rows[i]["tz_money"], dt.Rows[i]["tz_jh_money"], dt.Rows[i]["tz_yield"])));
                        sbStr.Append("}");
                        if (i < dt.Rows.Count - 1)
                        {
                            sbStr.Append(",");
                        }
                    }
                    sbStr.Append("],\"state\":\"0\"}]");
                }
                else
                {
                    sbStr.Append("[{\"msg\":\"查询成功,无匹配数据。\",\"data\":\"\",\"state\":\"1\"}]");
                }
            }
            else
            {
                sbStr.Append("[{\"msg\":\"获取失败,输入参数错误。\",\"data\":\"\",\"state\":\"2\"}]");
            }
            return(sbStr.ToString());
        }