/// <summary>
        /// 编辑流程分类
        /// </summary>
        /// <returns></returns>
        public ActionResult EditProc_Type(Proc_Type model)
        {
            AjaxReturnData result    = new AjaxReturnData();
            int            EditCount = 0;

            if (model.ObjectId == "" || model.ObjectId == null)
            {
                //新增
                model.ObjectId = Guid.NewGuid().ToString();
                EditCount      = _procType.Insert <Proc_Type>(model);
            }
            else
            {
                Dictionary <string, object> param = new Dictionary <string, object>();
                param.Add("ObjectId", model.ObjectId);
                //修改
                EditCount = _procType.UpdateTable <Proc_Type>(model, param);
            }
            if (EditCount > 0)
            {
                result.States  = true;
                result.Message = "成功.";
            }
            else
            {
                result.States  = false;
                result.Message = "失败.";
            }

            return(AjaxJson(result));
        }
Example #2
0
        protected void RadGridProcessTypes_UpdateCommand(object sender, GridCommandEventArgs e)
        {
            RadComboBox      cmbProcessCat  = e.Item.FindControl("cmbProcessCat") as RadComboBox;
            TextBox          txtProcessType = e.Item.FindControl("txtProcessType") as TextBox;
            GridEditableItem dateItem       = e.Item as GridEditableItem;
            int       ProcId      = Convert.ToInt32(dateItem.GetDataKeyValue("processId"));
            Proc_Type processType = getProcessTypeById(ProcId);

            processType.name       = txtProcessType.Text;
            processType.CategoryId = Convert.ToInt32(cmbProcessCat.SelectedValue);
            db.SaveChanges();
            RadAjaxManager.ResponseScripts.Add(@"radalert('you have updated a process type successfuly !!', 400, 135,'update succeeded !!');");
        }
Example #3
0
 protected void RadGridProcessTypes_DeleteCommand(object sender, GridCommandEventArgs e)
 {
     try
     {
         GridEditableItem dateItem = e.Item as GridEditableItem;
         int       ProcId          = Convert.ToInt32(dateItem.GetDataKeyValue("processId"));
         Proc_Type processType     = getProcessTypeById(ProcId);
         db.DeleteObject(processType);
         db.SaveChanges();
         RadAjaxManager.ResponseScripts.Add(@"radalert('you have deleted a process type successfuly !!', 400, 135,'delete succeeded !!');");
     }
     catch (Exception ex)
     {
         RadAjaxManager.ResponseScripts.Add(@"radalert('" + ex.Message + "', 400, 135,'delete failed !!');");
     }
 }
Example #4
0
        protected void RadGridProcessTypes_InsertCommand(object sender, GridCommandEventArgs e)
        {
            RadComboBox cmbProcessCat  = e.Item.FindControl("cmbProcessCat") as RadComboBox;
            TextBox     txtProcessType = e.Item.FindControl("txtProcessType") as TextBox;

            if (cmbProcessCat.SelectedIndex != -1)
            {
                Proc_Type processType = new Proc_Type();
                processType.name       = txtProcessType.Text;
                processType.CategoryId = Convert.ToInt32(cmbProcessCat.SelectedValue);
                db.AddToProc_Type(processType);
                db.SaveChanges();
                RadAjaxManager.ResponseScripts.Add(@"radalert('you have added a process type successfuly !!', 400, 135,'adding succeeded !!');");
            }
            else
            {
                RadAjaxManager.ResponseScripts.Add(@"radalert('please check your entries !!', 400, 135,'adding failed !!');");
            }
        }