Example #1
0
        public ActionResult DisplayAmDetails()
        {
            QuaterGenerator.UpdateActiveQuaters();
            var AmDetailsModel = financetoolentities.Usp_GetAdminMainDetails_V2().Where(i => i.IsUpdated == false).ToList();
            List <AdminMainDetailsResult> _AdminMainResult = new List <AdminMainDetailsResult>();
            int Iteration = 0;

            foreach (var AmResult in AmDetailsModel)
            {
                AdminMainDetailsResult obj = new AdminMainDetailsResult();
                obj.acv    = AmResult.acv;
                obj.AMID   = Convert.ToInt16(AmResult.AMID);
                obj.AMName = AmResult.AMName;

                obj.BillingStratDate   = AmResult.BillingStratDate;
                obj.CustomerID         = AmResult.CustomerID;
                obj.Customername       = AmResult.Customername;
                obj.DBBLDU             = AmResult.DBBLDU;
                obj.DBBLDUID           = Convert.ToInt16(AmResult.DBBLDUID);
                obj.DealStagestatus    = AmResult.DealStagestatus;
                obj.DUID               = AmResult.DUID;
                obj.DUName             = AmResult.DUName;
                obj.IsActive           = AmResult.IsActive;
                obj.LOBID              = Convert.ToInt16(AmResult.LOBID);
                obj.LOBName            = AmResult.LOBName;
                obj.note               = AmResult.note;
                obj.OpportunityID      = Convert.ToInt16(AmResult.OpportunityID);
                obj.OpportunityKeyID   = Convert.ToInt16(AmResult.OpportunityKeyID);
                obj.OpportunityLobId   = AmResult.OpportunityLobId;
                obj.OpportunityLobName = AmResult.OpportunityLobName;
                obj.OpportunityName    = AmResult.OpportunityName;
                obj.ProductGroup       = AmResult.ProductGroup;
                obj.ProductGroupID     = AmResult.ProductGroupID;
                obj.ProgramName        = AmResult.ProgramName;
                obj.ProjectID          = Convert.ToInt16(AmResult.ProjectID);
                obj.SDUID              = AmResult.SDUID;
                obj.ServiceLine        = AmResult.ServiceLine;
                obj.ServiceLineID      = AmResult.ServiceLineID;
                obj.SowStatusValue     = AmResult.SowStatusValue;
                obj.sowvalue           = AmResult.SOWStatus;
                obj.S_No               = AmResult.S_No;
                obj.TCV       = AmResult.TCV;
                obj.IsUpdated = Convert.ToBoolean(AmResult.IsUpdated);
                List <string> Objquater  = new List <string>();
                List <string> QuaterName = new List <string>();

                var dbQuaterlist = financetoolentities.Quaters.Where(i => i.IsActive == true).ToList();

                foreach (var quater in dbQuaterlist)
                {
                    var value        = AmResult.GetType().GetProperty(quater.QuaterName);
                    var Quartervalue = value.GetValue(AmResult, null).ToString();
                    var qvalue       = MyCustomFormat(Convert.ToDouble(Quartervalue));
                    Objquater.Add(qvalue);
                    QuaterName.Add(quater.QuaterName + "_FC($K)");
                }

                if (Iteration == 0)
                {
                    obj.QuaterName = QuaterName;
                }
                obj.Quaterlist = Objquater;
                _AdminMainResult.Add(obj);
                Iteration++;
            }
            return(View(_AdminMainResult));
        }