Esempio n. 1
0
        public static List <px_PrintModel> Querypx_PrintList()
        {
            List <px_PrintModel> list = null;

            string    sql2 = @" 
                            SELECT [id]
                                  ,[PXID]
                                  ,[orderid]
                                  ,[cartype]
                                  ,[XF]
                                  ,[LingjianHao]
                                  ,[sum]
                                  ,[ordername]
                                  ,[dayintime]
                                  ,[printpxid]
                                  ,[resultljh]
                                  ,[isauto]
                                  ,[SFlag]
                              FROM  [px_Print]             
	                          order by id asc 
                                ";
            DataTable dt   = SqlHelper.GetDataDataTable(SqlHelper.SqlConnString, System.Data.CommandType.Text, sql2, null);

            if (DataHelper.HasData(dt))
            {
                DataTable dt2 = dt;
                list = new List <px_PrintModel>();
                foreach (DataRow row in dt2.Rows)
                {
                    px_PrintModel model = new px_PrintModel();

                    model.id          = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "id"));
                    model.isauto      = DataHelper.GetCellDataToStr(row, "isauto");
                    model.PXID        = DataHelper.GetCellDataToStr(row, "PXID");
                    model.orderid     = DataHelper.GetCellDataToStr(row, "orderid");
                    model.cartype     = DataHelper.GetCellDataToStr(row, "cartype");
                    model.XF          = DataHelper.GetCellDataToStr(row, "XF");
                    model.sum         = DataHelper.GetCellDataToStr(row, "sum");
                    model.ordername   = DataHelper.GetCellDataToStr(row, "ordername");
                    model.LingjianHao = DataHelper.GetCellDataToStr(row, "LingjianHao");
                    model.dayintime   = NumericParse.StringToDateTime(DataHelper.GetCellDataToStr(row, "dayintime"));
                    model.printpxid   = NumericParse.StringToInt(DataHelper.GetCellDataToStr(row, "printpxid"));
                    model.resultljh   = DataHelper.GetCellDataToStr(row, "resultljh");
                    model.SFlag       = DataHelper.GetCellDataToStr(row, "SFlag");
                    list.Add(model);
                }
            }
            return(list);
        }
Esempio n. 2
0
    void UpdaloadImg(string path)
    {
        //接收上传后的文件
        HttpPostedFile file     = Request.Files["Filedata"];
        string         datePath = DateTime.Now.Date.ToString();
        //其他参数
        //string somekey = context.Request["someKey"];
        //string other = context.Request["someOtherKey"];
        //获取文件的保存路径
        string uploadPath = HttpContext.Current.Server.MapPath("\\UploadImages\\" + path + "\\");

        //判断上传的文件是否为空
        if (file != null)
        {
            if (!Directory.Exists(uploadPath))
            {
                Directory.CreateDirectory(uploadPath);
            }
            int      dotIndex    = file.FileName.LastIndexOf('.');
            string   extStr      = file.FileName.Substring(file.FileName.LastIndexOf('.'), file.FileName.Length - dotIndex);
            string   beforStr    = file.FileName.Substring(0, file.FileName.LastIndexOf('.'));
            string   newFilename = beforStr + "_" + NumericParse.StringToDateTime(DateTime.Now.ToString(), "yyyyMMddhhmmss") + extStr;
            FileInfo defile      = new FileInfo(uploadPath + newFilename);
            if (defile.Exists)
            {
                defile.Delete();
            }

            //保存文件
            file.SaveAs(uploadPath + newFilename);


            Response.Write("/UploadImages/" + path + "/" + newFilename);
        }
        else
        {
            Response.Write("0");
        }
        Response.End();
    }
Esempio n. 3
0
    void queryMaterialsortprintingList()
    {
        string   page      = Request.Params["page"];
        string   pagesize  = Request.Params["rows"];
        DateTime?starttime = NumericParse.StringToDateTime(Request.Params["starttime"]);
        DateTime?endtime   = NumericParse.StringToDateTime(Request.Params["endtime"]);
        string   csh       = Request.Params["csh"];

        if (string.IsNullOrEmpty(page))
        {
            page = "1";
        }
        if (string.IsNullOrEmpty(pagesize))
        {
            pagesize = "10";
        }

        string json = px_MaterialsortprintingBLL.queryMaterialsortprintingList(page, pagesize, starttime, endtime, csh);

        Response.Write(json);
        Response.End();
    }