Beispiel #1
0
    //完成
    protected void Button2_Click(object sender, EventArgs e)
    {
        DA_CopyBU copy2 = new DA_CopyBU();
        string    id    = copy2.GetIdBybill(this.bill.Text.ToString());

        Response.Redirect("EditPrintInfo.aspx?id=" + id);
    }
Beispiel #2
0
    //确定--更新复印单信息

    protected void Button2_Click(object sender, EventArgs e)
    {
        Hashtable ht = new Hashtable();

        foreach (string item in arr0)
        {
            ht[item] = Util.GetControlValue(this.bill.Parent.FindControl(item));
        }
        ht.Remove("bill");
        ht.Remove("billtime");
        ht.Remove("billmen");
        ht.Remove("zeren");
        bool check = true;

        if (check)
        {
            try
            {
                DA_CopyBU print3 = new DA_CopyBU();
                print3.UpdateCopyData(Request["id"], ht);
                Util.alert(this.Page, "操作提示:更新资料成功!");
            }
            catch
            {
                Util.alert(this.Page, "错误提示:更新资产数据失败!");
            }
        }
    }
Beispiel #3
0
    //添加复印文件
    protected void Button1_Click(object sender, EventArgs e)
    {
        object[] obj0  = new object[] { title, copycount };
        string[] info  = new string[] { "文件名称", "复印份数" };
        bool     check = true;

        for (int i = 0; i < info.Length; i++)
        {
            if (Util.GetControlValue((Control)obj0[i]) == null || Util.GetControlValue((Control)obj0[i]) == "")
            {
                check = false;
                Util.alert(this.Page, "错误提示:【" + info[i] + "】栏目不能为空!");
                break;
            }
        }
        if (check)
        {
            Hashtable ht = new Hashtable();
            ht.Add("bill", this.bill.Text);//加入复印单编号


            DA_CopyBU    copy1 = new DA_CopyBU();
            DA_JieYuanBU jyue1 = new DA_JieYuanBU();

            //通过文号获取文件ID
            string fileId = copy1.GetFileIdByTitle(this.title.Text.ToString().Trim());
            if (fileId == null)
            {
                Util.alert(this.Page, "文件【" + this.title.Text.ToString() + "】不存在!");
            }
            else
            {
                //判断文件是否已经被借阅
                DA_FilesBU file1      = new DA_FilesBU();
                bool       jyuestatus = file1.IsOrNotJieYue(fileId);
                if (jyuestatus)//
                {
                    ht.Add("fileid", fileId);
                    ht.Add("copycount", this.copycount.Text.ToString());
                    bool   result = copy1.AddCopyFileData(ht);
                    string id     = copy1.GetIdBybill(this.bill.Text.ToString());
                    copy1.Close();
                    if (result)
                    {
                        Util.alert(this.Page, "新增文件成功!");
                        Response.Redirect("AddCopyFile.aspx?bill=" + this.bill.Text.Trim());
                    }
                    else
                    {
                        Util.alert(this.Page, "错误提示:本复印单已存在此文件!");
                    }
                }
                else
                {
                    Util.alert(this.Page, "错误提示:此文件被借阅,不能复印!");
                }
            }
        }
    }
Beispiel #4
0
    //删除数据

    protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        string    id    = this.GridView1.DataKeys[e.RowIndex].Value.ToString();
        DA_CopyBU copy1 = new DA_CopyBU();

        copy1.DelCopyData(id);
        this.BindData2(copy1);
        copy1.Close();
    }
Beispiel #5
0
    private void BindData1(string zeren)
    {
        DA_CopyBU print1 = new DA_CopyBU();
        DataSet   ds     = print1.GetPrintList1(zeren);

        this.GridView1.DataSource = ds;
        this.GridView1.DataBind();
        print1.Close();
        ds.Dispose();
    }
Beispiel #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         DA_CopyBU copy1 = new DA_CopyBU();
         string    bill  = copy1.GetBillNum();
         this.bill.Text     = bill;
         this.billtime.Text = System.DateTime.Now.ToString("yyyy-MM-dd");
         this.billtime.Attributes["onfocus"] = "setday(this)";
         this.zeren.Attributes["readonly"]   = "";
         this.billmen.Text = User.Identity.Name;
     }
 }
Beispiel #7
0
    private void BindFiles(DA_CopyBU print)
    {
        bool flag = false;

        if (print == null)
        {
            print = new DA_CopyBU();
            flag  = true;
        }
        DA_CopyBU print1 = new DA_CopyBU();
        DataSet   ds1    = print1.GetFileList(this.bill.Text.ToString());

        Repeater1.DataSource = ds1;
        Repeater1.DataBind();
        if (flag)
        {
            print1.Close();
        }
    }
Beispiel #8
0
    private void SetControlData()
    {
        if (Request["id"] != null)
        {
            string    id     = Request["id"];
            DA_CopyBU print1 = new DA_CopyBU();
            DataSet   ds     = print1.GetDetailByID(id);
            print1.Close();

            if (ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < arr0.Length; i++)
                {
                    Util.SetControlValue(this.bill.Parent.FindControl(arr0[i]), ds.Tables[0].Rows[0][arr0[i]]);
                }

                this.billtime.Text = DateTime.Parse(ds.Tables[0].Rows[0]["billtime"].ToString()).ToString("yyyy-MM-dd");
            }
            ds.Dispose();
        }
    }
Beispiel #9
0
 protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     if (e.Item.FindControl("seldoc") != null)
     {
         string id = ((Label)e.Item.FindControl("seldoc")).Text;
         if (e.CommandName == "delete")
         {
             try
             {
                 DA_CopyBU copy1 = new DA_CopyBU();
                 copy1.DeleteFile(id);
                 this.BindFiles(copy1);
                 copy1.Close();
             }
             catch (Exception err1)
             {
                 Util.alert(this.Page, err1.Message);
             }
         }
     }
 }
Beispiel #10
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        object[] obj0  = new object[] { bill, billtime, billmen, zeren, remark };
        object[] obj1  = new object[] { bill, billtime, billmen, zeren };
        string[] info  = new string[] { "单据编号", "开票时间", "开票员", "复印人" };
        bool     check = true;

        for (int i = 0; i < info.Length; i++)
        {
            if (Util.GetControlValue((Control)obj1[i]) == null || Util.GetControlValue((Control)obj1[i]) == "")
            {
                check = false;
                Util.alert(this.Page, "错误提示:【" + info[i] + "】栏目不能为空!");
                break;
            }
        }
        if (check)
        {
            try
            {
                Hashtable ht = new Hashtable();
                Util.getPageData(obj0, ht);
                DA_CopyBU copy1 = new DA_CopyBU();
                copy1.TabCommand.InsertData(ht);
                copy1.Close();
                Util.alert(this.Page, "增加复印单成功!");
                DA_JieYuanBU jyue2 = new DA_JieYuanBU();
                string       id    = copy1.GetIdBybill(this.bill.Text.ToString());
                Response.Redirect("EditPrintInfo.aspx?id=" + id);
            }
            catch
            {
                Util.alert(this.Page, "错误提示:增加资产数据失败,可能的原因是数据类型有错误,请检查后重新输入!");
            }
        }
    }
Beispiel #11
0
 private void BindData2(DA_CopyBU print1)
 {
     this.GridView1.DataSource = print1.GetAllBill();
     this.GridView1.DataBind();
 }