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; } }
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; } } }