public static bool TaskAdd(Model.T_D_TASK_MSTModel model) { Access.FactoryT_D_TASK_MSTAccess af = new Access.FactoryT_D_TASK_MSTAccess(); int ret = af.Add(model); return(ret > 0); }
public static Model.T_D_TASK_MSTModel GetTaskFromId(string taskId) { Model.T_D_TASK_MSTModel model = new Model.T_D_TASK_MSTModel(); Access.FactoryT_D_TASK_MSTAccess af = new Access.FactoryT_D_TASK_MSTAccess(); model = af.Query(taskId); return(model); }
public static bool TaskDel(string taskId) { Access.FactoryT_D_TASK_MSTAccess af = new Access.FactoryT_D_TASK_MSTAccess(); Model.T_D_TASK_MSTModel model = af.Query(taskId); model.SFSC = 1; return(af.Modify(model) > 0); }
private void gridView3_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) { Model.T_D_TASK_MSTModel model = gridView3.GetFocusedRow() as Model.T_D_TASK_MSTModel; if (model == null) { return; } SetValue(model.ID); }
private void SetValue(string taskId) { m_SelectTaskModel = Access.Task.GetTaskFromId(taskId); txt_TASKNAME.Text = m_SelectTaskModel.TASKNAME; txt_TASKNUMBERTYPE.SelectedIndex = m_SelectTaskModel.TASKNUMBER == -1 ? 0 : 1; txt_TASKNUMBER.Text = m_SelectTaskModel.TASKNUMBER.ToString(); txt_BEGINDATE.DateTime = Convert.ToDateTime(m_SelectTaskModel.BEGINDATETIME); txt_BEGINTIME.Time = Convert.ToDateTime(m_SelectTaskModel.BEGINDATETIME); txt_INTERVAL.Text = m_SelectTaskModel.INTERVAL.ToString(); txt_INTERVALTYPE.SelectedIndex = Careysoft.Basic.Public.BConvert.ToInt(m_SelectTaskModel.INTERVALTYPE); txt_INTERVALADDTYPE.SelectedIndex = Careysoft.Basic.Public.BConvert.ToInt(m_SelectTaskModel.INTERVALADDTYPE); txt_SFJY_S.Checked = m_SelectTaskModel.SFJY == 1; txt_SFJY_F.Checked = m_SelectTaskModel.SFJY == 0; txt_TASKDISCRIBE.Text = m_SelectTaskModel.TASKDISCRIBE; gridControl1.DataSource = m_SelectTaskModel.SlvList; if (m_SelectTaskModel.SlvList.Count > 0) { gridControl2.DataSource = m_SelectTaskModel.SlvList[0].SlvList; } }
private void btn_save_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(txt_TASKNAME.Text)) { xtraTabControl1.SelectedTabPageIndex = 0; XtraMessageBox.Show("任务名称不能为空"); txt_TASKNAME.Focus(); return; } if (String.IsNullOrEmpty(txt_INTERVAL.Text)) { xtraTabControl1.SelectedTabPageIndex = 0; XtraMessageBox.Show("间隔时间不能为空"); txt_INTERVAL.Focus(); return; } if (Careysoft.Basic.Public.BConvert.ToInt(txt_INTERVAL.Text) <= 0) { xtraTabControl1.SelectedTabPageIndex = 0; XtraMessageBox.Show("间隔时间需要大于0"); txt_INTERVAL.Focus(); return; } List <Model.T_D_TASK_SLVModel> models = gridControl1.DataSource as List <Model.T_D_TASK_SLVModel>; if (models.Count == 0) { XtraMessageBox.Show("请添加SqlData"); xtraTabControl1.SelectedTabPageIndex = 1; return; } foreach (Model.T_D_TASK_SLVModel model in models) { if (model.TASKTYPE == "0") { if (String.IsNullOrEmpty(model.OUTPUTTYPE) || String.IsNullOrEmpty(model.OUTPUTPATH)) { XtraMessageBox.Show("请添加输出路径"); xtraTabControl1.SelectedTabPageIndex = 1; return; } } else { model.OUTPUTTYPE = ""; model.OUTPUTPATH = ""; } } Model.T_D_TASK_MSTModel modelMst = new Model.T_D_TASK_MSTModel(); modelMst.TASKNAME = txt_TASKNAME.Text; modelMst.TASKNUMBER = Careysoft.Basic.Public.BConvert.ToInt(txt_TASKNUMBER.Text); modelMst.BEGINDATETIME = txt_BEGINDATE.DateTime.ToString("yyyy-MM-dd") + " " + txt_BEGINTIME.Time.ToString("HH:mm:ss"); modelMst.LASTDATETIME = modelMst.BEGINDATETIME; modelMst.INTERVAL = Careysoft.Basic.Public.BConvert.ToInt(txt_INTERVAL.Text); modelMst.INTERVALTYPE = txt_INTERVALTYPE.SelectedIndex.ToString(); modelMst.INTERVALADDTYPE = txt_INTERVALADDTYPE.SelectedIndex.ToString(); modelMst.GROUPID = m_GroupId; if (txt_SFJY_F.Checked) { modelMst.SFJY = 0; } else { modelMst.SFJY = 1; } modelMst.TASKDISCRIBE = txt_TASKDISCRIBE.Text; modelMst.SlvList = models; if (Access.Task.TaskAdd(modelMst)) { DialogResult = System.Windows.Forms.DialogResult.OK; } else { XtraMessageBox.Show("新增失败"); } }