protected void FindValue() { vUTPCycle startingCycle;//��ʼ���� vUTPCycle endingCycle;//��ֹ���� Boolean startCycle=false;//�Ƿ�����ʼ���� Boolean endCycle=false;//�Ƿ��ǽ������� RadComboBoxItem endingCycleComboBox; RadComboBoxItem startingCycleComboBox; string[] cycle; if (this.KeyId != string.Empty) { if (SchedulerObj.Company != null) { rctxtCompany.SelectedValue = SchedulerObj.Company.Trim(); } if (SchedulerObj.Cycle!=null) { cycle = SchedulerObj.Cycle.Split(','); if (SchedulerObj.Cycle != null) { cycle = SchedulerObj.Cycle.Split(','); if (cycle!=null) { int i=0; foreach (var item in cycle) { if(i == 0) { if (item.Equals("N/A")) { //�����ʼ���� rctxtStartingCycle.Items.Clear(); startingCycleComboBox = new RadComboBoxItem("N/A", "N/A"); rctxtStartingCycle.Items.Add(startingCycleComboBox); } else { rctxtStartingCycle.SelectedValue = item.Trim(); } i++; //�Ƿ����ݼ���first if (!item.Equals("N/A")) { this.OrderBy = " it.Cycle asc"; BLL_vUTPCustomer = new vUTPCustomerBLL(); startingCycle = BLL_vUTPCustomer.FindFirstCycleByCompanyId(rctxtCompany.SelectedValue, this.OrderBy); if (item.Equals(startingCycle.Cycle.ToString())) { startCycle = true; } } }else if(i == 1) { if (item.Equals("N/A")) { //�����ֹ���� rctxtEndingCycle.Items.Clear(); endingCycleComboBox = new RadComboBoxItem("N/A", "N/A"); rctxtEndingCycle.Items.Add(endingCycleComboBox); } else { rctxtEndingCycle.SelectedValue = item.Trim(); } //�Ƿ����ݵ�Last if (!item.Equals("N/A")) { endingCycle = BLL_vUTPCustomer.FindLastCycleByCompanyId(rctxtCompany.SelectedValue, this.OrderBy); if (item.Equals(endingCycle.Cycle.ToString())) { endCycle = true; } } } } } } } if (SchedulerObj.Copy!=null&&SchedulerObj.Copy.Equals("True")) { chkCopy.Checked=true; } if (SchedulerObj.Calc != null && SchedulerObj.Calc.Equals("True")) { chkCalc.Checked = true; } if (SchedulerObj.Status != null) { if (SchedulerObj.Status.Trim().Equals("All")) { rctxtStatusCode.SelectedValue = "All"; }else { rctxtStatusCode.SelectedValue = SchedulerObj.Status.Trim(); } } //�����ʼ����ͽ������������ݵ�frist��last����AllCycleΪtrue if (startCycle == true && endCycle==true) { chkAllCycles.Checked = true; //����ؼ��û� rctxtEndingCycle.Enabled = false; rctxtStartingCycle.Enabled = false; } } }
protected void chkAllCycles_CheckedChanged(object sender, EventArgs e) { this.OrderBy = " it.Cycle asc"; vUTPCycle startingCycle;//��ʼ���� vUTPCycle endingCycle;//��ֹ���� string vUTPCompanyId; if (chkAllCycles.Checked==true) { vUTPCompanyId=rctxtCompany.SelectedValue; if (vUTPCompanyId != "N/A" && !rctxtEndingCycle.SelectedValue.Equals("N/A") && !rctxtStartingCycle.SelectedValue.Equals("N/A")) { BLL_vUTPCustomer = new vUTPCustomerBLL(); startingCycle = BLL_vUTPCustomer.FindFirstCycleByCompanyId(vUTPCompanyId, this.OrderBy); endingCycle = BLL_vUTPCustomer.FindLastCycleByCompanyId(vUTPCompanyId, this.OrderBy); //���ռ丳ֵ rctxtStartingCycle.SelectedValue = startingCycle.Cycle.ToString().Trim(); rctxtEndingCycle.SelectedValue = endingCycle.Cycle.ToString().Trim(); //����ؼ��û� rctxtEndingCycle.Enabled = false; rctxtStartingCycle.Enabled = false; } } else { rctxtEndingCycle.Enabled = true; rctxtStartingCycle.Enabled = true; } }