示例#1
0
        public string SaveFlowLayOut(string defineID, string xml)
        {
            string result = string.Empty;

            try
            {
                var flowDef = entities.S_WF_DefFlow.Where(c => c.ID == defineID).SingleOrDefault();
                flowDef.ViewConfig = xml;
                entities.SaveChanges();

                result = "T:" + defineID;
            }
            catch (Exception exp)
            {
                LogWriter.Error(exp);

                if (exp.InnerException != null)
                {
                    result = "F:" + defineID + ":" + exp.InnerException.Message;
                }
                else
                {
                    result = "F:" + defineID + ":" + exp.Message;
                }
            }
            return(result);
        }
示例#2
0
        public ActionResult Create([Bind(Include = "ActivityStatusId,ActivityStatusName,UserName")] ActivityStatus activityStatus)
        {
            if (ModelState.IsValid)
            {
                db.ActivityStatus.Add(activityStatus);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(activityStatus));
        }
示例#3
0
        public ActionResult Create([Bind(Include = "ProjectStatusId,ProjectStatusName")] ProjectStatus projectStatus)
        {
            if (ModelState.IsValid)
            {
                projectStatus.UserName = Convert.ToString(Session["Username"]);
                db.ProjectStatus.Add(projectStatus);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(projectStatus));
        }
示例#4
0
 public ActionResult Create(ActivityModel activityModel)
 {
     if (ModelState.IsValid)
     {
         var activity = AutoMapper.Mapper.Map <Activity>(activityModel);
         activity.UserName = Convert.ToString(Session["Username"]);
         db.Activity.Add(activity);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CustomerId = new SelectList(db.Customer, "CustomerId", "CustomerName", activityModel.CustomerId);
     return(View(activityModel));
 }
        public ActionResult Create(WorkFlowModel workFlowModel)
        {
            if (ModelState.IsValid)
            {
                var workFlow = AutoMapper.Mapper.Map <WorkFlow>(workFlowModel);
                workFlow.UserName = Convert.ToString(Session["Username"]);
                db.WorkFlow.Add(workFlow);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.CustomerID = new SelectList(db.Customer, "CustomerId", "CustomerName", workFlowModel.CustomerID);
            return(View(workFlowModel));
        }
        public ActionResult Create(CustomerViewModel customerViewModel)
        {
            if (ModelState.IsValid)
            {
                Customer customerObject = db.Customer.Where(x => x.CustomerEmail == customerViewModel.CustomerEmail).FirstOrDefault();
                if (customerObject == null)
                {
                    ModelState.AddModelError("", "Customer already exists");
                }
                AesAlgorithm aesAlgorithm = new AesAlgorithm();

                var customer = AutoMapper.Mapper.Map <Customer>(customerViewModel);
                customer.Status     = true;
                customer.CustomerId = 0;
                customer.CreatedBy  = Convert.ToInt32(Session["UserID"]);
                db.Customer.Add(customer);
                db.SaveChanges();
                int customerId     = customer.CustomerId;
                var passwordMaster = new PasswordMaster
                {
                    CreateDate = DateTime.Now,
                    UserId     = customerId,
                    PasswordId = 0,
                    Password   = aesAlgorithm.EncryptString(customerViewModel.Password),
                    UserEmail  = customerViewModel.CustomerEmail
                };

                var passwordId = _iPassword.SavePassword(passwordMaster);
                if (passwordId != -1)
                {
                    var savedAssignedRoles = new SavedAssignedRoles()
                    {
                        RoleId         = 3,
                        UserId         = customerId,
                        AssignedRoleId = 0,
                        Status         = true,
                        CreateDate     = DateTime.Now,
                    };
                    _savedAssignedRoles.AddAssignedRoles(savedAssignedRoles);

                    TempData["MessageCreateUsers"] = "User Created Successfully";
                }
                return(RedirectToAction("Index"));
            }
            else
            {
                return(View("Create"));
            }
        }
示例#7
0
        public ActionResult Create(WorkflowActivityStreamModel workflowActivityStreamModel)
        {
            if (ModelState.IsValid)
            {
                var workflowActivityStream = AutoMapper.Mapper.Map <WorkflowActivityStream>(workflowActivityStreamModel);
                workflowActivityStream.UserName = Convert.ToString(Session["Username"]);
                db.WorkflowActivityStream.Add(workflowActivityStream);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.ActivityID = new SelectList(db.Activity, "ActivityId", "ActivityName", workflowActivityStreamModel.ActivityID);
            ViewBag.WorkflowID = new SelectList(db.WorkFlow, "WorkflowID", "WorkflowName", workflowActivityStreamModel.WorkflowID);
            return(View(workflowActivityStreamModel));
        }
示例#8
0
        public ActionResult Create(ProjectModel projectModel)
        {
            if (ModelState.IsValid)
            {
                var project = AutoMapper.Mapper.Map <Project>(projectModel);
                project.UserName = Convert.ToString(Session["Username"]);
                db.Project.Add(project);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.ProjectStatusId    = new SelectList(db.ProjectStatus, "ProjectStatusId", "ProjectStatusName", projectModel.ProjectStatusId);
            ViewBag.WorkflowActivityID = new SelectList(db.WorkFlow, "WorkflowID", "WorkflowName", projectModel.WorkflowActivityID);
            return(View(projectModel));
        }
示例#9
0
        public ActionResult Create(ProjectActivityModel projectActivity)
        {
            if (ModelState.IsValid)
            {
                var project = AutoMapper.Mapper.Map <ProjectActivity>(projectActivity);
                project.UserName = Convert.ToString(Session["Username"]);
                db.ProjectActivity.Add(project);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.ActivityId       = new SelectList(db.Activity, "ActivityId", "ActivityName", projectActivity.ActivityId);
            ViewBag.ActivityStatusId = new SelectList(db.ActivityStatus, "ActivityStatusId", "ActivityStatusName", projectActivity.ActivityStatusId);
            ViewBag.ProjectId        = new SelectList(db.Project, "ProjectId", "ProjectName", projectActivity.ProjectId);
            return(View(projectActivity));
        }