Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string r = "", sid = "", fname = "", dtype = "";
            SessionUserValidate iv = SysValidateBll.ValidateSession();
            B_DesignPlanBll     bmib = new B_DesignPlanBll();
            CB_OrderFlowBll     cofb = new CB_OrderFlowBll();

            if (iv.f)
            {
                HttpFileCollection files = Request.Files;
                if (Request.QueryString["sid"] != null)
                {
                    sid = Request.QueryString["sid"];
                }
                if (Request.QueryString["fname"] != null)
                {
                    fname = Request.QueryString["fname"];
                }
                if (Request.QueryString["dtype"] != null)
                {
                    dtype = Request.QueryString["dtype"];
                }
                string       newname = DateTime.Now.ToString("yyyyMMddhhmmssfff");
                UpFile       uf      = new UpFile();
                ArrayList    efile   = new ArrayList();
                B_DesignPlan spi     = new B_DesignPlan();
                string       url     = "/UpFile/DesignFile/";
                string       ur      = uf.UpFiles(files[0], newname, url, 102400000);
                if (ur.Length > 1)
                {
                    string xname = uf.GetFileExName(files[0]);
                    spi.osid   = sid;
                    spi.sid    = CommonBll.GetSid();
                    spi.maker  = iv.u.ename;
                    spi.dname  = fname + xname;
                    spi.durl   = url + ur;
                    spi.emcode = "";
                    spi.dtype  = dtype;
                    spi.rcode  = iv.u.rcode;
                    spi.wcode  = cofb.QueryCurWorkFlow(sid);
                    if (bmib.Add(spi) > 0)
                    {
                        r = "S";
                    }
                    else
                    {
                        r = "F";
                    }
                }
                else
                {
                    r = ur;
                }
            }
            else
            {
                r = iv.badstr;
            }
            Response.Write("{  msg:'" + r + "'}");
            Response.End();
        }
Ejemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.QueryString["sid"] != null)
     {
         string filePath  = "";
         string fileName  = "";
         string sid       = Request.QueryString["sid"].ToString();
         string otype     = Request.QueryString["otype"].ToString();
         string ftype     = Request.QueryString["ftype"].ToString();
         bool   urlencode = true;
         string brower    = Request.Browser.Browser;
         if (brower == "Firefox")
         {
             urlencode = false;
         }
         #region//附件
         if (otype == "")
         {
             if (ftype == "a")
             {
                 B_Attachment ba = bmib.Query(" and id=" + sid + "");
                 if (ba != null)
                 {
                     filePath = Server.MapPath(ba.furl);
                     fileName = ba.fname;
                 }
             }
             if (ftype == "d")
             {
                 B_DesignPlan ba = bdpb.Query(" and id=" + sid + "");
                 if (ba != null)
                 {
                     filePath = Server.MapPath(ba.durl);
                     fileName = ba.dname;
                 }
             }
         }
         #endregion
         #region //木门单下载
         #endregion
         #region //木作单下载
         if (otype == "mz")
         {
             if (ftype == "rplan")
             {
                 B_MzRequstDesign bp = bmrdpb.Query(" and id=" + sid + "");
                 if (bp != null)
                 {
                     filePath = Server.MapPath(bp.url);
                     fileName = bp.pname;
                 }
             }
             if (ftype == "plan")
             {
                 B_MzDesignPlan bp = bmdpb.Query(" and id=" + sid + "");
                 if (bp != null)
                 {
                     filePath = Server.MapPath(bp.purl);
                     fileName = bp.pname;
                 }
             }
             if (ftype == "bj")
             {
                 B_MzPriceFile bp = bmpfb.Query(" and id=" + sid + "");
                 if (bp != null)
                 {
                     filePath = Server.MapPath(bp.furl);
                     fileName = bp.fname;
                 }
             }
         }
         #endregion
         #region//反馈单下载
         if (otype == "fk")
         {
             if (ftype == "bj")
             {
                 B_AfterPriceFile bp = bapfb.Query(" and id=" + sid + "");
                 if (bp != null)
                 {
                     filePath = Server.MapPath(bp.furl);
                     fileName = bp.fname;
                 }
             }
         }
         #endregion
         if (filePath != "" && fileName != "")
         {
             Downfiles(filePath, fileName, urlencode);
         }
     }
 }
Ejemplo n.º 3
0
        public static string OrderAttrImg(string sid)
        {
            string              r    = "";
            StringBuilder       hstr = new StringBuilder();
            SessionUserValidate iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_Domain          sd   = sdb.Query(" and dtype='p'");
                string              zt   = bosb.QueryOrderStateImg(sid);
                B_Attachment        ba   = bmib.Query(" and sid='" + sid + "'");
                CB_OrderState       cos  = cbsb.Query("and sid='" + sid + "'");
                CB_OrderProduceType ct   = coptb.Query("and sid='" + sid + "'");
                B_FeedBackImg       bfi  = bfbib.Query(" and sid='" + sid + "'");
                B_DesignPlan        bdp  = bdpb.Query(" and osid='" + sid + "' and dtype='0'");
                B_DesignPlan        bdpt = bdpb.Query(" and osid='" + sid + "' and dtype='1'");
                hstr.Append("<table style='border:none; width:100%'> ");
                hstr.AppendFormat("<tr><td align='center' height='40'><strong>状态:</strong></td><td align='center'><img src='{0}'></td></tr>", zt);
                hstr.AppendFormat("<tr><td align='center'height='40'><strong>日志:</strong></td><td align='center'><img src='" + sd.url + "/Image/opeimage/makep.png' id='{0}' onclick='ShowLogs(this.id)' style='cursor:pointer'/></td></tr>", sid);
                if (ba != null)
                {
                    hstr.AppendFormat("<tr><td align='center'height='40'><strong>附件:</strong></td><td align='center'><img src='" + sd.url + "/Image/opeimage/zip.gif' id='{0}' onclick='ShowAttachment(this.id)'style='cursor:pointer'/></td></tr>", sid);
                }
                if (bdp != null)
                {
                    hstr.AppendFormat("<tr><td align='center'height='40'><strong>方案:</strong></td><td align='center'><img src='" + sd.url + "/Image/opeimage/design.gif' id='{0}' onclick='ShowDesign(this.id,0)'style='cursor:pointer'/></td></tr>", sid);
                }
                if (bdpt != null)
                {
                    hstr.AppendFormat("<tr><td align='center'height='40'><strong>二次方案:</strong></td><td align='center'><img src='" + sd.url + "/Image/opeimage/design.gif' id='{0}' onclick='ShowDesign(this.id,1)'style='cursor:pointer'/></td></tr>", sid);
                }
                if (bfi != null)
                {
                    hstr.AppendFormat("<tr><td align='center'height='40'><strong>售后:</strong></td><td align='center'><img src='" + sd.url + "/Image/opeimage/afterimg.gif' id='{0}' onclick='ShowAfterImg()'style='cursor:pointer'/></td></tr>", sid);
                }
                if (ct != null)
                {
                    if (ct.gytype == "线上")
                    {
                        hstr.AppendFormat("<tr><td align='center'height='40'><strong>生产:</strong></td><td align='center'><img src='" + sd.url + "/Image/opeimage/online.gif'  style='cursor:pointer'/></td></tr>");
                    }
                    if (ct.gytype == "线下")
                    {
                        hstr.AppendFormat("<tr><td align='center'height='40'><strong>生产:</strong></td><td align='center'><img src='" + sd.url + "/Image/opeimage/offline.gif'  style='cursor:pointer'/></td></tr>");
                    }
                }
                if (cos != null)
                {
                    if (cos.inewpp > 0)
                    {
                        hstr.AppendFormat("<tr><td align='center'height='40'><strong>新报价:</strong></td><td align='center'><img src='" + sd.url + "/Image/opeimage/nbj.png' id='{0}' style='cursor:pointer'/></td></tr>", sid);
                    }
                    if (cos.ipdraw == 1)
                    {
                        hstr.AppendFormat("<tr><td align='center'height='40'><strong>绘图中:</strong></td><td align='center'><img src='" + sd.url + "/Image/opeimage/drawing.png' id='{0}' style='cursor:pointer'/></td></tr>", sid);
                    }
                    if (cos.ipdraw == 2)
                    {
                        hstr.AppendFormat("<tr><td align='center'height='40'><strong>已绘图:</strong></td><td align='center'><img src='" + sd.url + "/Image/opeimage/drawed.png' id='{0}' onclick='ShowDrawImage(this.id)'style='cursor:pointer'/></td></tr>", sid);
                    }
                    if (cos.imeasure == 1)
                    {
                        hstr.AppendFormat("<tr><td align='center'height='40'><strong>测量中:</strong></td><td align='center'><img src='" + sd.url + "/Image/opeimage/measuring.png' id='{0}' style='cursor:pointer'/></td></tr>", sid);
                    }
                    if (cos.imeasure == 2)
                    {
                        hstr.AppendFormat("<tr><td align='center'height='40'><strong>已测量:</strong></td><td align='center'><img src='" + sd.url + "/Image/opeimage/measured.png' id='{0}' style='cursor:pointer'/></td></tr>", sid);
                    }
                }

                hstr.Append("</table>");
                r = hstr.ToString();
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }