Exemple #1
0
 public void DataBindToGridview()
 {
     ZWL.BLL.ERPCommon MyModel = new ZWL.BLL.ERPCommon();
     DataSet ds = MyModel.GetList("CDescription Like '%" + this.TextBox1.Text + /*"%' and UserName='******' order by ID desc");
     if (ds != null)
     {
         GVData.DataSource = ds;
         GVData.DataBind();
         LabPageSum.Text = Convert.ToString(GVData.PageCount);
         LabCurrentPage.Text = Convert.ToString(((int)GVData.PageIndex + 1));
         this.GoPage.Text = LabCurrentPage.Text.ToString();
     }
 }
Exemple #2
0
    public void DataBindToGridview()
    {
        ZWL.BLL.ERPCommon MyModel = new ZWL.BLL.ERPCommon();
        DataSet           ds      = MyModel.GetList("CDescription Like '%" + this.TextBox1.Text + /*"%' and UserName='******' order by ID desc");

        if (ds != null)
        {
            GVData.DataSource = ds;
            GVData.DataBind();
            LabPageSum.Text     = Convert.ToString(GVData.PageCount);
            LabCurrentPage.Text = Convert.ToString(((int)GVData.PageIndex + 1));
            this.GoPage.Text    = LabCurrentPage.Text.ToString();
        }
    }
Exemple #3
0
    /*
    protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
    {
        string FileNameStr = ZWL.Common.PublicMethod.UploadFileIntoDir(this.FileUpload1, DateTime.Now.Ticks.ToString() + System.IO.Path.GetExtension(FileUpload1.PostedFile.FileName));
        if (ZWL.Common.PublicMethod.GetSessionValue("WenJianList").Trim() == "")
        {
            ZWL.Common.PublicMethod.SetSessionValue("WenJianList", FileNameStr);
        }
        else
        {
            ZWL.Common.PublicMethod.SetSessionValue("WenJianList", ZWL.Common.PublicMethod.GetSessionValue("WenJianList") + "|" + FileNameStr);
        }
        ZWL.Common.PublicMethod.BindDDL(this.CheckBoxList1, ZWL.Common.PublicMethod.GetSessionValue("WenJianList"));
    }

    protected void ImageButton3_Click(object sender, ImageClickEventArgs e)
    {
        try
        {
            for (int i = 0; i < this.CheckBoxList1.Items.Count; i++)
            {
                if (this.CheckBoxList1.Items[i].Selected == true)
                {
                    ZWL.Common.PublicMethod.SetSessionValue("WenJianList", ZWL.Common.PublicMethod.GetSessionValue("WenJianList").Replace(this.CheckBoxList1.Items[i].Text, "").Replace("||", "|"));
                }
            }
            ZWL.Common.PublicMethod.BindDDL(this.CheckBoxList1, ZWL.Common.PublicMethod.GetSessionValue("WenJianList"));
        }
        catch
        { }
    }

    protected void ImageButton5_Click(object sender, ImageClickEventArgs e)
    {
        try
        {
            if (this.CheckBoxList1.SelectedItem.Text.Trim().Length > 0)
            {
                Response.Write("<script>window.open('../DsoFramer/ReadFile.aspx?FilePath=" + this.CheckBoxList1.SelectedItem.Text + "');</script>");
            }
        }
        catch
        { }
    }
    protected void ImageButton6_Click(object sender, ImageClickEventArgs e)
    {
        try
        {
            if (this.CheckBoxList1.SelectedItem.Text.Trim().Length > 0)
            {
                Response.Write("<script>window.open('../DsoFramer/EditFile.aspx?FilePath=" + this.CheckBoxList1.SelectedItem.Text + "');</script>");
            }
        }
        catch
        { }
    }

        */
    protected void btn_Sub_Click(object sender, EventArgs e)
    {
        ZWL.BLL.ERPCommon Model = new ZWL.BLL.ERPCommon();

        Model.Code = this.TextBoxcode.Text;
        Model.CName = this.TextBoxname.Text;
        Model.CType = this.TextBoxtype.Text;
        Model.CSort = int.Parse(this.TextBoxsort.Text); //没有验证
        Model.CDescription = this.TextBoxdes.Text;
        Model.UpdateTime = DateTime.Now;
        Model.Add();

        ////写系统日志
        //ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi();
        //MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName");
        //MyRiZhi.DoSomething = "用户添加公共信息(" + this.TextBoxname.Text + ")";
        //MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString();
        //MyRiZhi.Add();
         Response.Write("<script>alert('共有参数添加成功!');window.location.href='Common.aspx';</script>");
        //ZWL.Common.MessageBox.ShowAndRedirect(this, "共有参数添加成功!", "Common.aspx");
    }
Exemple #4
0
    /*
     * protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
     * {
     *  string FileNameStr = ZWL.Common.PublicMethod.UploadFileIntoDir(this.FileUpload1, DateTime.Now.Ticks.ToString() + System.IO.Path.GetExtension(FileUpload1.PostedFile.FileName));
     *  if (ZWL.Common.PublicMethod.GetSessionValue("WenJianList").Trim() == "")
     *  {
     *      ZWL.Common.PublicMethod.SetSessionValue("WenJianList", FileNameStr);
     *  }
     *  else
     *  {
     *      ZWL.Common.PublicMethod.SetSessionValue("WenJianList", ZWL.Common.PublicMethod.GetSessionValue("WenJianList") + "|" + FileNameStr);
     *  }
     *  ZWL.Common.PublicMethod.BindDDL(this.CheckBoxList1, ZWL.Common.PublicMethod.GetSessionValue("WenJianList"));
     * }
     *
     *
     * protected void ImageButton3_Click(object sender, ImageClickEventArgs e)
     * {
     *  try
     *  {
     *      for (int i = 0; i < this.CheckBoxList1.Items.Count; i++)
     *      {
     *          if (this.CheckBoxList1.Items[i].Selected == true)
     *          {
     *              ZWL.Common.PublicMethod.SetSessionValue("WenJianList", ZWL.Common.PublicMethod.GetSessionValue("WenJianList").Replace(this.CheckBoxList1.Items[i].Text, "").Replace("||", "|"));
     *          }
     *      }
     *      ZWL.Common.PublicMethod.BindDDL(this.CheckBoxList1, ZWL.Common.PublicMethod.GetSessionValue("WenJianList"));
     *  }
     *  catch
     *  { }
     * }
     *
     * protected void ImageButton5_Click(object sender, ImageClickEventArgs e)
     * {
     *  try
     *  {
     *      if (this.CheckBoxList1.SelectedItem.Text.Trim().Length > 0)
     *      {
     *          Response.Write("<script>window.open('../DsoFramer/ReadFile.aspx?FilePath=" + this.CheckBoxList1.SelectedItem.Text + "');</script>");
     *      }
     *  }
     *  catch
     *  { }
     * }
     * protected void ImageButton6_Click(object sender, ImageClickEventArgs e)
     * {
     *  try
     *  {
     *      if (this.CheckBoxList1.SelectedItem.Text.Trim().Length > 0)
     *      {
     *          Response.Write("<script>window.open('../DsoFramer/EditFile.aspx?FilePath=" + this.CheckBoxList1.SelectedItem.Text + "');</script>");
     *      }
     *  }
     *  catch
     *  { }
     * }
     *
     */


    protected void btn_Sub_Click(object sender, EventArgs e)
    {
        ZWL.BLL.ERPCommon Model = new ZWL.BLL.ERPCommon();

        Model.Code         = this.TextBoxcode.Text;
        Model.CName        = this.TextBoxname.Text;
        Model.CType        = this.TextBoxtype.Text;
        Model.CSort        = int.Parse(this.TextBoxsort.Text); //没有验证
        Model.CDescription = this.TextBoxdes.Text;
        Model.UpdateTime   = DateTime.Now;
        Model.Add();


        ////写系统日志
        //ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi();
        //MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName");
        //MyRiZhi.DoSomething = "用户添加公共信息(" + this.TextBoxname.Text + ")";
        //MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString();
        //MyRiZhi.Add();
        Response.Write("<script>alert('共有参数添加成功!');window.location.href='Common.aspx';</script>");
        //ZWL.Common.MessageBox.ShowAndRedirect(this, "共有参数添加成功!", "Common.aspx");
    }
Exemple #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ZWL.Common.PublicMethod.CheckSession();
            //绑定页面数据
            ZWL.BLL.ERPCommon MyModel = new ZWL.BLL.ERPCommon();
            MyModel.GetModel(int.Parse(Request.QueryString["ID"].ToString()));
            if (MyModel != null)
            {
                this.TextBox1.Text = MyModel.Code;
                this.TextBox3.Text = MyModel.CName;
                this.TextBox4.Text = MyModel.CType;
                this.TextBox5.Text = MyModel.CSort.ToString();
                this.TextBox6.Text = MyModel.CDescription;
            }


            //ZWL.Common.PublicMethod.SetSessionValue("WenJianList", MyModel.FuJianStr);
            //ZWL.Common.PublicMethod.BindDDL(this.CheckBoxList1, ZWL.Common.PublicMethod.GetSessionValue("WenJianList"));
        }
    }
Exemple #6
0
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        ZWL.BLL.ERPCommon MyModel = new ZWL.BLL.ERPCommon();
        MyModel.GetModel(int.Parse(Request.QueryString["ID"].ToString()));

        ZWL.BLL.ERPCommon Model = new ZWL.BLL.ERPCommon();
        Model.ID           = int.Parse(Request.QueryString["ID"].ToString());
        Model.Code         = this.TextBox1.Text;
        Model.CName        = this.TextBox3.Text;
        Model.CType        = this.TextBox4.Text;
        Model.CSort        = int.Parse(this.TextBox5.Text); //
        Model.CDescription = this.TextBox6.Text;
        Model.UpdateTime   = MyModel.UpdateTime;
        Model.Update();

        ////写系统日志
        //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, "共有参数修改成功!", "Common.aspx");
    }
Exemple #7
0
    //protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
    //{
    //    string FileNameStr = ZWL.Common.PublicMethod.UploadFileIntoDir(this.FileUpload1, DateTime.Now.Ticks.ToString() + System.IO.Path.GetExtension(FileUpload1.PostedFile.FileName));
    //    if (ZWL.Common.PublicMethod.GetSessionValue("WenJianList").Trim() == "")
    //    {
    //        ZWL.Common.PublicMethod.SetSessionValue("WenJianList", FileNameStr);
    //    }
    //    else
    //    {
    //        ZWL.Common.PublicMethod.SetSessionValue("WenJianList", ZWL.Common.PublicMethod.GetSessionValue("WenJianList") + "|" + FileNameStr);
    //    }
    //    ZWL.Common.PublicMethod.BindDDL(this.CheckBoxList1, ZWL.Common.PublicMethod.GetSessionValue("WenJianList"));
    //}
    //protected void ImageButton3_Click(object sender, ImageClickEventArgs e)
    //{
    //    try
    //    {
    //        for (int i = 0; i < this.CheckBoxList1.Items.Count; i++)
    //        {
    //            if (this.CheckBoxList1.Items[i].Selected == true)
    //            {
    //                ZWL.Common.PublicMethod.SetSessionValue("WenJianList", ZWL.Common.PublicMethod.GetSessionValue("WenJianList").Replace(this.CheckBoxList1.Items[i].Text, "").Replace("||", "|"));
    //            }
    //        }
    //        ZWL.Common.PublicMethod.BindDDL(this.CheckBoxList1, ZWL.Common.PublicMethod.GetSessionValue("WenJianList"));
    //    }
    //    catch
    //    { }
    //}
    //protected void ImageButton5_Click(object sender, ImageClickEventArgs e)
    //{
    //    try
    //    {
    //        if (this.CheckBoxList1.SelectedItem.Text.Trim().Length > 0)
    //        {
    //            Response.Write("<script>window.open('../DsoFramer/ReadFile.aspx?FilePath=" + this.CheckBoxList1.SelectedItem.Text + "');</script>");
    //        }
    //    }
    //    catch
    //    { }
    //}
    //protected void ImageButton6_Click(object sender, ImageClickEventArgs e)
    //{
    //    try
    //    {
    //        if (this.CheckBoxList1.SelectedItem.Text.Trim().Length > 0)
    //        {
    //            Response.Write("<script>window.open('../DsoFramer/EditFile.aspx?FilePath=" + this.CheckBoxList1.SelectedItem.Text + "');</script>");
    //        }
    //    }
    //    catch
    //    { }
    //}
    protected void btn_Sub_Click(object sender, EventArgs e)
    {
        ZWL.BLL.ERPCommon MyModel = new ZWL.BLL.ERPCommon();
        MyModel.GetModel(int.Parse(Request.QueryString["ID"].ToString()));

        ZWL.BLL.ERPCommon Model = new ZWL.BLL.ERPCommon();
        Model.ID = int.Parse(Request.QueryString["ID"].ToString());
        Model.Code = this.TextBox1.Text;
        Model.CName = this.TextBox3.Text;
        Model.CType = this.TextBox4.Text;
        Model.CSort = int.Parse(this.TextBox5.Text);     //
        Model.CDescription = this.TextBox6.Text;
        Model.UpdateTime = MyModel.UpdateTime;
        Model.Update();

        ////写系统日志
        //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();
         Response.Write("<script>alert('共有参数修改成功!');window.location.href='Common.aspx';</script>");
        //ZWL.Common.MessageBox.ShowAndRedirect(this, "共有参数修改成功!", "Common.aspx");
    }
Exemple #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ZWL.Common.PublicMethod.CheckSession();
            //绑定页面数据
            ZWL.BLL.ERPCommon MyModel = new ZWL.BLL.ERPCommon();
            MyModel.GetModel(int.Parse(Request.QueryString["ID"].ToString()));
            if (MyModel != null)
            {
                this.TextBox1.Text = MyModel.Code;
                this.TextBox3.Text = MyModel.CName;
                this.TextBox4.Text = MyModel.CType;
                this.TextBox5.Text = MyModel.CSort.ToString();
                this.TextBox6.Text = MyModel.CDescription;
            }
            ReturnInput.Value = Request.UrlReferrer.ToString() == null ? "../SystemManage/Common.aspx" : Request.UrlReferrer.ToString();

            //ZWL.Common.PublicMethod.SetSessionValue("WenJianList", MyModel.FuJianStr);
            //ZWL.Common.PublicMethod.BindDDL(this.CheckBoxList1, ZWL.Common.PublicMethod.GetSessionValue("WenJianList"));
        }
    }