//完成
    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);
    }
    //添加复印文件
    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, "错误提示:此文件被借阅,不能复印!");
                }
            }
        }
    }
Exemple #3
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, "错误提示:增加资产数据失败,可能的原因是数据类型有错误,请检查后重新输入!");
            }
        }
    }