Esempio n. 1
0
 protected void btnLeft_Click(object sender, EventArgs e)
 {
     if (picindex == 1)
     {
         Alert.Show("已经是第一张证照图片!");
     }
     else
     {
         btnRight.Enabled = true;
         picindex--;
         DataTable mydt      = DbHelperOra.Query("select seqno,licenseid,memo from doc_license_log where gdseq='" + hfdGDSEQ.Text + "'").Tables[0];
         string    seqno     = mydt.Rows[0]["seqno"].ToString();
         string    licenseid = mydt.Rows[0]["licenseid"].ToString();
         DataTable picDt     = DbHelperOra.Query(string.Format("select imgpath,rowno from DOC_LICENSE_IMG where seqno='{0}' and licenseid='{1}' and rowno={2} AND ISCUR='N'", seqno, licenseid, picindex)).Tables[0];
         string    picpath   = picDt.Rows[0]["imgpath"].ToString();
         string    rowno     = picDt.Rows[0]["rowno"].ToString();
         picpath             = picpath.Substring(1, picpath.Length - 1);
         imglbl.Text         = seqno + "/" + rowno + picpath;
         imgBMPPATH.ImageUrl = ApiUtil.GetConfigCont("LIS_PICURL") + picpath;
         if (picindex == 1)
         {
             btnLeft.Enabled = false;
         }
     }
 }
Esempio n. 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     strPath = ApiUtil.GetConfigCont("PIC_PATH");
     if (Request.QueryString["oper"] != null && "del".Equals(Request.QueryString["oper"]))
     {
         if (Request.QueryString["seqno"] != null)
         {
             string seqnos     = Request.QueryString["seqno"].Trim(',');
             string seqnosTemp = "";
             if (seqnos.IndexOf(",") > 0)
             {
                 string[] seqnosArray = seqnos.Split(',');
                 foreach (String seqno in seqnosArray)
                 {
                     seqnosTemp += "'" + seqno + "',";
                 }
                 seqnosTemp = seqnosTemp.Trim(',');
             }
             else
             {
                 seqnosTemp += "'" + seqnos + "'";
             }
             del(seqnosTemp);
         }
     }
     if (!IsPostBack)
     {
         Path.Text = strPath;
     }
 }
Esempio n. 3
0
        protected void nextPageBtn_Click(object sender, EventArgs e)
        {
            if (Convert.ToInt32(picnum) > 1)
            {
                picindex++;
                if (picindex > Convert.ToInt32(picnum))
                {
                    Alert.Show("证照图片到底了!");
                    picindex--;
                }
                else
                {
                    btnLeft.Enabled = true;
                    string    seqno   = myseqno;
                    DataTable picDt   = DbHelperOra.Query(string.Format("select imgpath,rowno from DOC_LICENSE_IMG where seqno='{0}' and licenseid='{1}' and rowno={2}", seqno, lisid, picindex)).Tables[0];
                    string    picpath = picDt.Rows[0]["imgpath"].ToString();
                    string    rowno   = picDt.Rows[0]["rowno"].ToString();
                    picpath = picpath.Substring(1, picpath.Length - 1);
                    //imglbl.Text = seqno + "/" + rowno + picpath;
                    imgBMPPATH.ImageUrl = ApiUtil.GetConfigCont("LIS_PICURL") + picpath;

                    if (picindex == Convert.ToInt32(picnum))
                    {
                        btnRight.Enabled = false;
                    }
                }
            }
            if (Convert.ToInt32(picnum) == 1)
            {
                Alert.Show("证照图片到底了!");
            }
        }
Esempio n. 4
0
        // public string strPath = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["page"] != null)
            {
                strPage = Request.QueryString["page"];
                try
                {
                    intPageIndex = Convert.ToInt32(strPage);
                }
                catch
                {
                    intPageIndex = 1;
                }
            }

            if (!IsPostBack)
            {
                Path.Text = ApiUtil.GetConfigCont("PIC_PATH");

                PubFunc.DdlDataGet("DDL_SYS_DEPOT", ddlDEPTOUT);
                Object obj;
                if (HttpContext.Current.Request.Cookies["DEPTOUT"] == null)
                {
                    obj = DbHelperOra.GetSingle("select nvl((SELECT A.STOCK FROM SYS_DEPT A WHERE A.CODE = '" + UserAction.UserDept + "'),(select value from sys_para where code = 'DEFDEPT')) from dual");
                    HttpCookie cookie = new HttpCookie("DEPTOUT");
                    cookie.Value = obj.ToString();
                    HttpContext.Current.Response.Cookies.Add(cookie);
                }
                else
                {
                    obj = HttpContext.Current.Request.Cookies["DEPTOUT"].Value;
                }
                ddlDEPTOUT.SelectedValue = obj.ToString();
            }
        }
Esempio n. 5
0
        protected void gridPic_RowClick(object sender, GridRowClickEventArgs e)
        {
            string    gdseq = gridPic.Rows[e.RowIndex].DataKeys[0].ToString();
            string    rowno = gridPic.Rows[e.RowIndex].DataKeys[1].ToString();
            DataTable picDt = DbHelperOra.Query(string.Format("select picpath from doc_goodspicture where gdseq='{0}' and rowno='{1}'", gdseq, rowno)).Tables[0];

            imgBMPPATH.ImageUrl  = ApiUtil.GetConfigCont("CLOUD_URL_PREFIX") + picDt.Rows[0][0].ToString();
            lnkImage.NavigateUrl = ApiUtil.GetConfigCont("CLOUD_URL_PREFIX") + picDt.Rows[0][0].ToString();
        }
Esempio n. 6
0
        private void billOpen(string strSeq)
        {
            TabStrip1.ActiveTabIndex = 1;
            String prefix = ApiClientUtil.GetConfigCont("LICENSE_PATH");

            gridPic.DataSource = getPicData(strSeq);
            gridPic.DataBind();
            //imgBMPPATH.ImageUrl = "http://localhost:3788/captcha/CertificatePicture.aspx?seqno="+strSeq+"&rowno=1";
            imgBMPPATH.ImageUrl = ApiUtil.GetConfigCont("LICENSE_PATH") + "/captcha/CertificatePicture.aspx?seqno=" + strSeq + "&rowno=1";
        }
Esempio n. 7
0
        private void DataSearch()
        {
            String    sql = @"SELECT * FROM (SELECT GDSEQ,ROWNUM HANGHAO,PICPATH FROM DOC_GOODSPICTURE WHERE GDSEQ = '" + hfdSearch.Text + "' AND NVL(STR2,'N') = 'N' ORDER BY ROWNUM)";
            DataTable dt  = DbHelperOra.Query(sql).Tables[0];

            if (dt.Rows.Count > 0)
            {
                if (Convert.ToInt16(hfdNow.Text) > dt.Rows.Count)
                {
                    hfdNow.Text = "1";
                }
                else if (Convert.ToInt16(hfdNow.Text) < 1)
                {
                    hfdNow.Text = dt.Rows.Count.ToString();
                }
                //imgBMPPATH.ImageUrl = ApiUtil.GetConfigCont("PIC_PATH") + dt.Rows[Convert.ToInt16(hfdNow.Text) - 1]["PICPATH"].ToString().Substring(2, dt.Rows[Convert.ToInt16(hfdNow.Text)-1]["PICPATH"].ToString().Length - 2);
                //imgBMPPATH.ImageUrl = "../captcha/GoodsPicture.aspx?picPath=" + dt.Rows[Convert.ToInt16(hfdNow.Text) - 1]["PICPATH"].ToString().Substring(2, dt.Rows[Convert.ToInt16(hfdNow.Text) - 1]["PICPATH"].ToString().Length - 2);
                string path = dt.Rows[Convert.ToInt16(hfdNow.Text) - 1]["PICPATH"].ToString();

                if (!string.IsNullOrWhiteSpace(path))
                {
                    if (File.Exists(Request.PhysicalApplicationPath + (path.Substring(2)).Replace("/", @"\")))
                    {
                        imgBMPPATH.ImageUrl = "http://" + Request.Url.Authority + path.Substring(1);
                    }
                    else
                    {
                        imgBMPPATH.ImageUrl = ApiUtil.GetConfigCont("PIC_PATH") + "/captcha/GetPictures.aspx?picpath=" + path;
                    }
                }
                else
                {
                    imgBMPPATH.ImageUrl = "/res/images/noPic.jpg";
                }


                if (dt.Rows.Count > 1)
                {
                    btnBef.Enabled  = true;
                    btnNext.Enabled = true;
                }
                else
                {
                    btnBef.Enabled  = false;
                    btnNext.Enabled = false;
                }
            }
            else
            {
                imgBMPPATH.ImageUrl = "../res/images/noPic.jpg";
                btnBef.Enabled      = false;
                btnNext.Enabled     = false;
            }
        }
Esempio n. 8
0
        /// <summary>
        /// 获取临时目录
        /// </summary>
        /// <returns></returns>
        public static string GetTempPath()
        {
            //string path = HttpContext.Current.Server.MapPath("~/");
            //string dirname = GetTempDirName();
            //string uploadDir = path + "\\" + dirname;
            string path      = ApiUtil.GetConfigCont("UPLOADDIR");
            string uploadDir = path + "SupCert";

            CreateDir(uploadDir);
            return(uploadDir);
        }
Esempio n. 9
0
 protected void PageManager1_CustomEvent(object sender, CustomEventArgs e)
 {
     if (e.EventArgument.IndexOf("bind_piclist") >= 0)
     {
         hfdTempPic1.Text = "Y";
         DataTable dt = DbHelperOra.Query(string.Format("select gdseq,rowno,gdpict,picpath,str1,decode(flag,'N','新增','Y','已发布','E','已撤回') flag from doc_goodspicture where gdseq = '{0}' order by to_number(rowno)", hfdGDID.Text)).Tables[0];
         gridPic.DataSource = dt;
         gridPic.DataBind();
         //Alert.Show(dt.Rows[0]["PICPATH"].ToString().Replace("~", ""));
         //imgBMPPATH.ImageUrl = ApiUtil.GetConfigCont("LICENSE_PATH") + "/captcha/GetPictures.aspx?gdseq=" + hfdGDID.Text + "&rowno=1";
         imgBMPPATH.ImageUrl = ApiUtil.GetConfigCont("LICENSE_PATH") + "/captcha/GetPictures.aspx?picpath=" + dt.Rows[0]["PICPATH"].ToString();
         //imgBMPPATH.ImageUrl = ApiUtil.GetConfigCont("CLOUD_URL_PREFIX") + dt.Rows[0]["PICPATH"].ToString().Replace("~", "");
     }
 }
Esempio n. 10
0
        private string getGoodsData(string gdseq)
        {
            DataTable picTable    = DbHelperOra.Query(String.Format("select rowno,picpath from doc_goodspicture where gdseq='{0}' and nvl(str2,'N') = 'N' order by rowno", gdseq)).Tables[0];
            string    strGoodsSql = @"select GDSEQ,GDNAME,GDSPEC,BZHL,UNIT,u.name UNITNAME,CATID,c.name CATNAME,PIZNO,BAR3 EASCODE,SUPPLIER SUPID,s.supname SUPNAME,PRODUCER,p.supname PRODUCERNAME,JXTAX,HSJJ+2 JJ from doc_goods g
                                left join doc_goodsunit u on g.unit=u.code
                                left join sys_category c on g.catid=c.code
                                left join doc_supplier s on g.supplier=s.supid
                                left join doc_supplier p on g.PRODUCER=p.str2
                                where gdseq='{0}'";
            DataTable goodsInfo   = DbHelperOra.Query(String.Format(strGoodsSql, gdseq)).Tables[0];
            DataTable cartTable   = DbHelperOra.Query(String.Format("select dhs from dat_cart where userid='{0}' and gdseq='{1}'", UserAction.UserID, gdseq)).Tables[0];
            JObject   jo          = new JObject();
            JArray    ja          = new JArray();

            jo.Add("gdseq", goodsInfo.Rows[0]["GDSEQ"].ToString());
            jo.Add("gdname", goodsInfo.Rows[0]["GDNAME"].ToString());
            jo.Add("gdspec", goodsInfo.Rows[0]["GDSPEC"].ToString());
            jo.Add("bzhl", goodsInfo.Rows[0]["BZHL"].ToString());
            jo.Add("unit", goodsInfo.Rows[0]["UNIT"].ToString());
            jo.Add("unitname", goodsInfo.Rows[0]["UNITNAME"].ToString());
            jo.Add("catid", goodsInfo.Rows[0]["CATID"].ToString());
            jo.Add("catname", goodsInfo.Rows[0]["CATNAME"].ToString());
            jo.Add("eascode", goodsInfo.Rows[0]["EASCODE"].ToString());
            jo.Add("pizno", goodsInfo.Rows[0]["PIZNO"].ToString());
            jo.Add("supid", goodsInfo.Rows[0]["SUPID"].ToString());
            jo.Add("supname", goodsInfo.Rows[0]["SUPNAME"].ToString());
            jo.Add("producer", goodsInfo.Rows[0]["PRODUCER"].ToString());
            jo.Add("producername", goodsInfo.Rows[0]["PRODUCERNAME"].ToString());
            jo.Add("jxtax", goodsInfo.Rows[0]["JXTAX"].ToString());
            jo.Add("jj", goodsInfo.Rows[0]["JJ"].ToString());
            foreach (DataRow dr in picTable.Rows)
            {
                JObject joPath = new JObject();
                joPath.Add("rowno", Convert.ToInt16(dr["ROWNO"]));
                if (dr["PICPATH"] != null && !"".Equals(dr["PICPATH"].ToString()))
                {
                    string strPICPATH = ApiUtil.GetConfigCont("CLOUD_URL_PREFIX") + dr["PICPATH"].ToString().Substring(2);
                    joPath.Add("path", strPICPATH);
                }
                ja.Add(joPath);
            }
            jo.Add("picpath", ja);
            if (cartTable != null && cartTable.Rows.Count > 0)
            {
                jo.Add("dhs", cartTable.Rows[0]["dhs"].ToString());
            }

            return(JsonConvert.SerializeObject(jo));
        }
Esempio n. 11
0
        private void billOpen(string strSeq)
        {
            TabStrip1.ActiveTabIndex = 1;
            String prefix = ApiClientUtil.GetConfigCont("LICENSE_PATH");

            gridPic.DataSource = getPicData(strSeq);
            gridPic.DataBind();
            imgBMPPATH.ImageUrl = ApiUtil.GetConfigCont("LICENSE_PATH") + "/captcha/CertificatePicture.aspx?seqno=" + strSeq + "&rowno=1";
            //DataTable mydt = gridPic_path1(strSeq);
            //if (mydt.Rows.Count > 0)
            //{
            //    imgBMPPATH.ImageUrl = prefix + mydt.Rows[0]["PICPATH"].ToString().Replace("~", "");
            //}
            //else
            //{
            //    Alert.Show("不要频繁点击,稍后片刻!");
            //}
        }
Esempio n. 12
0
        protected void gridPic_RowClick(object sender, GridRowClickEventArgs e)
        {
            TabStrip1.ActiveTabIndex = 1;
            String prefix = ApiClientUtil.GetConfigCont("LICENSE_PATH");
            string seqno  = gridPic.Rows[e.RowIndex].DataKeys[0].ToString();
            string rowno  = gridPic.Rows[e.RowIndex].DataKeys[1].ToString();

            imgBMPPATH.ImageUrl = ApiUtil.GetConfigCont("LICENSE_PATH") + "/captcha/CertificatePicture.aspx?seqno=" + seqno + "&rowno=" + rowno;
            //DataTable dt = gridPic_path(seqno, rowno);
            //if (dt.Rows.Count > 0)
            //{
            //    imgBMPPATH.ImageUrl = prefix + dt.Rows[0]["PICPATH"].ToString().Replace("~", "");
            //}
            //else
            //{
            //    Alert.Show("不要频繁点击,稍后片刻!");
            //}
        }
Esempio n. 13
0
        private void Init()
        {
            //SEQNO, ROWNO, ISCUR, LICENSEID证照图片表主键
            string    gdseq   = seqnohfd.Text;
            DataTable picDt   = DbHelperOra.Query(string.Format("select imgpath,rowno from DOC_LICENSE_IMG where seqno='{0}' and rownum=1", gdseq)).Tables[0];
            string    picpath = picDt.Rows[0]["imgpath"].ToString();
            string    rowno   = picDt.Rows[0]["rowno"].ToString();

            picpath = picpath.Substring(1, picpath.Length - 1);
            //imglbl.Text = seqnohfd.Text + "/" + rowno + picpath;
            imgBMPPATH.ImageUrl = ApiUtil.GetConfigCont("LIS_PICURL") + picpath;
            picindex            = 1;
            btnLeft.Enabled     = false;
            if (Convert.ToInt32(picnum) == 1)
            {
                btnRight.Enabled = false;
            }
        }
Esempio n. 14
0
        private void billOpen(string strBillno)
        {
            DataTable dtPic = DbHelperOra.Query(string.Format(@"
select * from (
select gdseq,rowno,gdpict,str1,decode(flag,'N','新增','Y','已发布','E','已撤回') flag,PICPATH, ROWNUM HANGNO from doc_goodspicture where gdseq = '{0}')
order by rowno", strBillno)).Tables[0];

            if (dtPic.Rows.Count > 0)
            {
                gridPic.DataSource = dtPic;
                gridPic.DataBind();
                TabStrip1.ActiveTabIndex = 1;
                string path = dtPic.Rows[0]["picpath"].ToString();
                //imgBMPPATH.ImageUrl = ApiUtil.GetConfigCont("CLOUD_URL_PREFIX") + dtPic.Rows[0]["picpath"].ToString();
                //imgBMPPATH.ImageUrl = ApiUtil.GetConfigCont("LICENSE_PATH") + "/captcha/GetPictures.aspx?gdseq=" + strBillno + "&rowno=1";

                if (!string.IsNullOrWhiteSpace(path))
                {
                    if (File.Exists(Request.PhysicalApplicationPath + (path.Substring(2)).Replace("/", @"\")))
                    {
                        imgBMPPATH.ImageUrl = "http://" + Request.Url.Authority + path.Substring(1);
                    }
                    else
                    {
                        imgBMPPATH.ImageUrl = ApiUtil.GetConfigCont("PIC_PATH") + "/captcha/GetPictures.aspx?picpath=" + path;
                    }
                }
                else
                {
                    imgBMPPATH.ImageUrl = "/res/images/noPic.jpg";
                }

                //imgBMPPATH.ImageUrl = ApiUtil.GetConfigCont("LICENSE_PATH") + "/captcha/GetPictures.aspx?picpath=" + path;
                hfdPic.Text = dtPic.Rows[0]["picpath"].ToString();//没有点击的时候默认图片
            }
            else
            {
                gridPic.DataSource = dtPic;
                gridPic.DataBind();
                TabStrip1.ActiveTabIndex = 1;
            }
        }
Esempio n. 15
0
        private void downloadInventory()
        {
            String warehouse = ApiUtil.GetConfigCont("QUERYINVENTORY_WAREHOUSE");

            try
            {
                //先查询EAS库存的行数
                JObject joCli    = ApiClientService.queryInventoryByPage(warehouse, 0, 1);
                int     countRow = 0;
                if ("success".Equals(joCli.Value <String>("result")))
                {
                    try
                    {
                        countRow = Convert.ToInt32(joCli.Value <String>("data"));
                    }
                    catch
                    { }
                }
                //清除库存临时表
                DbHelperOra.ExecuteSql("delete from EAS_STOCK_COMPARE ");

                int pageNum = 100;
                int sumPage = countRow % pageNum > 0 ? countRow / pageNum + 1 : countRow / pageNum;
                for (int i = 1; i <= sumPage; i++)
                {
                    joCli = ApiClientService.queryInventoryByPage(warehouse, pageNum, i);
                    JObject jo = new JObject();
                    if ("success".Equals(joCli.Value <String>("result")))
                    {
                        foreach (JToken jt in joCli.Value <JArray>("data"))
                        {
                            insertInventory(jt);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Alert.Show("下载EAS库存失败!");
            }
        }
Esempio n. 16
0
        protected void gridPic_RowClick(object sender, GridRowClickEventArgs e)
        {
            string    gdseq  = gridPic.Rows[e.RowIndex].DataKeys[0].ToString();
            string    rowno  = gridPic.Rows[e.RowIndex].DataKeys[1].ToString();
            string    HANGNO = gridPic.Rows[e.RowIndex].DataKeys[3].ToString();
            DataTable picDt  = DbHelperOra.Query(string.Format("select picpath from doc_goodspicture where gdseq='{0}' and rowno='{1}'", gdseq, rowno)).Tables[0];
            string    path   = picDt.Rows[0]["picpath"].ToString();

            if (File.Exists(Request.PhysicalApplicationPath + (path.Substring(2)).Replace("/", @"\")))
            {
                imgBMPPATH.ImageUrl = "http://" + Request.Url.Authority + path.Substring(1);
            }
            else
            {
                imgBMPPATH.ImageUrl = ApiUtil.GetConfigCont("LICENSE_PATH") + "/captcha/GetPictures.aspx?picpath=" + path;
            }

            hfdPic2.Text   = picDt.Rows[0][0].ToString(); //点击左边列表显示的图片路径
            mynow          = Convert.ToInt32(HANGNO);
            labelpic1.Text = picDt.Rows[0][0].ToString(); //这个判断是否点击了左边单元行
        }
Esempio n. 17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["page"] != null)
            {
                strPage = Request.QueryString["page"];
                try
                {
                    intPageIndex = Convert.ToInt32(strPage);
                }
                catch
                {
                    intPageIndex = 1;
                }
            }

            strPath = ApiUtil.GetConfigCont("PIC_PATH");
            if (!IsPostBack)
            {
                goodsDataBind();
            }
        }
Esempio n. 18
0
        protected void gridPic_RowClick(object sender, GridRowClickEventArgs e)
        {
            string    gdseq = gridPic.Rows[e.RowIndex].DataKeys[0].ToString();
            string    rowno = gridPic.Rows[e.RowIndex].DataKeys[1].ToString();
            DataTable picDt = DbHelperOra.Query(string.Format("select picpath from doc_goodspicture where gdseq='{0}' and rowno='{1}'", gdseq, rowno)).Tables[0];
            string    path  = picDt.Rows[0]["PICPATH"].ToString();

            //imgBMPPATH.ImageUrl = ApiUtil.GetConfigCont("LICENSE_PATH") + "/captcha/GetPictures.aspx?gdseq=" + gdseq + "&rowno=" + rowno;
            //imgBMPPATH.ImageUrl = ApiUtil.GetConfigCont("LICENSEPATH") + "/captcha/GetPictures.aspx?picpath=" + path;

            if (File.Exists(Request.PhysicalApplicationPath + (path.Substring(2)).Replace("/", @"\")))
            {
                imgBMPPATH.ImageUrl = "http://" + Request.Url.Authority + path.Substring(1);
            }
            else
            {
                imgBMPPATH.ImageUrl = ApiUtil.GetConfigCont("LICENSE_PATH") + "/captcha/GetPictures.aspx?picpath=" + path;
            }

            //imgBMPPATH.ImageUrl = ApiUtil.GetConfigCont("CLOUD_URL_PREFIX") + picDt.Rows[0][0].ToString();
        }
Esempio n. 19
0
        protected void btnRight_Click(object sender, EventArgs e)
        {
            mynow++;
            if (!string.IsNullOrWhiteSpace(hfdPic3.Text))
            {
                Int32 row = Convert.ToInt32(hfdPic3.Text);
                if (mynow > row)
                {
                    Alert.Show("此照片已经是最后一张哦!");
                    mynow = row;
                }
                else
                {
                    DataTable dtpic = DbHelperOra.Query(string.Format(@"select picpath from (
select picpath,rownum hangno,rowno from doc_goodspicture where gdseq='{0}')
where hangno='{1}' order by rowno", labelpic.Text, mynow.ToString())).Tables[0];
                    string    path  = dtpic.Rows[0]["picpath"].ToString();
                    if (dtpic.Rows.Count > 0)
                    {
                        gridPic.SelectedRowIndex = mynow - 1;
                        if (File.Exists(Request.PhysicalApplicationPath + (path.Substring(2)).Replace("/", @"\")))
                        {
                            imgBMPPATH.ImageUrl = "http://" + Request.Url.Authority + path.Substring(1);
                        }
                        else
                        {
                            imgBMPPATH.ImageUrl = ApiUtil.GetConfigCont("LICENSE_PATH") + "/captcha/GetPictures.aspx?picpath=" + path;
                        }
                    }
                }
            }
            else
            {
                Alert.Show("没有图片不能显示", "提示", MessageBoxIcon.Information);
            }
        }
Esempio n. 20
0
        private static Int32 mynow = 1;//labelpic1用于传递路径,labelpic用于传递gdseq  Alert.Show();
        protected void btnLeft_Click(object sender, EventArgs e)
        {
            string picName = "";
            string path    = labelpic1.Text;

            if (labelpic1.Text.Length == 0 && mynow == 1)
            {
                Alert.Show("此照片已经是第一张哦!");
            }
            else
            {
                //if (labelpic1.Text.Length == 0)
                // {
                mynow--;
                if (mynow <= 0)
                {
                    Alert.Show("此照片已经是第一张哦!");
                    mynow = 1;
                }
                else
                {
                    DataTable dtpic1 = DbHelperOra.Query(string.Format(@"select picpath from (
select picpath,rownum hangno,rowno from doc_goodspicture where gdseq='{0}')
where hangno='{1}' order by rowno", labelpic.Text, mynow.ToString())).Tables[0];
                    if (dtpic1.Rows.Count > 0)
                    {
                        labelpic1.Text = dtpic1.Rows[0][0].ToString();
                        path           = labelpic1.Text;
                        // hfdPic3.Text = mynow.ToString();
                        // gridPic.SelectedRowIndex = Convert.ToInt16(hfdPic3.Text) - 1;
                        gridPic.SelectedRowIndex = mynow - 1;
                        if (File.Exists(Request.PhysicalApplicationPath + (path.Substring(2)).Replace("/", @"\")))
                        {
                            imgBMPPATH.ImageUrl = "http://" + Request.Url.Authority + path.Substring(1);
                        }
                        else
                        {
                            imgBMPPATH.ImageUrl = ApiUtil.GetConfigCont("LICENSE_PATH") + "/captcha/GetPictures.aspx?picpath=" + path;
                        }
                        //imgBMPPATH.ImageUrl = ApiUtil.GetConfigCont("LICENSE_PATH") + "/captcha/GetPictures.aspx?picpath=" + dtpic1.Rows[0]["picpath"].ToString();
                    }
                    else
                    {
                        Alert.Show("没有图片不能显示!", "提示", MessageBoxIcon.Information);
                    }
                }
                //}
                //else
                //{
                //    picName = labelpic1.Text.Substring(0, labelpic1.Text.IndexOf("."));//~/ERPUpload/GoodsPic/2015/03/30/GN101001826C_3
                //    string[] pname1 = picName.Substring(picName.LastIndexOf("/") + 1).Split('_');
                //    mynow--;
                //    if (mynow <= 0)
                //    {
                //        Alert.Show("此照片已经是第一张哦!");
                //        mynow = 1;
                //    }
                //    else
                //    {
                //        gridPic.SelectedRowIndex = mynow - 1;
                //        if (File.Exists(Request.PhysicalApplicationPath + (path.Substring(2)).Replace("/", @"\")))
                //        {
                //            imgBMPPATH.ImageUrl = "http://" + Request.Url.Authority + path.Substring(1);
                //        }
                //        else
                //        {
                //            imgBMPPATH.ImageUrl = ApiUtil.GetConfigCont("LICENSE_PATH") + "/captcha/GetPictures.aspx?picpath=" + path;
                //        }


                //    }
                //}
            }
        }
Esempio n. 21
0
        private void goodsDataBind()
        {
            string    strSqlGoodSum = @"SELECT sum(c.dhs) dhs,sum((g.hsjj * (DECODE(g.UNIT_SELL, 'D', g.NUM_DABZ, 'Z', g.NUM_ZHONGBZ, g.BZHL)) * c.dhs )) as JE,COUNT(1) DPS
                                    FROM DAT_CART c
                                    left join doc_goods g on c.gdseq=g.gdseq
                                    where c.USERID='{0}'";
            DataTable dt            = DbHelperOra.Query(string.Format(strSqlGoodSum, UserAction.UserID)).Tables[0];

            if (dt != null && dt.Rows.Count > 0)
            {
                this.LiteralDhs.Text = dt.Rows[0]["DPS"].ToString();
                this.LiteralJe.Text  = dt.Rows[0]["JE"].ToString();
            }

            string strSqlGood = @"SELECT c.seqno,c.userid,c.gdseq,c.dhs,g.GDSEQ,";

            //判断系统默认设置显示的商品名
            if (PubFunc.DbGetPara("ShowName") == "HIS")
            {
                strSqlGood += "NVL(g.HISNAME,g.GDNAME) GDNAME,NVL(g.STR3,g.GDSPEC) GDSPEC,";
            }
            else
            {
                strSqlGood += "g.GDNAME,g.GDSPEC,";
            }

            strSqlGood += @"g.isflag5,g.BZHL,f_getunitname(g.UNIT) UNIT,g.CATID,g.PIZNO,c.deptid,f_getproducername(g.producer) producername,
                                    --g.hsjj as price,
                                    --(g.hsjj)*c.dhs as JE,
                                    p.picpath,
                                    g.hsjj * (DECODE(g.UNIT_SELL, 'D', g.NUM_DABZ, 'Z', g.NUM_ZHONGBZ, g.BZHL)) as price,
                                    (g.hsjj * (DECODE(g.UNIT_SELL, 'D', g.NUM_DABZ, 'Z', g.NUM_ZHONGBZ, g.BZHL)) * c.dhs ) JE,
                                                                        F_GETUNITNAME(DECODE(g.UNIT_SELL,
                                                                            'D',
                                                                            g.UNIT_DABZ,
                                                                            'Z',
                                                                            g.UNIT_ZHONGBZ,
                                                                            g.UNIT)) UNIT_SELL_NAME,
                                                                            DECODE(g.UNIT_SELL, 'D', g.NUM_DABZ, 'Z', g.NUM_ZHONGBZ, g.BZHL) BZHL_SELL
                                                                        FROM DAT_CART c
                                                                        left join doc_goods g on c.gdseq=g.gdseq
                                                                        left join (select  a.*,Row_Number()  OVER (partition by gdseq ORDER BY rownum  ) HANGHAO
                                        from doc_goodspicture a) p
                                    on c.gdseq=p.gdseq and p.HANGHAO=1 and p.flag='Y'and nvl(p.str2,'N') = 'N'
                                    where c.USERID='{0}'";
            strSqlGood  = string.Format(strSqlGood, UserAction.UserID);
            DataTable dtInfo = DbHelperOra.Query(strSqlGood).Tables[0];
            DataTable dtnew  = dtInfo.Clone();

            foreach (DataRow row in dtInfo.Rows)
            {
                string path = row["PICPATH"].ToString();
                if (!string.IsNullOrWhiteSpace(path))
                {
                    if (File.Exists(Request.PhysicalApplicationPath + (path.Substring(2)).Replace("/", @"\")))
                    {
                        row["PICPATH"] = "http://" + Request.Url.Authority + path.Substring(1);
                    }
                    else
                    {
                        row["PICPATH"] = ApiUtil.GetConfigCont("PIC_PATH") + "/captcha/GetPictures.aspx?picpath=" + path;
                    }
                }
                else
                {
                    row["PICPATH"] = "/res/images/noPic.jpg";
                }

                dtnew.Rows.Add(row.ItemArray);
            }
            RepeaterGoods.DataSource = dtnew;
            RepeaterGoods.DataBind();
        }
Esempio n. 22
0
        protected void GridLIS_RowDoubleClick(object sender, GridRowClickEventArgs e)
        {
            TabStrip1.ActiveTabIndex = 1;
            string gdname = GridLIS.Rows[e.RowIndex].DataKeys[2].ToString();
            string code   = GridLIS.Rows[e.RowIndex].DataKeys[1].ToString();

            docGDNAME.Text = gdname;
            hfdGDSEQ.Text  = code;
            DataTable lisDT = DbHelperOra.Query(@"SELECT B.CODE,
                                                    B.NAME,
                                                    T.SEQNO,
                                                    T.LICENSEID,
                                                    T.LICENSENAME,
                                                    T.GDNAME,
                                                    T.GDSEQ,
                                                    T.OPERTIME,
                                                    nvl(decode(T.FLAG,'N','已保存','S','已提交','Y','已审核','R','已驳回'),'待录入') FLAG,
                                                    decode(T.PICNUM,'','【'||0||'】','【'||T.PICNUM||'】')PICNUM
                                                FROM (SELECT T.SEQNO, T.LICENSEID, T.LICENSENAME, T.GDSEQ, T.GDNAME,T.OPERTIME,T.FLAG,T.PICNUM
                                                        FROM DOC_LICENSE_LOG T
                                                        WHERE GDSEQ = '" + code + "' AND T.ISCUR='N') T,DOC_LICENSE B WHERE B.CODE = T.LICENSEID(+) AND B.OBJUSER = '******'").Tables[0];

            docLISNAME.Text        = lisDT.Rows[0]["LICENSENAME"].ToString();
            GridLicense.DataSource = lisDT;
            GridLicense.DataBind();

            if (DbHelperOra.Exists("select 1 from doc_license_log where gdseq='" + code + "'"))
            {
                DataTable mydt      = DbHelperOra.Query("select seqno,licenseid,memo from doc_license_log where gdseq='" + code + "' and iscur='N'").Tables[0];
                string    mypicnum  = DbHelperOra.GetSingle("select count(1) from doc_license_img where gdseq='" + code + "' and licenseid='" + mydt.Rows[0]["licenseid"].ToString() + "' and iscur='N'").ToString();
                string    seqno     = mydt.Rows[0]["seqno"].ToString();
                DataTable licensedt = DbHelperOra.Query("select trunc(begrq) begrq,trunc(endrq) endrq,docid,memo from doc_license_goods where seqno='" + seqno + "'").Tables[0];
                if (licensedt.Rows[0][1].ToString().Equals("2099/1/1 0:00:00"))
                {
                    ischk.Checked         = true;
                    dpkENDRQ.SelectedDate = Convert.ToDateTime(licensedt.Rows[0][1].ToString());
                    dpkBEGRQ.SelectedDate = Convert.ToDateTime(licensedt.Rows[0][0].ToString());
                    dpkENDRQ.Enabled      = false;
                }
                else
                {
                    dpkENDRQ.SelectedDate = Convert.ToDateTime(licensedt.Rows[0][1].ToString());
                    dpkBEGRQ.SelectedDate = Convert.ToDateTime(licensedt.Rows[0][0].ToString());
                }
                docMEMO.Text  = mydt.Rows[0]["memo"].ToString();
                docDOCID.Text = licensedt.Rows[0]["DOCID"].ToString();

                DataTable picDt   = DbHelperOra.Query(string.Format("select imgpath,rowno from DOC_LICENSE_IMG where seqno='{0}' and rownum=1", seqno)).Tables[0];
                string    picpath = picDt.Rows[0]["imgpath"].ToString();
                string    rowno   = picDt.Rows[0]["rowno"].ToString();
                picpath             = picpath.Substring(1, picpath.Length - 1);
                imglbl.Text         = seqno + "/" + rowno + picpath;
                imgBMPPATH.ImageUrl = ApiUtil.GetConfigCont("LIS_PICURL") + picpath;
                picindex            = 1;
                btnLeft.Enabled     = false;
                picnum = mypicnum;
                if (Convert.ToInt32(picnum) == 1)
                {
                    btnRight.Enabled = false;
                }
            }
        }
Esempio n. 23
0
        private void goodsDataBind()
        {
            strNextPage = "?page=" + (intPageIndex + 1).ToString();
            strLastPage = "?page=" + (intPageIndex - 1).ToString();
            string strWhere = "";

            if (DbHelperOra.Exists("SELECT 1 FROM SYS_DEPT WHERE TYPE IN ('3','4') AND CODE = '" + UserAction.UserDept + "'"))
            {
                Object obj;
                if (HttpContext.Current.Request.Cookies["DEPTOUT"] == null)
                {
                    obj = DbHelperOra.GetSingle("select nvl((SELECT A.STOCK FROM SYS_DEPT A WHERE A.CODE = '" + UserAction.UserDept + "'),(select value from sys_para where code = 'DEFDEPT')) from dual");
                }
                else
                {
                    obj = HttpContext.Current.Request.Cookies["DEPTOUT"].Value;
                }
                strWhere = " GDSEQ IN(SELECT A.GDSEQ FROM DOC_GOODSCFG A,DOC_GOODSCFG B ,doc_goods C WHERE A.GDSEQ = B.GDSEQ AND A.GDSEQ=C.GDSEQ AND C.FLAG='Y' AND A.ISCFG IN ('Y','1') AND A.DEPTID = '" + UserAction.UserDept + "' AND B.DEPTID = '" + obj.ToString() + "') ";
            }
            else
            {
                strWhere = " 1=2";
            }

            if (Request.QueryString["k"] != null && !"".Equals(Request.QueryString["k"]))
            {
                strWhere   += " and (gdname like '%" + Request.QueryString["k"].Trim() + "%' OR GDSEQ like '%" + Request.QueryString["k"].Trim() + "%' OR ZJM like '%" + Request.QueryString["k"].Trim().ToUpper() + "%')";
                strNextPage = strNextPage + "&k=" + Request.QueryString["k"].Trim();
                strLastPage = strLastPage + "&k=" + Request.QueryString["k"].Trim();
            }
            if (Request.QueryString["catid"] != null && !"".Equals(Request.QueryString["catid"]))
            {
                strNextPage = strNextPage + "&catid=" + Request.QueryString["catid"].Trim();
                strLastPage = strLastPage + "&catid=" + Request.QueryString["catid"].Trim();

                string catIds = Request.QueryString["catid"].Trim(',');
                if (!String.IsNullOrWhiteSpace(catIds))
                {
                    if (catIds.IndexOf(",") > 0)
                    {
                        string[] catIdsArray = catIds.Split(',');
                        catIds = "";
                        foreach (string catId in catIdsArray)
                        {
                            catIds += "'" + catId + "',";
                        }
                        catIds = catIds.Trim(',');
                    }
                    else
                    {
                        catIds = "'" + catIds + "'";
                    }
                    strWhere += " and CATID0 IN (" + catIds + ")";
                }
            }
            //取得有效行
            object rowno       = DbHelperOra.GetSingle("SELECT MIN(HANGHAO) FROM ( SELECT ROWNUM HANGHAO FROM doc_goodspicture WHERE flag='Y' and nvl(str2,'N') = 'N' ORDER BY ROWNUM)");
            int    pageNum     = AspNetPager1.PageSize;
            string strSqlCount = @"select count(1) from 
                                    (select g.GDSEQ,g.GDNAME,g.GDSPEC,g.BZHL,g.UNIT,g.CATID0,g.PIZNO,p.picpath,ZJM from doc_goods g
                                    left join  (SELECT GDSEQ, MAX(PICPATH) PICPATH
                                       FROM DOC_GOODSPICTURE
                                      WHERE FLAG = 'Y'
                                        AND NVL(STR2, 'N') = 'N'
                                      GROUP BY GDSEQ) p on g.gdseq=p.gdseq and rownum = 1  where g.flag = 'Y') where {0}";

            strSqlCount = string.Format(strSqlCount, strWhere);
            AspNetPager1.RecordCount = Convert.ToInt32(DbHelperOra.GetSingle(strSqlCount));

            this.LiteralNum.Text     = AspNetPager1.RecordCount.ToString();
            this.LiteralPageNum.Text = (Math.Ceiling(AspNetPager1.RecordCount / 10.0)).ToString();
            if (AspNetPager1.RecordCount >= 0 && AspNetPager1.RecordCount < 10)
            {
                strLastPage = "<a title='上一页' href='javascript:void(0);' class='sort_page_arrow'>&lt;</a>";
                strNextPage = "<a hreCeilingf='javascript:void(0);' title='下一页' class='sort_page_arrow'>&gt;</a>";
            }
            else
            {
                if (intPageIndex == 1)
                {
                    strLastPage = "<a title='上一页' href='javascript:void(0);' class='sort_page_arrow'>&lt;</a>";
                    strNextPage = "<a href='" + strNextPage + "' title='下一页' class='sort_page_arrow'>&gt;</a>";
                }
                else if (intPageIndex == (AspNetPager1.RecordCount / pageNum + 1))
                {
                    strLastPage = "<a title='上一页' href='" + strLastPage + "' class='sort_page_arrow'>&lt;</a>";
                    strNextPage = "<a href='javascript:void(0);' title='下一页' class='sort_page_arrow'>&gt;</a>";
                }
                else
                {
                    strLastPage = "<a title='上一页' href='" + strLastPage + "' class='sort_page_arrow'>&lt;</a>";
                    strNextPage = "<a href='" + strNextPage + "' title='下一页' class='sort_page_arrow'>&gt;</a>";
                }
            }

            this.LiteralLastPage.Text = strLastPage;
            this.LiteralNextPage.Text = strNextPage;
            string strSqlGood = @"select * from
                            (select t.*,ROWNUM rn from
                            (select GDSEQ,GDNAME,GDSPEC,BZHL,UNIT,UNITNAME,CATID0,PIZNO,HSJJ,producername,picpath,flag,isflag5 from 

                            (select g.GDSEQ,";

            //判断系统默认设置显示的商品名
            if (PubFunc.DbGetPara("ShowName") == "HIS")
            {
                strSqlGood += "NVL(g.HISNAME,g.GDNAME) GDNAME,NVL(g.STR3,g.GDSPEC) GDSPEC,";
            }
            else
            {
                strSqlGood += "g.GDNAME,g.GDSPEC,";
            }

            strSqlGood += @"g.isflag5,g.BZHL,
                                    --g.UNIT,
                                    DECODE(g.UNIT_SELL, 'D', g.UNIT_DABZ, 'Z', g.UNIT_ZHONGBZ, g.UNIT) UNIT,
                                                                        --u.NAME UNITNAME,
                                    F_GETUNITNAME(DECODE(g.UNIT_SELL, 'D', g.UNIT_DABZ, 'Z', g.UNIT_ZHONGBZ, g.UNIT)) UNITNAME, 
                                    g.CATID0,
                                    g.PIZNO,
                                    --g.HSJJ,
                                    g.hsjj * (DECODE(g.UNIT_SELL, 'D', g.NUM_DABZ, 'Z', g.NUM_ZHONGBZ, g.BZHL)) as HSJJ,
                                    f_getproducername(g.producer) producername,
                                    p.picpath,ZJM,g.flag from doc_goods g
                                    left join (SELECT GDSEQ, MAX(PICPATH)PICPATH
                                      FROM DOC_GOODSPICTURE
                                     WHERE FLAG = 'Y'
                                       AND NVL(STR2, 'N') = 'N'
                                     GROUP BY GDSEQ) p
                            on g.gdseq = p.gdseq
                          left join doc_goodsunit u
                            on g.unit = u.code)
                            where {0}) t
 where t.flag = 'Y') where rn> " + (intPageIndex - 1) * pageNum + " and rn<= " + intPageIndex * pageNum;

            strSqlGood = string.Format(strSqlGood, strWhere);
            DataTable dt = DbHelperOra.Query(strSqlGood).Tables[0];

            DataTable dtnew = dt.Clone();

            foreach (DataRow row in dt.Rows)
            {
                string path = row["PICPATH"].ToString();
                if (!string.IsNullOrWhiteSpace(path))
                {
                    if (File.Exists(Request.PhysicalApplicationPath + (path.Substring(2)).Replace("/", @"\")))
                    {
                        row["PICPATH"] = "http://" + Request.Url.Authority + path.Substring(1);
                    }
                    else
                    {
                        row["PICPATH"] = ApiUtil.GetConfigCont("PIC_PATH") + "/captcha/GetPictures.aspx?picpath=" + path;
                    }
                }
                else
                {
                    row["PICPATH"] = "/res/images/noPic.jpg";
                }

                dtnew.Rows.Add(row.ItemArray);
            }
            RepeaterGoods.DataSource = dtnew;
            RepeaterGoods.DataBind();
        }
Esempio n. 24
0
        private string getGoodsData(string gdseq)
        {
            DataTable picTable    = DbHelperOra.Query(String.Format("select hanghao,picpath from (select rownum hanghao,picpath from doc_goodspicture where gdseq='{0}' and nvl(str2,'N') = 'N' order by rownum)", gdseq)).Tables[0];
            string    strGoodsSql = @"SELECT GDSEQ,";

            //判断系统默认设置显示的商品名
            if (PubFunc.DbGetPara("ShowName") == "HIS")
            {
                strGoodsSql += "NVL(HISNAME,GDNAME) GDNAME,NVL(G.STR3,GDSPEC) GDSPEC,";
            }
            else
            {
                strGoodsSql += "GDNAME,GDSPEC,";
            }

            strGoodsSql += @"BZHL,UNIT,U.NAME UNITNAME,CATID,C.NAME CATNAME,PIZNO,BAR3 EASCODE,SUPPLIER SUPID,S.SUPNAME SUPNAME,PRODUCER,f_getproducername(PRODUCER) PRODUCERNAME,JXTAX,HSJJ JJ FROM DOC_GOODS G
                                LEFT JOIN DOC_GOODSUNIT U ON G.UNIT=U.CODE
                                LEFT JOIN SYS_CATEGORY C ON G.CATID=C.CODE
                                LEFT JOIN DOC_SUPPLIER S ON G.SUPPLIER=S.SUPID
                                LEFT JOIN DOC_SUPPLIER P ON G.PRODUCER=P.STR2
                                WHERE GDSEQ='{0}'";
            DataTable goodsInfo = DbHelperOra.Query(String.Format(strGoodsSql, gdseq)).Tables[0];
            DataTable cartTable = DbHelperOra.Query(String.Format("select dhs from dat_cart where userid='{0}' and gdseq='{1}'", UserAction.UserID, gdseq)).Tables[0];
            JObject   jo        = new JObject();
            JArray    ja        = new JArray();

            jo.Add("gdseq", goodsInfo.Rows[0]["GDSEQ"].ToString());
            jo.Add("gdname", goodsInfo.Rows[0]["GDNAME"].ToString());
            jo.Add("gdspec", goodsInfo.Rows[0]["GDSPEC"].ToString());
            jo.Add("bzhl", goodsInfo.Rows[0]["BZHL"].ToString());
            jo.Add("unit", goodsInfo.Rows[0]["UNIT"].ToString());
            jo.Add("unitname", goodsInfo.Rows[0]["UNITNAME"].ToString());
            jo.Add("catid", goodsInfo.Rows[0]["CATID"].ToString());
            jo.Add("catname", goodsInfo.Rows[0]["CATNAME"].ToString());
            jo.Add("eascode", goodsInfo.Rows[0]["EASCODE"].ToString());
            jo.Add("pizno", goodsInfo.Rows[0]["PIZNO"].ToString());
            jo.Add("supid", goodsInfo.Rows[0]["SUPID"].ToString());
            jo.Add("supname", goodsInfo.Rows[0]["SUPNAME"].ToString());
            jo.Add("producer", goodsInfo.Rows[0]["PRODUCER"].ToString());
            jo.Add("producername", goodsInfo.Rows[0]["PRODUCERNAME"].ToString());
            jo.Add("jxtax", goodsInfo.Rows[0]["JXTAX"].ToString());
            jo.Add("jj", goodsInfo.Rows[0]["JJ"].ToString());
            foreach (DataRow dr in picTable.Rows)
            {
                JObject joPath = new JObject();
                joPath.Add("rowno", Convert.ToInt16(dr["HANGHAO"]));
                if (dr["PICPATH"] != null && !"".Equals(dr["PICPATH"].ToString()))
                {
                    //string strPICPATH = ApiUtil.GetConfigCont("CLOUD_URL_PREFIX") + dr["PICPATH"].ToString().Substring(2);
                    string strPICPATH = "";
                    string path       = dr["PICPATH"].ToString();
                    if (!string.IsNullOrWhiteSpace(path))
                    {
                        if (File.Exists(Request.PhysicalApplicationPath + (path.Substring(2)).Replace("/", @"\")))
                        {
                            strPICPATH = "http://" + Request.Url.Authority + path.Substring(1);
                        }
                        else
                        {
                            strPICPATH = ApiUtil.GetConfigCont("PIC_PATH") + "/captcha/GetPictures.aspx?picpath=" + path;
                        }
                    }
                    else
                    {
                        strPICPATH = "/res/images/noPic.jpg";
                    }


                    joPath.Add("path", strPICPATH);
                }
                ja.Add(joPath);
            }
            jo.Add("picpath", ja);
            if (cartTable != null && cartTable.Rows.Count > 0)
            {
                jo.Add("dhs", cartTable.Rows[0]["dhs"].ToString());
            }

            return(JsonConvert.SerializeObject(jo));
        }
Esempio n. 25
0
        public Boolean UploadFile(HttpContext context, string licenseid)
        {
            message = "";
            int    rowno = 1;//存放图片的行数
            string pic_path = "", seqn = "";

            result = false;
            context.Response.CacheControl = "no-cache";
            string s_rpath = FileHelper.GetUploadPath();//@"E:\My Documents\Visual Studio 2008\WebSites\SWFUpload\demos\applicationdemo.net";

            List <CommandInfo> cmdList = new List <CommandInfo>();

            string Datedir = DateTime.Now.ToString("yy-MM-dd");
            string updir   = s_rpath + "\\" + Datedir;

            FileHelper.CreateDir(updir);
            string extname  = string.Empty;
            string fullname = string.Empty;
            string filename = string.Empty;

            if (context.Request.Files.Count > 0)
            {
                try
                {
                    for (int j = 0; j < context.Request.Files.Count; j++)
                    {
                        HttpPostedFile uploadFile = context.Request.Files[j];
                        int            offset     = Convert.ToInt32(context.Request["chunk"]);  //当前分块
                        int            total      = Convert.ToInt32(context.Request["chunks"]); //总的分块数量
                        string         name       = context.Request["name"];
                        //文件没有分块
                        if (total == 1)
                        {
                            if (uploadFile.ContentLength > 0)
                            {
                                if (!System.IO.Directory.Exists(updir))
                                {
                                    System.IO.Directory.CreateDirectory(updir);
                                }
                                extname  = System.IO.Path.GetExtension(uploadFile.FileName);
                                fullname = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString() + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString();
                                filename = uploadFile.FileName;

                                uploadFile.SaveAs(string.Format("{0}\\{1}", updir, filename));
                                result = true;
                            }
                        }
                        else
                        {
                            //文件 分成多块上传
                            fullname = WriteTempFile(uploadFile, offset);
                            if (total - offset == 1 || total == 0)
                            {
                                //如果是最后一个分块文件 ,则把文件从临时文件夹中移到上传文件夹中
                                System.IO.FileInfo fi          = new System.IO.FileInfo(fullname);
                                string             oldFullName = string.Format("{0}\\{1}", updir, uploadFile.FileName);
                                string             mypath      = "";
                                System.IO.FileInfo oldFi       = new System.IO.FileInfo(oldFullName);
                                if (oldFi.Exists)
                                {
                                    //文件名存在则删除旧文件
                                    oldFi.Delete();
                                }
                                string pathMain = ApiUtil.GetConfigCont("UPLOADDIR");
                                //fi.MoveTo(oldFullName);
                                string spath = "SupCert\\" + Datedir + "\\";
                                //string spath = oldFullName.Substring(10);
                                DataTable dt = DbHelperOra.Query("select max(rowno) from DOC_GOODSPICTURE where gdseq='" + licenseid + "' nvl(str2,'N') = 'N'").Tables[0];
                                if (dt != null && dt.Rows.Count != 0)
                                {
                                    string oldnum = dt.Rows[0][0].ToString();
                                    if (!String.IsNullOrWhiteSpace(oldnum))
                                    {
                                        rowno    = Convert.ToInt32(oldnum) + 1;
                                        mypath   = "~/" + ("ERPUpload\\" + spath).Replace("\\", "/");
                                        pic_path = mypath;    //pathMain + "SupCert\\" + Datedir + "\\";//mypath.Substring(0, oldFullName.LastIndexOf("\\") + 1);
                                        seqn     = licenseid + "_" + rowno;
                                        pic_path = pic_path + seqn + ".jpg";
                                    }
                                    else
                                    {
                                        mypath   = "~/" + ("ERPUpload\\" + spath).Replace("\\", "/");
                                        pic_path = mypath;    //.Substring(0, oldFullName.LastIndexOf("\\") + 1);
                                        seqn     = licenseid + "_" + rowno;
                                        pic_path = pic_path + seqn + ".jpg";
                                    }
                                }
                                string             thePicPath = pathMain + spath + seqn + ".jpg";
                                System.IO.FileInfo oldFi1     = new System.IO.FileInfo(thePicPath);
                                if (oldFi1.Exists)
                                {
                                    //文件名存在则删除旧文件
                                    oldFi1.Delete();
                                }
                                fi.MoveTo(thePicPath);
                                //E:\UPLOAD\SupCert\15-04-17\1-120Q0092042.jpg   --->oldFullName
                                //E:\\UPLOAD\\SupCert\15-05-03\授权设计.xlsx
                                cmdList.Add(new CommandInfo(string.Format("update doc_goods set ISFLAG4 = 'Y' where gdseq='{0}'", licenseid), null));
                                cmdList.Add(new CommandInfo("insert into DOC_GOODSPICTURE(GDSEQ,ROWNO,GDPICT,PICPATH,FLAG,STR1) values('" + licenseid + "','" + rowno + "','" + seqn + "','" + pic_path + "','N','" + seqn + "')", null));
                                result = true;
                                DbHelperOra.ExecuteSqlTran(cmdList);
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    message = ex.ToString();
                    //context.Response.Write("Message" + ex.ToString());
                }
            }
            return(result);
        }