Exemplo n.º 1
0
    protected void ImageButton1_Click(object sender, EventArgs e)
    {
        //判断名称是否唯一性
        if (ZWL.Common.PublicMethod.IFExists("YinZhangName", "ERPYinZhang", 0, this.TextBox1.Text) == false)
        {
            ZWL.Common.MessageBox.Show(this, "该印章名称已经存在!");
            return;
        }
        string FileNameStr = ZWL.Common.PublicMethod.UploadFileIntoDir(this.FileUpload1, DateTime.Now.Ticks.ToString() + System.IO.Path.GetExtension(FileUpload1.PostedFile.FileName));

        if (FileNameStr.Trim().Length > 0)
        {
            ZWL.BLL.ERPYinZhang MyModel = new ZWL.BLL.ERPYinZhang();
            MyModel.ImgPath        = FileNameStr;
            MyModel.TimeStr        = DateTime.Now;
            MyModel.UserName       = ZWL.Common.PublicMethod.GetSessionValue("UserName");
            MyModel.YinZhangLeiBie = Request.QueryString["Type"].ToString();
            MyModel.YinZhangMiMa   = this.TextBox2.Text;
            MyModel.YinZhangName   = this.TextBox1.Text;
            MyModel.Add();

            //写系统日志
            ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi();
            MyRiZhi.UserName    = ZWL.Common.PublicMethod.GetSessionValue("UserName");
            MyRiZhi.DoSomething = "用户添加印章信息(" + this.TextBox1.Text + ")";
            MyRiZhi.IpStr       = System.Web.HttpContext.Current.Request.UserHostAddress.ToString();
            MyRiZhi.Add();

            ZWL.Common.MessageBox.ShowAndRedirect(this, "印章信息添加成功!", "PublicSeal.aspx?Type=" + Request.QueryString["Type"].ToString());
        }
    }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ZWL.Common.PublicMethod.CheckSession();

            ZWL.BLL.ERPYinZhang MyModel = new ZWL.BLL.ERPYinZhang();
            MyModel.GetModel(int.Parse(Request.QueryString["ID"].ToString()));
            this.Image1.ImageUrl = "../UploadFile/" + MyModel.ImgPath;
            this.Label1.Text     = MyModel.YinZhangName;
            this.Label2.Text     = MyModel.YinZhangMiMa;
        }
    }
Exemplo n.º 3
0
 public void DataBindToGridview()
 {
     ZWL.BLL.ERPYinZhang MyModel = new ZWL.BLL.ERPYinZhang();
     if (Request.QueryString["Type"].ToString() == "公共印章")
     {
         GVData.DataSource = MyModel.GetList("YinZhangName Like '%" + this.TextBox1.Text + "%' and YinZhangLeiBie='公共印章' order by ID desc");
     }
     else
     {
         GVData.DataSource = MyModel.GetList("YinZhangName Like '%" + this.TextBox1.Text + "%' and YinZhangLeiBie='私人印章' and UserName='******' order by ID desc");
     }
     GVData.DataBind();
     LabPageSum.Text     = Convert.ToString(GVData.PageCount);
     LabCurrentPage.Text = Convert.ToString(((int)GVData.PageIndex + 1));
     this.GoPage.Text    = LabCurrentPage.Text.ToString();
 }
Exemplo n.º 4
0
 protected void Button2_Click(object sender, EventArgs e)
 {
     DataSet MYDTDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select UserName from ERPUser");
     for (int i = 0; i < MYDTDT.Tables[0].Rows.Count; i++)
     {
         string filePath = Server.MapPath("../UpLoadFile/" + MYDTDT.Tables[0].Rows[i]["UserName"].ToString() + "") + ".jpg"; //文件路径
         if (System.IO.File.Exists(filePath))//判断文件是否存在
         {
             ZWL.BLL.ERPYinZhang MyModel = new ZWL.BLL.ERPYinZhang();
             MyModel.ImgPath = MYDTDT.Tables[0].Rows[i]["UserName"].ToString()+".jpg";
             MyModel.TimeStr = DateTime.Now;
             MyModel.UserName = MYDTDT.Tables[0].Rows[i]["UserName"].ToString();
             MyModel.YinZhangLeiBie = "私人印章";
             MyModel.YinZhangMiMa = "123456";
             MyModel.YinZhangName = MYDTDT.Tables[0].Rows[i]["UserName"].ToString()+"个人签名";
             MyModel.Add();
         }
     }
 }
Exemplo n.º 5
0
    public void DataBindToGridview()
    {
        GVData.PageSize  = AspNetPager1.PageSize;
        GVData.PageIndex = AspNetPager1.CurrentPageIndex - 1;
        ZWL.BLL.ERPYinZhang MyModel = new ZWL.BLL.ERPYinZhang();
        DataSet             ds      = new DataSet();

        if (Request.QueryString["Type"].ToString() == "公共印章")
        {
            ds = MyModel.GetList("YinZhangName Like '%" + this.TextBox1.Text + "%' and YinZhangLeiBie='公共印章' order by ID desc");
        }
        else
        {
            ds = MyModel.GetList("YinZhangName Like '%" + this.TextBox1.Text + "%' and YinZhangLeiBie='私人印章' and UserName='******' order by ID desc");
        }
        GVData.DataSource = ds;
        GVData.DataBind();
        AspNetPager1.RecordCount = ds.Tables[0].Rows.Count;
    }
Exemplo n.º 6
0
    protected void Button2_Click(object sender, EventArgs e)
    {
        DataSet MYDTDT = ZWL.DBUtility.DbHelperSQL.GetDataSet("select UserName from ERPUser");

        for (int i = 0; i < MYDTDT.Tables[0].Rows.Count; i++)
        {
            string filePath = Server.MapPath("../UpLoadFile/" + MYDTDT.Tables[0].Rows[i]["UserName"].ToString() + "") + ".jpg"; //文件路径
            if (System.IO.File.Exists(filePath))                                                                                //判断文件是否存在
            {
                ZWL.BLL.ERPYinZhang MyModel = new ZWL.BLL.ERPYinZhang();
                MyModel.ImgPath        = MYDTDT.Tables[0].Rows[i]["UserName"].ToString() + ".jpg";
                MyModel.TimeStr        = DateTime.Now;
                MyModel.UserName       = MYDTDT.Tables[0].Rows[i]["UserName"].ToString();
                MyModel.YinZhangLeiBie = "私人印章";
                MyModel.YinZhangMiMa   = "123456";
                MyModel.YinZhangName   = MYDTDT.Tables[0].Rows[i]["UserName"].ToString() + "个人签名";
                MyModel.Add();
            }
        }
    }