Exemplo n.º 1
0
        public static string InitImage(string icode)
        {
            string              r    = "";
            Sys_ProduceImg      spi  = new Sys_ProduceImg();
            Sys_ProduceImgBll   snsb = new Sys_ProduceImgBll();
            SessionUserValidate iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                Sys_ProduceImg cspi = snsb.Query(" and icode='" + icode + "'");
                if (cspi != null)
                {
                    r = js.Serialize(cspi);
                }
                else
                {
                    spi.iname = "";
                    spi.icode = snsb.CreateCode().ToString().PadLeft(4, '0');
                    r         = js.Serialize(spi);
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Exemplo n.º 2
0
        public static string QueryImg(string pcode)
        {
            string              r    = "";
            Sys_ProduceImgBll   snsb = new Sys_ProduceImgBll();
            SessionUserValidate iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                string         icode = snsb.GetProductionImg(pcode);
                Sys_ProduceImg si    = snsb.Query(" and icode='" + icode + "'");
                if (si != null)
                {
                    Sys_Domain sd = sdb.Query(" and dtype='p'");
                    if (sd != null)
                    {
                        si.iurl  = sd.url + si.iurl;
                        si.ifurl = sd.url + si.ifurl;
                    }
                }
                r = js.Serialize(si);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Exemplo n.º 3
0
        public static ArrayList CustQueryList()
        {
            ArrayList             r    = new ArrayList();
            Sys_ProduceImgBll     snsb = new Sys_ProduceImgBll();
            List <Sys_ProduceImg> lsf  = new List <Sys_ProduceImg>();
            SessionUserValidate   iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r.Add(iv.badstr);
                StringBuilder where = new StringBuilder();
                lsf = snsb.QueryList(" and dcode ='" + iv.u.dcode.Substring(0, 8) + "' order by iname");
                if (lsf != null)
                {
                    foreach (Sys_ProduceImg s in lsf)
                    {
                        ArrayList al = new ArrayList();
                        al.Add(s.icode);
                        al.Add(s.iname);
                        al.Add("<img src='" + s.iurl + "'/>");
                        al.Add("<img src='" + s.ifurl + "'/>");
                        r.Add(al);
                    }
                }
            }
            else
            {
                r.Add(iv.badstr);
            }
            return(r);
        }
Exemplo n.º 4
0
        public static string GetProductionImg(string pcode)
        {
            string              r    = "";
            Sys_ProduceImgBll   snsb = new Sys_ProduceImgBll();
            SessionUserValidate iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                r = snsb.GetProductionImg(pcode);
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Exemplo n.º 5
0
        public static string DelImage(string icode)
        {
            string              r    = "";
            Sys_ProduceImgBll   snsb = new Sys_ProduceImgBll();
            SessionUserValidate iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                if (snsb.Delete(" and icode='" + icode + "'"))
                {
                    r = "S";
                }
                else
                {
                    r = "F";
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Exemplo n.º 6
0
        public static string SetProductionImg(string pcode, string icode)
        {
            string              r    = "";
            Sys_ProduceImgBll   snsb = new Sys_ProduceImgBll();
            SessionUserValidate iv   = SysValidateBll.ValidateSession();

            if (iv.f)
            {
                if (snsb.SetProductionImg(pcode, icode) > 0)
                {
                    r = "S";
                }
                else
                {
                    r = "F";
                }
            }
            else
            {
                r = iv.badstr;
            }
            return(r);
        }
Exemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string r = "";
            SessionUserValidate iv   = SysValidateBll.ValidateSession();
            Sys_ProduceImgBll   spib = new Sys_ProduceImgBll();

            if (iv.f)
            {
                HttpFileCollection files   = Request.Files;
                string             icode   = Request.QueryString["icode"];
                string             iname   = Request.QueryString["iname"];
                string             fx      = Request.QueryString["fx"];
                string             newname = DateTime.Now.ToString("yyyyMMddhhmmssfff");
                UpFile             uf      = new UpFile();
                ArrayList          efile   = new ArrayList();
                Sys_ProduceImg     spi     = new Sys_ProduceImg();

                string url = "/UpFile/ImageFile/";
                string ur  = uf.UpImage(files[0], newname, url, 1024000);
                CommonBll.PhotoChangeSize(System.Web.HttpContext.Current.Server.MapPath(url + ur), 60, 100);
                if (ur.Length > 1)
                {
                    spi.iname = iname;
                    spi.icode = icode;
                    spi.dcode = iv.u.dcode == ""?"00010001": iv.u.dcode.Substring(0, 8);
                    if (fx == "z")
                    {
                        spi.iurl = url + ur;
                    }
                    if (fx == "f")
                    {
                        spi.ifurl = url + ur;
                    }
                    if (spib.Exists(" and icode='" + icode + "'"))
                    {
                        if (spib.Update(spi))
                        {
                            r = "S";
                        }
                        else
                        {
                            r = "F";
                        }
                    }
                    else
                    {
                        if (spib.Add(spi) > 0)
                        {
                            r = "S";
                        }
                        else
                        {
                            r = "F";
                        }
                    }
                }
                else
                {
                    r = ur;
                }
            }
            else
            {
                r = iv.badstr;
            }
            Response.Write("{  msg:'" + r + "'}");
            Response.End();
        }