예제 #1
0
        public void Add(DevTaskItem d)
        {
            SqlItemList sqlItems = Get(d);

            SetInsertIntoSql(SynnDataProvider.TableNames.DevTasks, sqlItems);
            ExecuteSql();
        }
예제 #2
0
        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);
        }
예제 #3
0
        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("אחד או יותר מהשדות ריקים");
            }
        }