Пример #1
0
    //绑定页面控件的值

    private void SetControlData()
    {
        if (Request.QueryString["id"] != null)
        {
            string     fileID = Request["id"];
            DA_FilesBU file1  = new DA_FilesBU();

            DataSet ds1 = file1.GetFileDetailByID(fileID);
            file1.Close();

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

                if (ds1.Tables[0].Rows[0]["jyuetime"] != DBNull.Value && ds1.Tables[0].Rows[0]["jyuetime"].ToString().Trim() != "")
                {
                    this.jyuetime.Text = DateTime.Parse(ds1.Tables[0].Rows[0]["jyuetime"].ToString()).ToString("yyyy-MM-dd");
                    this.djtime.Text   = DateTime.Parse(ds1.Tables[0].Rows[0]["djtime"].ToString()).ToString("yyyy-MM-dd");
                }
            }
            ds1.Dispose();
        }
    }
Пример #2
0
 protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     if (e.Item.FindControl("seldoc") != null)
     {
         string id = ((Label)e.Item.FindControl("seldoc")).Text;
         //string id=Request.QueryString[""]
         if (e.CommandName == "delete")
         {
             try
             {
                 DA_FilesBU file2 = new DA_FilesBU();
                 file2.DelteFile(id);
                 this.BindFiles(file2);
                 file2.Close();
             }
             catch (Exception err1)
             {
                 Util.alert(this.Page, err1.Message);
             }
         }
         else
         {
             Context.Items["id"] = id;
             Server.Transfer("AnJuanDetailEdit.aspx?id=" + id, false);
         }
     }
 }
Пример #3
0
    //
    protected void Button4_Click(object sender, EventArgs e)
    {
        Hashtable ht = new Hashtable();

        ht.Add("status", "1");
        DA_JieYuanBU jyue4 = new DA_JieYuanBU();
        //修改借阅单的状态

        bool result = jyue4.ShengChengJieYuanBill(Request.QueryString["id"], ht);

        if (result)
        {
            Util.alert(this.Page, "借阅单已产生!");
            //修改案卷中文件的借阅人、借阅时间,登记人、登记时间

            DA_JieYuanBU jyue1 = new DA_JieYuanBU();
            string[]     allId = jyue1.GetAllIdBybill(this.bill.Text);
            Hashtable    ht1   = new Hashtable();
            ht1.Add("djtime", this.billtime.Text.Trim());
            ht1.Add("dtmen", this.billmen.Text.ToString());
            ht1.Add("jyue", this.zeren.Text.ToString());
            ht1.Add("jyuetime", this.billtime.Text.Trim());
            for (int i = 0; i < allId.Length; i++)
            {
                DA_FilesBU file1 = new DA_FilesBU();
                file1.UpdateJieyueInfo(allId[i].ToString(), ht1);
            }
            Response.Redirect("FileJieyue.aspx");
        }
    }
Пример #4
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, "错误提示:此文件被借阅,不能复印!");
                }
            }
        }
    }
Пример #5
0
    //添加案卷文件
    protected void Button1_Click(object sender, EventArgs e)
    {
        object[] obj0  = new object[] { title, filecount, filefs };
        object[] obj1  = new object[] { title };
        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)
        {
            Hashtable ht = new Hashtable();
            Util.getPageData(obj0, ht);
            ht.Add("ajnum", this.ajnum.Text);
            if (ht["filecount"].ToString() == "")
            {
                ht.Remove("filecount");
            }
            if (ht["filefs"].ToString() == "")
            {
                ht.Remove("filefs");
            }
            DA_FilesBU file1  = new DA_FilesBU();
            bool       result = file1.InsertFileData(ht);

            file1.Close();
            if (result)
            {
                string url = Application["root"] + "/DangAn/AddFile.aspx?ajid=" + Request.QueryString["ajid"];
                PubComm.ShowInfo("提示:添加文件成功!", url);
            }
            else
            {
                Util.alert(this.Page, "错误提示:增加数据失败,请检查数据类型!");
            }
        }
    }
Пример #6
0
 //设置页面控件的值
 private void SetControlData()
 {
     if (Request.QueryString["fileID"] != null)
     {
         string     id    = Request["fileID"];
         DA_FilesBU file1 = new DA_FilesBU();
         DataSet    ds1   = file1.GetFileDetailByID(id);
         file1.Close();
         if (ds1.Tables[0].Rows.Count > 0)
         {
             for (int i = 0; i < arr1.Length; i++)
             {
                 Util.SetControlValue(this.ajnum.Parent.FindControl(arr1[i]), ds1.Tables[0].Rows[0][arr1[i]]);
             }
         }
         ds1.Dispose();
     }
 }
Пример #7
0
    private void BindFiles(DA_FilesBU file)
    {
        bool flag = false;

        if (file == null)
        {
            file = new DA_FilesBU();
            flag = true;
        }
        DA_FilesBU file1 = new DA_FilesBU();
        DataSet    ds1   = file1.GetFileList(this.ajnum.Text.ToString());

        Repeater1.DataSource = ds1;
        Repeater1.DataBind();
        if (flag)
        {
            file.Close();
        }
    }
Пример #8
0
    private void BindFiles(DA_FilesBU file)
    {
        bool flag = false;

        if (file == null)
        {
            file = new DA_FilesBU();
            flag = true;
        }
        DA_FilesBU file1 = new DA_FilesBU();
        DataSet    ds1   = file1.GetFileList(this.ajnum.Text.ToString());

        Repeater1.DataSource = ds1;
        Repeater1.DataBind();
        //this.depart.Text = ds1.Tables[0].Rows[0]["depart"].ToString();
        //this.zeren.Text = ds1.Tables[0].Rows[0]["zeren"].ToString();
        if (flag)
        {
            file.Close();
        }
    }
Пример #9
0
    //更新文件资料
    protected void Button1_Click(object sender, EventArgs e)
    {
        Hashtable ht = new Hashtable();

        foreach (string item in arr1)
        {
            ht[item] = Util.GetControlValue(this.ajnum.Parent.FindControl(item));
        }
        ht.Remove("ajnum");
        DA_FilesBU file2 = new DA_FilesBU();

        file2.UpdateFileData(Request["fileID"], ht);
        file2.Close();

        DA_AnJuanBU anjuan1 = new DA_AnJuanBU();
        string      id      = anjuan1.GetIdByAjnum(this.ajnum.Text);

        anjuan1.Close();

        string url = Application["root"] + "/DangAn/AnJuanDetailEdit.aspx?id=" + id;

        Comm.ShowInfo("操作提示:更新文件成功!", url);
    }
Пример #10
0
    //归还借阅文件
    protected void Button1_Click(object sender, EventArgs e)
    {
        Hashtable ht = new Hashtable();

        ht.Add("paytime1", this.paytim1.Text.ToString());
        ht.Add("status", "2");
        DA_JieYuanBU jyue1 = new DA_JieYuanBU();

        jyue1.UpdatePaytime(Request.QueryString["id"], ht);
        Hashtable ht1 = new Hashtable();

        ht1.Add("jyue", DBNull.Value);
        ht1.Add("jyuetime", DBNull.Value);
        ht1.Add("djtime", DBNull.Value);
        ht1.Add("dtmen", DBNull.Value);
        string[] allId = jyue1.GetAllIdBybill(this.bill.Text);
        for (int i = 0; i < allId.Length; i++)
        {
            DA_FilesBU file1 = new DA_FilesBU();
            file1.RemoveJieyueInfo(allId[i].ToString(), ht1);
        }

        Response.Redirect("FileJieyue.aspx");
    }