Exemple #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         object obj = Request["action"];
         if (obj != null)
         {
             if (obj.ToString() == "mohu")
             {
                 string name  = Common.NoHTML(Request["name"].ToString());  //模糊搜索值
                 string soft  = Common.NoHTML(Request["soft2"].ToString()); //下拉排序值
                 string soft2 = Common.NoHTML(Request["soft"].ToString());  //下拉排序
                 Response.Write(ConvertJson.ToJson(Bind(name, soft.Trim(), soft2.Trim())));
                 Response.End();
             }
             else if (obj.ToString() == "delImg")
             {
                 string filepath = Request["filepath"];//图片名称
                 Response.Write(DelImg(filepath));
                 Response.End();
             }
         }
         else
         {
             DataTable dt = Bind("", "sabc down", "时间");//默认时间降序
             rptImg.DataSource = dt;
             rptImg.DataBind();
         }
     }
 }
Exemple #2
0
    public string GetDisHT(string goodsinfoID, string DisName, string HtName)
    {
        string str = string.Empty;

        if (DisName != "")
        {
            str += "and dis.DisName like '%" + DisName + "%'";
        }
        if (HtName != "")
        {
            str += "and HospitalName like '%" + HtName + "%'";
        }

        string sql = string.Format(@"select o.DisID,dis.DisName,HtID,HospitalName HtName,o.CompID,sum(od.GoodsNum) GoodsNum,sum(od.GoodsPrice) GoodsPrice from 
DIS_OrderDetail od left join DIS_Order o on od.OrderID=o.ID
left join BD_GoodsInfo info on info.ID=od.GoodsinfoID 
left join BD_Goods g on info.GoodsID=g.ID
left join BD_Distributor dis on dis.ID=o.DisID
left join 
(select GoodsID,HtID,ht.HospitalName from YZT_FirstCamp fc left join YZT_CMerchants cm on cm.ID=fc.CMID
left join SYS_Hospital ht on ht.ID=fc.HtID
where fc.State=2 and fc.dr=0 and cm.dr=0 and cm.IsEnabled=1) CMFC
on od.GoodsinfoID=CMFC.GoodsID
where o.OState in(2,4,5) and o.CompID={0} and info.GoodsID={1} {2}
group by o.DisID,dis.DisName,HtID,HospitalName,o.CompID order by o.DisID ", this.CompID, goodsinfoID, str);

        DataTable ds = SqlHelper.Query(SqlHelper.LocalSqlServer, sql).Tables[0];

        return(ConvertJson.ToJson(ds));
    }
        //获取表头数据
        public ActionResult GetHead(string year, string semester)
        {
            if (string.IsNullOrEmpty(semester))
            {
                if (DateTime.Now.Month == 1 || DateTime.Now.Month > 8)
                {
                    semester = "1";
                }
                else
                {
                    semester = "2";
                }
            }
            int[] sarr = new int[] { 9, 10, 11, 12, 1 };
            if (semester != "1")
            {
                sarr = new int[] { 3, 4, 5, 6, 7 };
            }
            if (string.IsNullOrEmpty(year))
            {
                year = DateTime.Now.Year.ToString();
            }
            var data = JsonConvert.SerializeObject(sarr);
            var json = ConvertJson.ToJson("200", "", "", data, semester, year);

            return(Content(json));
        }
Exemple #4
0
    public void getArticle()
    {
        string parentId = Request["parentId"];
        int    pagenow  = Convert.ToInt32(Request["page"] ?? "0");
        int    pageSize = Convert.ToInt32(Request["pageSize"] ?? "3");
        int    start    = (pagenow - 1) * pageSize + 1;
        int    end      = pagenow * pageSize;

        if (pagenow == 0)
        {
            end = 3;
        }
        string  tearname = new Cms.BLL.C_Column().GetModel(Convert.ToInt32(parentId)).name.ToString();
        string  str      = "SELECT * FROM ( SELECT ROW_NUMBER() OVER (order by T.orderNumber desc, T.articleId desc )AS Row, T.*  from view_channel_" + tearname + " T WHERE parentId=" + parentId + "  ) TT WHERE TT.Row between " + start + " and " + end + "  order by orderNumber desc,articleId desc";
        DataSet ds       = Cms.DBUtility.DbHelperSQL.Query(str);

        if (ds != null && ds.Tables[0].Rows.Count > 0)
        {
            string strJson = ConvertJson.ToJson(ds);
            Response.Write(strJson);
            Response.End();
        }
        else
        {
            Response.Write("{\"status\":1}");
            Response.End();
        }
    }
        //导出图片
        public ActionResult ExportImg(string imgData)
        {
            string json = "";

            if (string.IsNullOrWhiteSpace(imgData))
            {
                json = ConvertJson.ToJson(20001, "", "{}");
                return(Content(json));
            }
            try
            {
                string fname    = DateTime.Now.ToString("yyMMddHHmmssfff");
                string filePath = AppDomain.CurrentDomain.BaseDirectory + "/File/" + fname + ".jpg";
                byte[] arr      = Convert.FromBase64String(imgData.Substring(imgData.IndexOf("base64,") + 7).Trim('\0'));
                using (MemoryStream ms = new MemoryStream(arr))
                {
                    Bitmap bmp = new Bitmap(ms);
                    //新建第二个bitmap类型的bmp2变量。
                    Bitmap bmp2 = new Bitmap(bmp, bmp.Width, bmp.Height);
                    //将第一个bmp拷贝到bmp2中
                    Graphics draw = Graphics.FromImage(bmp2);
                    draw.DrawImage(bmp, 0, 0);
                    draw.Dispose();
                    bmp2.Save(filePath, System.Drawing.Imaging.ImageFormat.Jpeg);
                    ms.Close();
                }
                json = ConvertJson.ToJson("200", "", fname);
                return(Content(json));
            }
            catch (Exception ex)
            {
                json = ConvertJson.ToJson(20001, "", "{}");
                return(Content(json));
            }
        }
        //添加校历说明
        public ActionResult AddSchoolCalendarDesc(jw_schoolcalendar jsc)
        {
            HttpCookie cookie   = Request.Cookies["Gaokao"];
            string     username = cookie["Name"].ToString();

            string schoolid = cookie["SchoolId"].ToString();

            jsc.jw_createTime = DateTime.Now;
            jsc.jw_delflag    = "1";
            jsc.jw_type       = "2";
            jsc.jw_schoolid   = schoolid;
            string where      = " and jw_schoolid='" + jsc.jw_schoolid + "' and jw_schoolyear='" + jsc.jw_schoolYear + "' and jw_semester='" + jsc.jw_semester + "' and jw_month='" + jsc.jw_month + "' and jw_type='2'  and jw_delflag='1'";
            List <jw_schoolcalendar> list = _jwSchoolBll.GetListByWhere(where);

            if (list.Count > 0)
            {
                _jwSchoolBll.UpdateByWhere(jsc, where);
            }
            else
            {
                _jwSchoolBll.Add(jsc);
            }
            var json = ConvertJson.ToJson(200, "", "{}");

            return(Content(json));
        }
        //添加周计划
        public ActionResult Calendar(string year, string month, string week, string semeter, string content)
        {
            HttpCookie         cookie   = Request.Cookies["Gaokao"];
            string             username = cookie["UserId"].ToString();
            string             schoolid = cookie["SchoolId"].ToString();
            List <Jw_calendar> jc       = _xwBll.GetListByWhere(" and jw_schoolid='" + schoolid + "' and jw_username='******' and jw_schoolyear='" + year + "' and jw_semester='" + semeter + "' and jw_month='" + month + "' and jw_week='" + week + "'");
            bool flag;

            if (jc.Count > 0)
            {
                jc[0].jw_Content = content;
                flag             = _xwBll.UpdateByWhere(jc[0], " and jw_schoolid='" + schoolid + "' and jw_username='******' and jw_schoolyear='" + year + "' and jw_semester='" + semeter + "' and jw_month='" + month + "' and jw_week='" + week + "'");
            }
            else
            {
                Jw_calendar jcn = new Jw_calendar();
                jcn.jw_SchoolId   = schoolid;
                jcn.jw_UserName   = username;
                jcn.jw_SchoolYear = year;
                jcn.jw_Semester   = semeter;
                jcn.jw_Month      = Convert.ToInt32(month);
                jcn.jw_Week       = Convert.ToInt32(week);
                jcn.jw_Content    = content;
                jcn.jw_CreateDate = DateTime.Now;
                jcn.jw_UpdateDate = DateTime.Now;
                jcn.jw_DelFlag    = "1";
                flag = _xwBll.Add(jcn);
            }
            if (flag)
            {
                return(Content(ConvertJson.ToJson(200, "", "{}")));
            }
            return(Content(ConvertJson.ToJson(201, "", "{}")));
        }
    public void jctuijian()
    {//保存推荐
        string sql = "select tid,title from h5_wenzhang where tuijian='1'";
        string tb  = ConvertJson.ToJson(SQLHelper.GetTable(sql));

        System.IO.FileStream   myFs = new System.IO.FileStream(System.Web.HttpContext.Current.Server.MapPath(@"~\static_data\video1.json"), System.IO.FileMode.Create); //txtFilePath为生成txt文件的路径
        System.IO.StreamWriter mySw = new System.IO.StreamWriter(myFs);
        mySw.WriteLine(tb);                                                                                                                                             //writeStr为要写入的字符串
        mySw.Close();
        myFs.Close();
        sql = "select tid,title from h5_wenzhang where tuijian='2'";
        tb  = ConvertJson.ToJson(SQLHelper.GetTable(sql));
        System.IO.FileStream   myFs2 = new System.IO.FileStream(System.Web.HttpContext.Current.Server.MapPath(@"~\static_data\video2.json"), System.IO.FileMode.Create); //txtFilePath为生成txt文件的路径
        System.IO.StreamWriter mySw2 = new System.IO.StreamWriter(myFs2);
        mySw2.WriteLine(tb);                                                                                                                                             //writeStr为要写入的字符串
        mySw2.Close();
        myFs2.Close();
        sql = "select tid,title from h5_wenzhang where tuijian='3'";
        tb  = ConvertJson.ToJson(SQLHelper.GetTable(sql));
        System.IO.FileStream   myFs3 = new System.IO.FileStream(System.Web.HttpContext.Current.Server.MapPath(@"~\static_data\video3.json"), System.IO.FileMode.Create); //txtFilePath为生成txt文件的路径
        System.IO.StreamWriter mySw3 = new System.IO.StreamWriter(myFs3);
        mySw3.WriteLine(tb);                                                                                                                                             //writeStr为要写入的字符串
        mySw3.Close();
        myFs3.Close();
        sql = "select tid,title from h5_wenzhang where tuijian='4'";
        tb  = ConvertJson.ToJson(SQLHelper.GetTable(sql));
        System.IO.FileStream   myFs4 = new System.IO.FileStream(System.Web.HttpContext.Current.Server.MapPath(@"~\static_data\video4.json"), System.IO.FileMode.Create); //txtFilePath为生成txt文件的路径
        System.IO.StreamWriter mySw4 = new System.IO.StreamWriter(myFs4);
        mySw4.WriteLine(tb);                                                                                                                                             //writeStr为要写入的字符串
        mySw4.Close();
        myFs4.Close();
    }
Exemple #9
0
    /// <summary>
    /// 得到 前台分页的json格式
    /// </summary>
    /// <param name="count">数据的总条数</param>
    /// <param name="pageSize">每页显示的条数</param>
    /// <param name="dt">数据集</param>
    /// <returns></returns>
    public string CreateJsonToTable(int count, int pageSize, DataTable dt)
    {
        int totalPage = 0;

        //计算总页数
        if (count == 0)
        {   //如果没有查询到数据 totalPage设为1
            totalPage = 1;
        }
        else if (count % pageSize == 0)
        {
            totalPage = count / pageSize;
        }
        else
        {
            totalPage = count / pageSize + 1;
        }
        string head = string.Format("{0}\"pageCount\":\"{1}\",\"totalCount\":\"{2}\",\"rows\":", "{", totalPage, count);
        string json = "";

        if (dt.Rows.Count == 0)
        {
            json = "[]";
        }
        else
        {
            json = ConvertJson.ToJson(dt);
        }
        string write = head + json + "}";

        return(write);
    }
Exemple #10
0
    /// <summary>
    /// 选择商品
    /// </summary>
    /// <returns></returns>
    public string disBing(string goodsinfoid = "")
    {
        List <Hi.Model.DIS_GoodsStock> gstocklist = null;
        StringBuilder strwhere = new StringBuilder();

        //启用库存
        strwhere.AppendFormat("and Inventory>=0 and a.compid=" + this.CompID + " and b.compid=" + this.CompID);
        if (!Util.IsEmpty(goodsinfoid))
        {
            strwhere.AppendFormat(" and a.id in(" + goodsinfoid + ")");
            gstocklist = new Hi.BLL.DIS_GoodsStock().GetList("", " GoodsInfo in( " + goodsinfoid + " )", "");
        }
        DataTable dt = new Hi.BLL.BD_GoodsInfo().GetGoodsModel(strwhere.ToString()).Tables[0];

        if (dt != null && dt.Rows.Count > 0)
        {
            if (gstocklist != null && gstocklist.Count > 0)
            {
                foreach (DataRow item in dt.Rows)
                {
                    List <Hi.Model.DIS_GoodsStock> stock = gstocklist.FindAll(p => p.GoodsInfo == item["ID"].ToString());
                    if (stock != null && stock.Count > 0)
                    {
                        item["Inventory"] = stock[0].StockTotalNum;
                    }
                }
            }
        }
        return(ConvertJson.ToJson(dt));
    }
 public string GetTableStr( )
 {
     System.Data.DataTable dt = new System.Data.DataTable();
     dt = DAL.DbHelper.ExecuteSql_Table("select  [ID],[Workcell],[BayName],[Tool Side],[Model],[CreatedTime],[ExpectedTime]," +
                                        "[Status],[Stencil],[DEK_Pallet],[Profile Board],[Squeegee],[StencilCount],[DEK_PalletCount],[Profile BoardCount],[" +
                                        "SqueegeeCount],[Action] from [T_Task] order by [ExpectedTime] desc ");
     dt.TableName = "data";
     return(ConvertJson.ToJson(dt));
 }
Exemple #12
0
        public string select()
        {
            DBOperator dbo = new DBOperator();
            DataTable  dt  = new DataTable();

            dt = dbo.GetTable("select * from [Match] Order by Mtime Desc");
            string json = ConvertJson.ToJson(dt);

            return(json);
        }
Exemple #13
0
        public string select()
        {
            DBOperator dbo = new DBOperator();
            DataTable  dt  = new DataTable();

            dt = dbo.GetTable("select * from [Link]");
            string json = ConvertJson.ToJson(dt);

            return(json);
        }
Exemple #14
0
        public string select()
        {
            DBOperator dbo = new DBOperator();
            DataTable  dt  = new DataTable();

            dt = dbo.GetTable("select S_name,Tname,Stitle,Spath from [Student],[Teacher],[Studentwork] where Student.S_Uname=Studentwork.S_SUname and Teacher.TUname=Studentwork.S_TUname");
            string json = ConvertJson.ToJson(dt);

            return(json);
        }
Exemple #15
0
        public string select()
        {
            DBOperator dbo = new DBOperator();
            DataTable  dt  = new DataTable();

            //dt = dbo.GetTable("select Tname,Cname,Cpath from [Teacher],[Classes] where Teacher.TUname=Classes.C_TUname");
            dt = dbo.GetTable("select Cname,Cpath from [Classes]");
            string json = ConvertJson.ToJson(dt);

            return(json);
        }
Exemple #16
0
    public string disBings(string OrderOutDetailID = "")
    {
        StringBuilder strwhere = new StringBuilder();

        if (!Util.IsEmpty(OrderOutDetailID))
        {
            strwhere.AppendFormat(" and d.id in(" + OrderOutDetailID + ")");
        }
        DataTable dt = new Hi.BLL.BD_GoodsInfo().getDisGoodsStock(strwhere.ToString()).Tables[0];

        return(ConvertJson.ToJson(dt));
    }
Exemple #17
0
        //public int count()
        //{
        //    DBOperator dbo = new DBOperator();
        //    DataTable dt = new DataTable();
        //    dt = dbo.GetTable("select * from [User]");
        //    int rows = dt.Rows.Count;
        //    return rows;
        //}
        public string select()
        {
            DBOperator dbo = new DBOperator();
            DataTable  dt  = new DataTable();

            dt = dbo.GetTable("select * from [User]");
            string json = ConvertJson.ToJson(dt);

            //int l = json.Length;
            //int a = l;
            return(json);
        }
        //获取校历数据
        public ActionResult GetSchoolCalendar(jw_schoolcalendar jsc)
        {
            HttpCookie cookie   = Request.Cookies["Gaokao"];
            string     username = cookie["Name"].ToString();
            string     schoolid = cookie["SchoolId"].ToString();

            jsc.jw_schoolid = schoolid;
            List <jw_schoolcalendar> list = _jwSchoolBll.GetListByWhere(" and jw_schoolid='" + jsc.jw_schoolid + "' and jw_schoolyear='" + jsc.jw_schoolYear + "' and jw_semester='" + jsc.jw_semester + "' and jw_delflag='1'");
            var data = JsonConvert.SerializeObject(list);
            var json = ConvertJson.ToJson(200, "", data);

            return(Content(json));
        }
Exemple #19
0
        public string GetTableStr( )
        {
            System.Data.DataTable dt = new System.Data.DataTable();
            dt           = new DAL.DbHelper().QueryDataTable("select *  from [EKS_Tlog] order by [ID] desc ");
            dt.TableName = "data";

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                dt.Rows[i]["Log"] = BinaryToString(Convert.ToString(dt.Rows[i]["Log"]));
                dt.Rows[i]["SQL"] = BinaryToString(Convert.ToString(dt.Rows[i]["SQL"]));
            }
            return(ConvertJson.ToJson(dt));
        }
Exemple #20
0
    public string disBings(string OrderOutDetailID = "")
    {
        string strwhere = "  DisID=" + DisID + " ";

        if (!Util.IsEmpty(OrderOutDetailID))
        {
            strwhere += " and id in(" + OrderOutDetailID + ")";
        }
        List <Hi.Model.YZT_GoodsStock> storageDetailList = new Hi.BLL.YZT_GoodsStock().GetList("", strwhere, "");
        DataTable dt = Common.FillDataTable(storageDetailList);

        return(ConvertJson.ToJson(dt));
    }
Exemple #21
0
    public int Fanli  = 0; //是否启用返利
    protected void Page_Load(object sender, EventArgs e)
    {
        object obj = Request["action"];

        if (obj != null)
        {
            if (obj.ToString() == "dislist")
            {
                string compid = Request["compId"] + "";
                string disid  = Request["disId"] + "";
                Response.Write(disBing(compid, disid));
                Response.End();
            }
        }
        if (!IsPostBack)
        {
            DataTable dt = Common.BindDisList(this.CompID.ToString());//代理商绑定
            if (dt != null)
            {
                this.rptDisList.DataSource = dt;
                this.rptDisList.DataBind();
            }
            this.hidType2.Value  = Request.QueryString["type"] + "";//2 再次购买
            this.hidKeyId.Value  = KeyID.ToString();
            this.hidCompId.Value = this.CompID.ToString();
            Fanli = OrderInfoType.rdoOrderAudit("订单支付返利是否启用", CompID).ToInt(0);
            this.hidFanl.Value = Fanli.ToString();                                         //是否启用返利
            IsInve             = OrderInfoType.rdoOrderAudit("商品是否启用库存", CompID).ToInt(0); //是否启用库存
            //代理商列表
            List <Hi.Model.BD_Distributor> list = new Hi.BLL.BD_Distributor().GetList("ID,DisName", "isnull(dr,0)=0 and compid=" + this.CompID, "");
            this.divDisList.InnerText = ConvertJson.ToJson(Common.FillDataTable(list));
            if (KeyID != 0)
            {
                if (Request.QueryString["type"] + "" != "2")
                {
                    Hi.Model.DIS_Order model = new Hi.BLL.DIS_Order().GetModel(KeyID);
                    //判断订单是否可以修改  企业下单订单已审未支付,代理商下单企业不能修改
                    if (model.OState > (int)Enums.OrderState.待审核)
                    {
                        JScript.AlertAndRedirect("订单已被其他人修改,请刷新后再重新操作!", "orderdetail.aspx?top=1&KeyID=" + Common.DesEncrypt(KeyID.ToString(), Common.EncryptKey));
                        return;
                    }
                }
                else
                {
                    this.hidType.Value = Request.QueryString["type"] + "";
                }
                Bind();
            }
        }
    }
Exemple #22
0
    public string disBings(string goodsinfoid = "")
    {
        StringBuilder strwhere = new StringBuilder();

        //启用库存
        // strwhere.AppendFormat(" and a.compid=" + this.CompID );
        if (!Util.IsEmpty(goodsinfoid))
        {
            strwhere.AppendFormat(" and a.id in(" + goodsinfoid + ")");
        }
        DataTable dt = new Hi.BLL.BD_GoodsInfo().GetGoodsModel(strwhere.ToString()).Tables[0];

        return(ConvertJson.ToJson(dt));
    }
        public string GetTableStr(HttpContext context)
        {
            var workcell = context.Request["workcell"];
            var bay      = context.Request["bay"];
            var keywork  = context.Request["keywork"];

            ProcedureParameter[] para = new ProcedureParameter[] {
                new ProcedureParameter("@workcell", workcell),
                new ProcedureParameter("@bay", bay),
                new ProcedureParameter("@keywork", keywork),
            };

            System.Data.DataTable dt = new System.Data.DataTable();
            string sql = @"select  a.[ID],[Workcell],[BayName],isnull([Tool Side],'') as [Tool Side],[Model],[CreatedTime],[ExpectedTime],
                                                    case when  [Status]=2 and datediff(MINUTE,getdate(),ExpectedTime)>=15  then 3 else [status] end  as [Status],
                                                    isnull([Stencil], '') as Stencil,isnull([FeederCar],'') as FeederCar,isnull([Feeder],'') as Feeder,
                                                    isnull([DEK_Pallet],'') as DEK_Pallet,isnull([Profile Board],'') as [Profile Board],isnull([Squeegee],'') as Squeegee,[StencilCount],
                                                    [DEK_PalletCount],[Profile BoardCount],[SqueegeeCount],isnull([Action],'') as Action,a.uph as UPH,a.buildplan as BuildPlan,isnull (a.RealExpectedTime,'')  AS RealExpectedTime,
													CONVERT(varchar,b.ShiftStartTime,108) as ShiftStartTime,CONVERT(varchar,b.shiftEndTime,108) as shiftEndTime ,b.ShiftDescription
                                                    from [EKS_T_Task] a join EKS_T_ShiftInfo b on a.[Shift]=b.ShiftID  where Enble='1' and DATEDIFF(DAY,getdate(),ExpectedTime)>=0 ";

            if (!string.IsNullOrWhiteSpace(workcell))
            {
                sql = $"{sql}  and workcell =@workcell";
            }

            if (!string.IsNullOrWhiteSpace(bay))
            {
                sql = $"{sql}  and BayName =@bay";
            }

            if (!string.IsNullOrWhiteSpace(keywork))
            {
                sql = $"{sql}  and ( Workcell like '%'+@keywork+'%' or BayName like '%'+@keywork+'%' or model like '%'+@keywork+'%' )";
            }

            sql = $"{sql}  order by  [ExpectedTime] asc";

            try
            {
                dt           = new DAL.DbHelper().QueryDataTable(sql, para);
                dt.TableName = "data";
            }
            catch (Exception ex)
            {
            }

            return(ConvertJson.ToJson(dt));
        }
Exemple #24
0
        //单用户登录
        private void CheckUserSingle(HttpActionContext actionContext, bool IsCheckUser)
        {
            if (IsCheckUser == false)
            {
                return;
            }
            else //单用户登录校验
            {
                try
                {
                    //如果是后台管理请求的数据则直接跳过 不做单用户校验
                    var CheckAdminNoUserSingle = actionContext.Request.Headers.GetValues("AdminNoUserSingle");
                    if (CheckAdminNoUserSingle != null)
                    {
                        return;
                    }
                }
                catch (Exception ex)
                {
                }

                var httpContext = HttpContext.Current;
                var json        = new JSONResult <string>();
                json.Result = "单用户登录";
                json.ret    = 3;

                if (actionContext.Request.Headers.Authorization == null)
                {
                    actionContext.Response = new System.Net.Http.HttpResponseMessage()
                    {
                        Content = new System.Net.Http.StringContent(ConvertJson.ToJson(json)),

                        StatusCode = System.Net.HttpStatusCode.Unauthorized
                    };
                    return;
                }

                var HeadersToken = actionContext.Request.Headers.Authorization.Parameter;
                var token        = _redis.HashGet <string>(RedisGroup.SingleUserGroup, HeadersToken);
                if (token == null || token == "" || token == "null")
                {
                    actionContext.Response = new System.Net.Http.HttpResponseMessage()
                    {
                        Content    = new System.Net.Http.StringContent(ConvertJson.ToJson(json)),
                        StatusCode = System.Net.HttpStatusCode.Unauthorized
                    };
                }
            }
        }
Exemple #25
0
    /// <summary>
    /// 根据属性id得到属性值
    /// </summary>
    /// <returns></returns>
    public string GetAttrValue(string str)
    {
        string list = string.Empty;
        List <Hi.Model.BD_AttributeValues> ll = new Hi.BLL.BD_AttributeValues().GetList("", "AttributeID=" + str + " and ISNULL(dr,0)=0 and ComPid=" + this.CompID + " and isenabled=1", "");

        if (ll.Count > 0)
        {
            DataTable dt2 = Common.FillDataTable <Hi.Model.BD_AttributeValues>(ll);
            if (dt2.Rows.Count != 0)
            {
                return(ConvertJson.ToJson(dt2));
            }
        }
        return("[{}]");
    }
Exemple #26
0
    /// <summary>
    /// 根据区域id得到代理商
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    public string GetDisList(string areaId)
    {
        string aredIdList = Common.DisAreaId(Convert.ToInt32(areaId), this.CompID);//递归得到区域id
        List <Hi.Model.BD_Distributor> ll = new Hi.BLL.BD_Distributor().GetList("ID,DisName", "isnull(dr,0)=0 and compId=" + this.CompID + " and areaId in(" + aredIdList + ")", "");

        if (ll.Count > 0)
        {
            DataTable dt2 = Common.FillDataTable <Hi.Model.BD_Distributor>(ll);
            if (dt2.Rows.Count != 0)
            {
                return(ConvertJson.ToJson(dt2));
            }
        }
        return("[{}]");
    }
        public string GetTableStr(string Model)
        {
            //string Modles = "'T6B60-60002','C5F98-60002','B5L47-60002','G3Q47-60001','G3Q47-60001-C','G3Q35-60001','G3Q35-60001-C','G3Q34-60001','G3Q50-60001','G3Q50-60001-C'";

            string cmdText_Part = @"select  M.ToolID,P.ProcessFieldName, M.ProcessFieldValue from dbo.T_Tools_Attribute " +
                                  "as M inner join dbo.T_ProcessField as P on M.ProcessFieldID=P.ProcessFieldID " +
                                  "where  ToolID in ( " +
                                  "select distinct ToolID  from  " +
                                  "dbo.T_Tools_Attribute where ProcessFieldValue like '%" + Model + "%' )  " +
                                  "and P.ProcessFieldName in ('Customer','Slot No','Model','Tool Side')"; //'Serial Number',
            DataTable dt_Part = SqlHelper.GetDataTableOfRecord(cmdText_Part);

            dt_Part.TableName = "Data";

            string cmdText_Main = @"select M.ToolID,T.ToolTypeName, M.ToolSN,P.ProcessDesc as 'Status',M.LastUpdatedDate from dbo.T_Tools as M  " +   //M.CustomerID,
                                  "inner join dbo.T_Process P on M.Status=P.ProcessID  inner join dbo.T_Type T on M.ToolTypeID=T.ToolTypeID " +
                                  "where P.ProcessDesc='Storage' and  M.ToolID in ( " +
                                  "select distinct ToolID  from  " +
                                  "dbo.T_Tools_Attribute where ProcessFieldValue like '%" + Model + "%' )";
            DataTable dt_Main = SqlHelper.GetDataTableOfRecord(cmdText_Main);

            string[] NewField = new string[] { "Model", "Slot No", "Tool Side", "Customer" };
            for (int i = 0; i < NewField.Length; i++)
            {
                dt_Main.Columns.Add(NewField[i]);
            }


            for (int i = 0; i < dt_Main.Rows.Count; i++)
            {
                for (int j = 0; j < NewField.Length; j++)
                {
                    string fieldName = NewField[j];
                    var    rows      = dt_Part.Select("ToolID=" +
                                                      Convert.ToString(dt_Main.Rows[i]["ToolID"]) + " and ProcessFieldName='" + fieldName + "'");
                    if (rows.Length > 0)
                    {
                        dt_Main.Rows[i][fieldName] = rows[0]["ProcessFieldValue"];
                        continue;
                    }
                }
            }

            // dt_Main.Columns.Remove("ToolID");
            dt_Main.DefaultView.Sort = "Model ASC";
            dt_Main = dt_Main.DefaultView.ToTable();
            return(ConvertJson.ToJson(dt_Main));
        }
Exemple #28
0
    public void getBanner()
    {
        DataSet ds = new Cms.BLL.C_ad().GetList(3, "adtype=1", "id desc");

        if (ds != null && ds.Tables[0].Rows.Count > 0)
        {
            string strJson = ConvertJson.ToJson(ds);
            Response.Write(strJson);
            Response.End();
        }
        else
        {
            Response.Write("");
            Response.End();
        }
    }
Exemple #29
0
    public void getCply()
    {
        DataSet dsCply = new Cms.BLL.C_article().GetList(2, "parentId=125", "orderNumber desc,articleId desc");

        if (dsCply != null && dsCply.Tables[0].Rows.Count > 0)
        {
            string strJson = ConvertJson.ToJson(dsCply);
            Response.Write(strJson);
            Response.End();
        }
        else
        {
            Response.Write("");
            Response.End();
        }
    }
Exemple #30
0
    public void getProductDe()
    {
        string  id = Request["id"];
        DataSet ds = new Cms.BLL.C_article_product().GetList(1, "article_id=" + id, "id desc");

        if (ds != null && ds.Tables[0].Rows.Count > 0)
        {
            string strJson = ConvertJson.ToJson(ds);
            Response.Write(strJson);
            Response.End();
        }
        else
        {
            Response.Write("");
            Response.End();
        }
    }