Esempio n. 1
0
        public void GETBDTJDATA(JObject context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo)
        {
            int pdid = 0;

            int.TryParse(P1, out pdid);


            string strSDate = context.Request("sdate") ?? DateTime.Now.AddYears(-20).ToString("yyyy-MM-dd");
            string strEDate = context.Request("edate") ?? DateTime.Now.AddDays(1).ToString("yyyy-MM-dd");


            List <JH_Auth_ExtendMode> ExtendModes = new List <JH_Auth_ExtendMode>();

            ExtendModes = new JH_Auth_ExtendModeB().GetEntities(D => D.ComId == UserInfo.User.ComId && D.PDID == pdid).ToList();
            string strWhere = "";

            if (P2 != "")
            {
                JArray datas = (JArray)JsonConvert.DeserializeObject(P2);
                foreach (JObject item in datas)
                {
                    string filed = (string)item["filed"];
                    if (ExtendModes.Select(D => D.TableFiledColumn).ToList().Contains(filed))
                    {
                        string qtype  = (string)item["qtype"];
                        string qvalue = (string)item["qvalue"];
                        strWhere = CommonHelp.CreateqQsql(filed, qtype, qvalue);
                    }
                }
            }
            string strISGD = context.Request("isGD") ?? "";

            if (strISGD != "")
            {
                strWhere = strWhere + " AND ISGD='" + strISGD.FilterSpecial() + "'";
            }


            string pdfields = context.Request("pdfields") ?? "";

            if (pdfields != "")
            {
                ExtendModes = ExtendModes.Where(d => d.TableFiledColumn == pdfields).ToList();
            }
            if (ExtendModes.Count > 0)
            {
                string    strTempSQL = new Yan_WF_PDB().GetDTHZL(ExtendModes.Select(D => D.TableFiledColumn).ToList().ListTOString(','), pdid.ToString());
                string    strSQL     = strTempSQL + " WHERE CRDATE BETWEEN '" + strSDate + " 01:01:01'  AND '" + strEDate + " 23:59:59' " + strWhere;
                DataTable dt         = new Yan_WF_PDB().GetDTByCommand(strSQL);
                msg.Result  = dt;
                msg.Result1 = ExtendModes;
            }
        }