示例#1
0
        private void updateCustom_Click(object sender, EventArgs e)
        {
            ConditionUpdateSdi conditionUpdateSdi = new ConditionUpdateSdi();

            conditionUpdateSdi.Grade   = gradeTextBox.Text;
            conditionUpdateSdi.Percent = Convert.ToInt32(percentTextBox.Text);
            Condition condition = conditionService.updateCondition(conditionUpdateSdi);

            if (condition != null)
            {
                this.Close();
                conditionForm.updateDataToTable(condition);
            }
        }
示例#2
0
        public Condition updateCondition(ConditionUpdateSdi conditionUpdateSdi)
        {
            con = SqlServerConnection.getConnnection();
            con.Open();
            StringBuilder sql = new StringBuilder();

            sql.Append(" update Condition  set " +
                       " cost_percentage = @percent ");
            sql.Append(" where grade = @grade");
            SqlCommand command = new SqlCommand(sql.ToString(), con);

            command.Parameters.AddWithValue("percent", conditionUpdateSdi.Percent);
            command.Parameters.AddWithValue("grade", conditionUpdateSdi.Grade);
            command.ExecuteNonQuery();
            con.Close();
            return(this.getConditionByGrade(conditionUpdateSdi.Grade));
        }
示例#3
0
 public Condition updateCondition(ConditionUpdateSdi conditionUpdateSdi)
 {
     return(conditionRepoService.updateCondition(conditionUpdateSdi));
 }