public SetTaskGrade(string grade_id, string dept_id, DataTable current_table, SysTaskCheck systaskcheck) { InitializeComponent(); this.systaskcheck = systaskcheck; gradeId = grade_id; deptId = dept_id; currentTable = current_table; string grade_up; string grade_down; switch (gradeId) { case "1": _grade_up.Text = "100"; _grade_up.IsEnabled = false; break; case "5": _grade_down.Text = "0"; _grade_down.IsEnabled = false; break; default: break; } string[] sArray = sysTaskContract.GetTaskParameter(PubClass.userInfo.DepartmentID, grade_id).Split('_'); foreach (var s in sArray) { _grade_up.Text = s[0].ToString(); _grade_down.Text = s[1].ToString(); } }
public SetTaskGrade(IDBOperation dbOperation, string grade_id, string dept_id, DataTable current_table, SysTaskCheck systaskcheck) { InitializeComponent(); this.dbOperation = dbOperation; this.systaskcheck = systaskcheck; gradeId = grade_id; deptId = dept_id; currentTable = current_table; string grade_up; string grade_down; switch (gradeId) { case "1": _grade_up.Text = "100"; _grade_up.IsEnabled = false; break; case "2": grade_up = dbOperation.GetDbHelper().GetSingle(string.Format("select parameterDown from t_city_grade where cityId = '{0}' and gradeId = '{1}'", (Application.Current.Resources["User"] as UserInfo).DepartmentID, "1")).ToString(); grade_down = dbOperation.GetDbHelper().GetSingle(string.Format("select parameterUp from t_city_grade where cityId = '{0}' and gradeId = '{1}'", (Application.Current.Resources["User"] as UserInfo).DepartmentID, "3")).ToString(); _grade_up.Text = grade_up; _grade_down.Text = grade_down; break; case "3": grade_up = dbOperation.GetDbHelper().GetSingle(string.Format("select parameterDown from t_city_grade where cityId = '{0}' and gradeId = '{1}'", (Application.Current.Resources["User"] as UserInfo).DepartmentID, "2")).ToString(); grade_down = dbOperation.GetDbHelper().GetSingle(string.Format("select parameterUp from t_city_grade where cityId = '{0}' and gradeId = '{1}'", (Application.Current.Resources["User"] as UserInfo).DepartmentID, "4")).ToString(); _grade_up.Text = grade_up; _grade_down.Text = grade_down; break; case "4": grade_up = dbOperation.GetDbHelper().GetSingle(string.Format("select parameterDown from t_city_grade where cityId = '{0}' and gradeId = '{1}'", (Application.Current.Resources["User"] as UserInfo).DepartmentID, "3")).ToString(); grade_down = dbOperation.GetDbHelper().GetSingle(string.Format("select parameterUp from t_city_grade where cityId = '{0}' and gradeId = '{1}'", (Application.Current.Resources["User"] as UserInfo).DepartmentID, "5")).ToString(); _grade_up.Text = grade_up; _grade_down.Text = grade_down; break; case "5": _grade_down.Text = "0"; _grade_down.IsEnabled = false; break; default: break; } }
public SetTaskGrade(IDBOperation dbOperation, string grade_id, string dept_id, DataTable current_table,SysTaskCheck systaskcheck) { InitializeComponent(); this.dbOperation = dbOperation; this.systaskcheck = systaskcheck; gradeId = grade_id; deptId = dept_id; currentTable = current_table; string grade_up; string grade_down; switch (gradeId) { case "1": _grade_up.Text = "100"; _grade_up.IsEnabled = false; break; case "2": grade_up = dbOperation.GetDbHelper().GetSingle(string.Format("select parameterDown from t_city_grade where cityId = '{0}' and gradeId = '{1}'", (Application.Current.Resources["User"] as UserInfo).DepartmentID,"1")).ToString(); grade_down = dbOperation.GetDbHelper().GetSingle(string.Format("select parameterUp from t_city_grade where cityId = '{0}' and gradeId = '{1}'", (Application.Current.Resources["User"] as UserInfo).DepartmentID, "3")).ToString(); _grade_up.Text = grade_up; _grade_down.Text = grade_down; break; case "3": grade_up = dbOperation.GetDbHelper().GetSingle(string.Format("select parameterDown from t_city_grade where cityId = '{0}' and gradeId = '{1}'", (Application.Current.Resources["User"] as UserInfo).DepartmentID, "2")).ToString(); grade_down = dbOperation.GetDbHelper().GetSingle(string.Format("select parameterUp from t_city_grade where cityId = '{0}' and gradeId = '{1}'", (Application.Current.Resources["User"] as UserInfo).DepartmentID, "4")).ToString(); _grade_up.Text = grade_up; _grade_down.Text = grade_down; break; case "4": grade_up = dbOperation.GetDbHelper().GetSingle(string.Format("select parameterDown from t_city_grade where cityId = '{0}' and gradeId = '{1}'", (Application.Current.Resources["User"] as UserInfo).DepartmentID, "3")).ToString(); grade_down = dbOperation.GetDbHelper().GetSingle(string.Format("select parameterUp from t_city_grade where cityId = '{0}' and gradeId = '{1}'", (Application.Current.Resources["User"] as UserInfo).DepartmentID, "5")).ToString(); _grade_up.Text = grade_up; _grade_down.Text = grade_down; break; case "5": _grade_down.Text = "0"; _grade_down.IsEnabled = false; break; default: break; } }