Пример #1
0
        public static DbManagerEntity DbManagerEntityMapper(Ta_Manager tentity)
        {
            var resultl = new DbManagerEntity
            {
                mid      = tentity.mid,
                mguid    = tentity.mguid,
                mcontent = tentity.mcontent,
                mrowtype = tentity.mrowtype,
            };

            return(resultl);
        }
Пример #2
0
        public ActionResult Save(TaskEntity input)
        {
            bool status = false;

            if (ModelState.IsValid)
            {
                if (input.managerid > 0)
                {
                    var model = _mainobj.GetById(input.managerid);

                    var oldsingle = new TaskEntity();
                    oldsingle                 = JsonConvert.DeserializeObject <TaskEntity>(model.mcontent);
                    oldsingle.AmtPaid         = input.AmtPaid;
                    oldsingle.AssignedTo      = input.AssignedTo;
                    oldsingle.Cost            = input.Cost;
                    oldsingle.LastUpdatedate  = DateTime.Now;
                    oldsingle.taskdescription = input.taskdescription;
                    oldsingle.taskname        = input.taskname;
                    oldsingle.CurrentStatus   = input.CurrentStatus;

                    string json = JsonConvert.SerializeObject(oldsingle);
                    model.mcontent = json;
                    var result = _mainobj.Update(input.managerid, model);
                    status = true;
                }
                else
                {
                    var projectid = Convert.ToInt32(Session["projectid"]);
                    if (projectid > 0)
                    {
                        input.projectid      = projectid;
                        input.createdate     = DateTime.Now;
                        input.createdBy      = 1; ///////////////////////// Temporary data
                        input.isPublished    = true;
                        input.LastUpdatedate = DateTime.Now;
                        input.publisheddate  = DateTime.Now;
                        var model = new DbManagerEntity();

                        string json = JsonConvert.SerializeObject(input);
                        model.mcontent = json;
                        model.mrowtype = StaticData.ManageType.Task.ToString();

                        var result = _mainobj.Create(model);
                        status = true;
                    }
                }
            }
            return(new JsonResult
            {
                Data = new { status = status }
            });
        }
Пример #3
0
 public long Create(DbManagerEntity tentity)
 {
     using (var scope = new TransactionScope())
     {
         var NewRecord = new Ta_Manager
         {
             //mguid = tentity.mguid,
             mcontent = tentity.mcontent,
             mrowtype = tentity.mrowtype,
         };
         _unitOfWork.ManagerRepository.Insert(NewRecord);
         _unitOfWork.Save();
         scope.Complete();
         return(NewRecord.mid);
     }
 }
Пример #4
0
        public ActionResult Save(CommentEntity input)
        {
            bool status = false;

            if (ModelState.IsValid)
            {
                if (input.managerid > 0)
                {
                    var model     = _mainobj.GetById(input.managerid);
                    var oldsingle = new CommentEntity();
                    oldsingle = JsonConvert.DeserializeObject <CommentEntity>(model.mcontent);
                    oldsingle.commentdetail  = input.commentdetail;
                    oldsingle.LastUpdatedate = DateTime.Now;

                    string json = JsonConvert.SerializeObject(oldsingle);
                    model.mcontent = json;
                    var result = _mainobj.Update(input.managerid, model);
                    status = true;
                }
                else
                {
                    var taskid = Convert.ToInt32(Session["taskid"]);
                    if (taskid > 0)
                    {
                        input.taskid         = taskid;
                        input.createdate     = DateTime.Now;
                        input.createdBy      = 1; ///////////////////////// Temporary data
                        input.isPublished    = true;
                        input.LastUpdatedate = DateTime.Now;
                        input.publisheddate  = DateTime.Now;
                        var    model = new DbManagerEntity();
                        string json  = JsonConvert.SerializeObject(input);
                        model.mcontent = json;
                        model.mrowtype = StaticData.ManageType.Comment.ToString();

                        var result = _mainobj.Create(model); status = true;
                    }
                }
            }
            return(new JsonResult
            {
                Data = new { status = status }
            });
        }
Пример #5
0
        public ActionResult Save(ProjectEntity input)
        {
            bool status = false;

            if (ModelState.IsValid)
            {
                if (input.managerid > 0)
                {
                    var model = _mainobj.GetById(input.managerid);
                    //var oldsingle = Manager.GetProject(input.managerid);
                    var oldsingle = new ProjectEntity();
                    oldsingle                    = JsonConvert.DeserializeObject <ProjectEntity>(model.mcontent);
                    oldsingle.projectname        = input.projectname;
                    oldsingle.projectdescription = input.projectdescription;
                    oldsingle.LastUpdatedate     = DateTime.Now;

                    string json = JsonConvert.SerializeObject(oldsingle);
                    model.mcontent = json;
                    var result = _mainobj.Update(input.managerid, model);
                }
                else
                {
                    input.createdate     = DateTime.Now;
                    input.createdBy      = 1; ///////////////////////// Temporary data
                    input.isPublished    = true;
                    input.LastUpdatedate = DateTime.Now;
                    input.publisheddate  = DateTime.Now;
                    var    model = new DbManagerEntity();
                    string json  = JsonConvert.SerializeObject(input);
                    model.mcontent = json;
                    model.mrowtype = StaticData.ManageType.Project.ToString();

                    var result = _mainobj.Create(model);
                }
                status = true;
            }
            return(new JsonResult
            {
                Data = new { status = status }
            });
        }
Пример #6
0
        public bool Update(long tid, DbManagerEntity tentity)
        {
            var success = false;

            if (tentity != null && tid != 0)
            {
                using (var scope = new TransactionScope())
                {
                    var oldrecord = _unitOfWork.ManagerRepository.GetByID(tid);
                    if (oldrecord != null)
                    {
                        oldrecord.mcontent = tentity.mcontent;

                        _unitOfWork.ManagerRepository.Update(oldrecord);
                        _unitOfWork.Save();
                        scope.Complete();
                        success = true;
                    }
                }
            }
            return(success);
        }