Example #1
0
 public void getList(string sql,string type)
 {
     jDBUtil jdb = new jDBUtil(ConfigInfo.SQLconn,"SQL");
     Dgview.DataSource=jdb.getVector(sql);
     Dgview.Columns[type+"_STATUS"].Visible = false;
     foreach (DataGridViewRow x in Dgview.Rows)
     {
         if (x.Cells[type+"_STATUS"].Value.ToString()=="0")
         { x.Cells["STATUS"].Value = 0; }
         if (x.Cells[type+"_STATUS"].Value.ToString() == "1")
         { x.Cells["STATUS"].Value = 1; }
     }
     jdb.Close();
 }
Example #2
0
        private void save()
        {
            if (listBox1.Items.Count > 0)
            {

                foreach (Label lab in pictureBox1.Controls)
                {
                    Point pos = new Point(lab.Location.X, lab.Location.Y);
                    SolidBrush drawBrush = new SolidBrush(lab.ForeColor);
                    gsave.DrawString(lab.Text, new Font("宋体", 15f), drawBrush, pos);

                }
                gsave.Save();
                gsave.Dispose();

                foreach (Label lab in pictureBox1.Controls)
                {

                    Image imgtemp = (Image)pictureBox1.Image.Clone();
                    Graphics gsavetemp = Graphics.FromImage(imgtemp);//

                    Point pos = new Point(lab.Location.X, lab.Location.Y);
                    SolidBrush drawBrush = new SolidBrush(lab.ForeColor);

                    gsavetemp.DrawString(lab.Text + "->" + lab.Tag, new Font("宋体", 15f), drawBrush, pos);
                    gsavetemp.Save();
                    if (!Directory.Exists(ConfigInfo.FileDir)) Directory.CreateDirectory(ConfigInfo.FileDir);
                    if (!Directory.Exists(ConfigInfo.DetailsDir)) Directory.CreateDirectory(ConfigInfo.DetailsDir);

                    string imgname = ConfigInfo.FileDir + docid + "_" + lab.Text.TrimStart('<').TrimEnd('>') + ".jpg";
                    imgtemp.Save(imgname, ImageFormat.Jpeg);
                    //Function.saveFile(imgname,"","MC");
                    gsavetemp.Dispose();
                    string itemstart = lab.Text.TrimStart('<').TrimEnd('>');
                    string tip = "";
                    for (int i = 0; i < listBox1.Items.Count; i++)
                    {
                        if (listBox1.Items[i].ToString().Split('-')[0] == itemstart)
                        {
                            tip = listBox1.Items[i].ToString();

                        }
                    }

                    GlobalFunc.WriteTextToFile(tip.Split(':')[0] + ":" + tip.Split(':')[1], ConfigInfo.DetailsDir + "XZSM.txt", false);
                    GlobalFunc.WriteTextToFile(tip.Split(':')[0] + ":" + tip.Split(':')[1], ConfigInfo.DetailsDir + "YQJG.txt", false);
                    List<string> header = new List<string>();
                    GlobalFunc.WriteHeader(ref header, "XQ");

                    header.Add("TCR=" + ConfigInfo.UserName);
                    //优先级
                    header.Add("YXJ=" + tip.Split(':')[2]);//H\M|L
                    header.Add("ReqType=" + tip.Split(':')[3]);//默认为错误
                    header.Add("TempRingsID=" + "");

                    GlobalFunc.AddToZipDir(header);

                }
                //插入更新语句,表说明已经审核
                string updatesql = "update RS2020D set MC_STATUS='1',";
                updatesql += "MC_SPUS='" + ConfigInfo.UserID + "',";
                updatesql += "MC_SPDT='" + Tools.getNowDate() + "',";
                updatesql += "MC_SPSJ='" + Tools.getNowTime() + "'";
                updatesql += " where MC_WJID='" + fileID + "'";
                jDBUtil jb = new jDBUtil(ConfigInfo.SQLconn, "SQL");
                jb.executeUpdate(updatesql);

            }
            pictureBox1.Image.Dispose();
            pic.Dispose();
            listBox1.Items.Clear();
            File.Delete(name);
        }
Example #3
0
        private void Form1_FormClosed(object sender, FormClosedEventArgs e)
        {
            if (listTip.Items.Count == 0) return;
            //审核结果发送
            //审核结果
            string name = Path.GetFileNameWithoutExtension(file);
            string savafile=ConfigInfo.TempDir+name+"_"+Tools.getTimeStamp()+".txt";
            //if (!Directory.Exists(ConfigInfo.FileDir)) Directory.CreateDirectory(ConfigInfo.FileDir);
            using(StreamWriter sw=new StreamWriter(savafile,false,Encoding.UTF8))
            {
                foreach (string i in listTip.Items)
                {
                    sw.WriteLine(i);
                }
            }
            string uploadurl = url.Substring(0, url.LastIndexOf('\\') + 1) + Path.GetFileName(savafile);
            down.UploadFile(uploadurl, savafile);
            File.Delete(file);
            File.Delete(savafile);
            //修改数据库在原界面执行吧,还是在这吧
            //若没有修改,若是权限用户就可以同时加载目录下的审核文件
            string updatesql = "update RS2010D set YJ_STATUS='1',";
            updatesql += "YJ_SPUS='"+ ConfigInfo.UserID+ "',";
            updatesql += "YJ_SPDT='" +Tools.getNowDate()+ "',";
            updatesql += "YJ_SPSJ='" +Tools.getNowTime()+ "'";
            updatesql+=" where YJ_WJID='"+fileID+"'";

            jDBUtil jb=new jDBUtil(ConfigInfo.SQLconn,"SQL");
            jb.executeUpdate(updatesql);
        }