예제 #1
0
        //搜索
        private void button3_Click(object sender, EventArgs e)
        {
            string   ContractId  = this.ContractID.Text;
            string   projectName = this.ProgramName.Text;
            DateTime start       = this.AgreeStartDate.Value;
            DateTime end         = this.AgreeEndDate.Value;

            if (start > end)
            {
                MessageBox.Show("开始日期必须小于结束日期!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                if (this.Downloadable.Checked == true)
                {
                    Search s = new Search();
                    s.EmployeeId   = UserHelper.UserInfo.Id;
                    s.ConId        = ContractId;
                    s.ProjectName  = projectName;
                    s.DateBegin    = start;
                    s.DateEnd      = end;
                    s.Downloadable = 1;

                    List <SHDJContract> list = new List <SHDJContract>();
                    list = _sc.SearchSignedHDJConstract(s);


                    this.DoneListView.AutoGenerateColumns = false;
                    this.DoneListView.DataSource          = list;

                    DataGridViewLinkColumn download = new DataGridViewLinkColumn();
                    download.Text       = "下载签单附件";
                    download.Name       = "LinkDownLoad";
                    download.HeaderText = "下载签单附件";
                    download.Width      = 150;
                    download.UseColumnTextForLinkValue = true;
                    this.DoneListView.Columns.Add(download);
                }
                else
                {
                    Search s = new Search();
                    s.EmployeeId   = UserHelper.UserInfo.Id;
                    s.ConId        = ContractId;
                    s.ProjectName  = projectName;
                    s.DateBegin    = start;
                    s.DateEnd      = end;
                    s.Downloadable = 0;

                    List <SHDJContract> list = new List <SHDJContract>();
                    list = _sc.SearchSignedHDJConstract(s);


                    this.DoneListView.AutoGenerateColumns = false;
                    this.DoneListView.DataSource          = list;
                }
            }
        }