示例#1
0
 public void update_totalPrice()
 {
     for (int i = 0; i < dt_update_total_price.Rows.Count; i++)
     {
         //dt_update_total_price;
         string difficult = dt_update_total_price.Rows[i]["difficult"].ToString();
         string price     = dt_update_total_price.Rows[i]["price"].ToString();
         string id        = dt_update_total_price.Rows[i]["id_total"].ToString();
         var    comand    = "update total set difficult=" + difficult + ", payment=" + price.Replace(',', '.') + " where id=" + id;
         sql.update_comand(comand);
     }
 }
示例#2
0
        private void insertValues()
        {
            if (insertList.Count == 0)
            {
                return;
            }
            string query = @"insert into tabel values";

            foreach (var val in insertList)
            {
                if (textList[val].Text == "")
                {
                    continue;
                }
                query = query + ",(" + labelList[val].Text.Split(' ')[0] + ", '" + searchdate.ToString("yyyy-MM-01") + "','" + textList[val].Text + "')";
            }
            query = query.Replace("s,(", "s(");
            sql.update_comand(query);
        }
        private void repositoryItemComboBox1_EditValueChanged(object sender, EventArgs e)
        {
            DevExpress.XtraEditors.ComboBoxEdit comboBox = sender as DevExpress.XtraEditors.ComboBoxEdit;
            string date       = year + "-" + month + "-" + column_name.Substring(1);
            string status     = comboBox.SelectedItem.ToString();
            string id_creator = view_calendar.GetFocusedRowCellValue("id_creator").ToString();
            string id_models  = view_calendar.GetFocusedRowCellValue("id_models").ToString();
            string comand;
            string id         = check_record(date, id_models, id_creator);
            string N_protocol = isSov(status);

            if (string.IsNullOrEmpty(id))
            {
                comand = "insert into calendar ([id_tn],[date],[id_models],[status],[N_protocol])VALUES(" + id_creator + ",'" + date + "'," + id_models + ",'" + status + "'," + N_protocol + ")";
            }
            else
            {
                comand = "update calendar set [status]='" + status + "',[N_protocol]=" + N_protocol + " where id=" + id;
            }
            class_Sql.update_comand(comand);
            updateStatusModels(id_models, id_creator);
        }