public void Add(DevTaskItem d) { SqlItemList sqlItems = Get(d); SetInsertIntoSql(SynnDataProvider.TableNames.DevTasks, sqlItems); ExecuteSql(); }
private SqlItemList Get(DevTaskItem u) { var sqlItems = new SqlItemList(); sqlItems.Add(new SqlItem("Description", u.Description)); sqlItems.Add(new SqlItem("Name", u.Name)); sqlItems.Add(new SqlItem("Status", u.Status)); return(sqlItems); }
public void Update(DevTaskItem d) { SqlItemList sqlItems = Get(d); var wItems = new SqlItemList { new SqlItem("Id", d.Id) }; SetUpdateSql(SynnDataProvider.TableNames.DevTasks, sqlItems, wItems); ExecuteSql(); }
protected void btnOk_Click(object sender, EventArgs e) { var d = new DevTaskItem { Description = txXtaskDesc.Text, Name = txdTaskName.Text, Status = (DevTaskStatus)cmbXStatus.SelectedValue.ToString().ToInteger(), Id = panelx.GetEditedItemId().Value }; DBController.DbAuth.Update(d); panelx.Hide(); AlertSuccess(); RefreshView(); }
protected void btnAdd_Command(object sender, CommandEventArgs e) { var row = (sender as ImageButton).NamingContainer as GridViewRow; var txtaskname = ((TextBox)row.FindControl("txtaskname")).Text; var txtaskdesc = ((TextBox)row.FindControl("txtaskdesc")).Text; if (txtaskname.NotEmpty()) { var d = new DevTaskItem { Name = txtaskname, Description = txtaskdesc, Status = DevTaskStatus.Open }; DBController.DbAuth.Add(d); AlertMessage(" פנייתך התקבלה בהצלחה - הנושא יטופל בהקדם "); RefreshView(); } else { AlertMessage("אחד או יותר מהשדות ריקים"); } }