Пример #1
0
        public ActionResult GateDetail(int projectId, int gateId, int gateLine)
        {
            //  string msg = "";

            MyLogger.GetInstance().Info("Getting Gate Details");

            SQLManager pm = new SQLManager();


            WrapperViewEditProject wp = pm.GetViewForUpdateGate(projectId, gateId, gateLine);

            if (wp == null)
            {
                msg = "Error getting gate information";

                MyLogger.GetInstance().Error(msg);

                return(RedirectToAction("ErrorView", "Project", new { message = msg }));
            }
            else
            {
                MyLogger.GetInstance().Info("gate info sucessfully retrieved");
            }


            return(View(wp));
        }
Пример #2
0
        public ActionResult SaveProjectInfo(WrapperViewEditProject we)
        {
            bool result = false;

            msg = "";

            MyLogger.GetInstance().Info("Udating Project Info");

            if (ModelState.IsValid)
            {
                SQLManager pm = new SQLManager();
                result = pm.SaveProjectInfo(we);

                if (result == false)
                {
                    msg = "Error updating project" + we.project.name;

                    MyLogger.GetInstance().Error(msg);
                    return(RedirectToAction("ErrorView", "Project", new { message = msg }));
                }
                else
                {
                    msg = "successfully updated project info " + we.project.name;
                    MyLogger.GetInstance().Info(msg);
                }
            }
            // var output = "yahoo";
            return(Json(msg, JsonRequestBehavior.AllowGet));
        }
Пример #3
0
        public ActionResult Editv02(int id)
        {
            //string msg = "";
            MyLogger.GetInstance().Info("Editing Project");

            SQLManager pm = new SQLManager();

            WrapperViewEditProject wp = pm.GetViewForUpdateProject(id);

            if (wp.project == null)
            {
                msg = "Error getting view for editing";

                MyLogger.GetInstance().Error(msg);

                return(RedirectToAction("ErrorView", "Project", new { message = msg }));
            }

            return(View(wp));
        }
Пример #4
0
        public ActionResult Edit(int id)
        {
            WrapperViewEditProject wp = new WrapperViewEditProject();

            using (DatabaseContext db = new DatabaseContext())
            {
                //  ArrayList dayslist = new ArrayList();
                List <GroupFunction> dayslist = new List <GroupFunction>();
                try
                {
                    List <DbViewClass> gridClassList = db.gridClasses.AsNoTracking().Where(n => n.id == id).OrderBy(n => n.ProjFuncId).
                                                       ToList();

                    int           tempFuncId    = 0;
                    string        str           = "";
                    string        flag          = "X";
                    int           printflag     = 0;
                    int           idfunc        = 0;
                    int           idrel         = 0;
                    int           idapp         = 0;
                    int           estimateRecId = 0;
                    string        namefunc      = "";
                    int           totalDays     = 0;
                    int           projfuncid    = 0;
                    GroupFunction gf            = null;
                    foreach (var aa in gridClassList)
                    {
                        if (aa.FuncId != tempFuncId)
                        {
                            if (printflag == 1)
                            {
                                gf            = new GroupFunction();
                                gf.appid      = idapp;
                                gf.releaseId  = idrel;
                                gf.FuncId     = idfunc;
                                gf.FuncName   = namefunc;
                                gf.daysString = str;
                                gf.totalDays  = totalDays;
                                gf.ProjFuncId = projfuncid;
                                dayslist.Add(gf);
                                totalDays = 0;
                                str       = "";
                            }
                            printflag = 1;
                        }
                        if (str.Length == 0)
                        {
                            str = aa.estId.ToString() + "," + aa.phaseCode.ToString() + "," + aa.roleId.ToString() + "," + aa.estDays.ToString() + "," + flag;
                        }
                        else
                        {
                            str = str + "-" + aa.estId.ToString() + "," + aa.phaseCode.ToString() + "," + aa.roleId.ToString() + "," + aa.estDays.ToString() + "," + flag;
                        }

                        idfunc        = aa.FuncId;
                        idrel         = aa.RelId;
                        idapp         = aa.AppId;
                        namefunc      = aa.FuncName;
                        estimateRecId = aa.estId;
                        projfuncid    = aa.ProjFuncId;

                        totalDays  = totalDays + aa.estDays;
                        tempFuncId = aa.FuncId;
                    }
                    gf            = new GroupFunction();
                    gf.appid      = idapp;
                    gf.releaseId  = idrel;
                    gf.FuncId     = idfunc;
                    gf.FuncName   = namefunc;
                    gf.daysString = str;
                    gf.totalDays  = totalDays;
                    gf.ProjFuncId = projfuncid;
                    dayslist.Add(gf);
                    //foreach (GroupFunction i in dayslist)
                    //{
                    //    System.Diagnostics.Debug.WriteLine(i.FuncId);
                    //    System.Diagnostics.Debug.WriteLine(i.FuncName);
                    //    System.Diagnostics.Debug.WriteLine(i.appid);
                    //    System.Diagnostics.Debug.WriteLine(i.RelId);
                    //    System.Diagnostics.Debug.WriteLine(i.daysString);

                    //}

                    //List<GroupFunction> result = gridClassList.GroupBy(x => new { x.FuncId, x.FuncName, x.AppId, x.RelId })
                    //    .Select(o => o.First()).ToList().Select(o => new GroupFunction
                    //    {
                    //        FuncId = o.FuncId, FuncName = o.FuncName, appid = o.AppId, RelId = o.RelId
                    //    }).ToList();



                    //foreach (GroupFunction item in result)
                    //{
                    //    System.Diagnostics.Debug.WriteLine(item.appid);
                    //}



                    List <Phase>         phaseList    = db.Phases.ToList();
                    List <Role>          roleList     = db.Roles.ToList();
                    List <Application>   appList      = db.Applications.ToList();
                    List <Release>       releaseList  = db.Releases.ToList();
                    List <Functionality> functionList = db.Functionalities.ToList();
                    List <ProjectStatus> statusList   = db.ProjectStatuses.ToList();
                    List <Gate>          gateList     = db.Gates.ToList();


                    //

                    wp.groupFunction        = dayslist;
                    wp.project.impactType   = gridClassList[0].impactType;
                    wp.project.statusId     = gridClassList[0].statusId;
                    wp.gateversion.gvGateId = gridClassList[0].gvGateId;
                    wp.gateversion.gvStatus = gridClassList[0].gvStatus;
                    // wp.FuncId = gridClassList[0].FuncId;

                    wp.dbview       = gridClassList;
                    wp.appList      = appList;
                    wp.relList      = releaseList;
                    wp.roleList     = roleList;
                    wp.phaselist    = phaseList;
                    wp.functionList = functionList;
                    wp.statusList   = statusList;
                    wp.gateList     = gateList;
                }
                catch (Exception ex)
                {
                    // string msg = "";
                    if (ex.InnerException is null)
                    {
                        msg = ex.Message;
                    }
                    else
                    {
                        msg = ex.InnerException.Message;
                    }
                    return(RedirectToAction("IndexError", "Project", new { msg = msg }));
                }
            }

            return(View(wp));
        }