private void button4_Click(object sender, EventArgs e) { SmServLive.ServHuvRepTidCL sht = new SmServLive.ServHuvRepTidCL(); sht.ID = Convert.ToInt32(label5.Text); sht.VartOrdernr = vartOrdernr; if (comboBox2.SelectedIndex != -1) { sht.AnvId = comboBox2.SelectedValue.ToString(); } sht.Datum = Convert.ToDateTime(comboBox1.SelectedValue); sht.Tid = Convert.ToDecimal(textBox1.Text); sht.TimeTypeID = Convert.ToInt32(comboBox3.SelectedValue); sht.SalartID = Convert.ToInt32(comboBox4.SelectedValue); if (comboBox5.SelectedIndex != -1) { sht.RepKatID = comboBox5.SelectedValue.ToString(); } sht = cl.saveServHuvRepTid(ident, sht); if (sht.ErrCode != 0) { label5.Text = sht.ErrCode.ToString() + " " + sht.ErrMessage; } else { label5.Text = sht.ID.ToString(); } }
private void button5_Click(object sender, EventArgs e) { login(); dataGridView3.AutoGenerateColumns = true; SmServLive.ServHuvRepTidCL[] res = null; if (tbID.Text != "") { BindingList <SmServLive.ServHuvRepTidCL> bl = new BindingList <SmServLive.ServHuvRepTidCL>(); SmServLive.ServHuvRepTidCL r = cl.getServHuvRepTid(ident, Convert.ToInt32(tbID.Text)); bl.Add(r); dataGridView3.DataSource = bl; } if (tbOrdernr.Text != "" && tbUser.Text != "") { res = cl.getServHuvRepTidForShAnv(ident, tbOrdernr.Text, tbUser.Text); dataGridView3.DataSource = res; } if (tbOrdernr.Text != "" && tbUser.Text == "") { res = cl.getServHuvRepTidForSH(ident, tbOrdernr.Text); dataGridView3.DataSource = res; } }