public List <DUHMainDetailsResult> NewDetails(FormCollection _formcollectionobj) { string SDUID = "ALL"; string DUID = "ALL"; if (_formcollectionobj["DUHModel.SDUID"] == "0") { SDUID = "ALL"; } else { SDUID = _formcollectionobj["DUHModel.SDUID"]; } if (_formcollectionobj["DUHModel.DUID"] == "0") { DUID = "ALL"; } else { DUID = _formcollectionobj["DUHModel.DUID"]; } QuaterGenerator.UpdateActiveQuaters(); List <Usp_GetDUHDetails_Comparision_V2_Result> DUHGriddetails = new List <Usp_GetDUHDetails_Comparision_V2_Result>(); if (_formcollectionobj["DUHModel.ProjectID"] == "0") { DUHGriddetails = financetoolentities.Usp_GetDUHDetails_Comparision_V2(SDUID, DUID).Where(i => i.IsUpdated == false).ToList(); } else { DUHGriddetails = financetoolentities.Usp_GetDUHDetails_Comparision_V2(SDUID, DUID).Where(i => i.IsUpdated == false && i.ProjectID == Convert.ToInt32(_formcollectionobj["DUHModel.ProjectID"])).ToList(); } // var DUHGriddetails = financetoolentities.Usp_GetDUHDetails_Comparision_V2(SDUID, DUID).Where(i => i.IsUpdated == false).ToList(); // var DUHGriddetails = financetoolentities.Usp_GetDUHMainDetails().ToList(); int Iteration = 0; List <DUHMainDetailsResult> DUHMainDetailsResultList = new List <DUHMainDetailsResult>(); foreach (var DUHdbvalues in DUHGriddetails) { DUHMainDetailsResult duhmaindetail = new DUHMainDetailsResult(); duhmaindetail.AMID = DUHdbvalues.AMID; duhmaindetail.AMName = DUHdbvalues.AMName; duhmaindetail.CustomerID = DUHdbvalues.CustomerID; duhmaindetail.Customername = DUHdbvalues.Customername; duhmaindetail.DBBLDU = DUHdbvalues.DBBLDU; duhmaindetail.DBBLDUID = DUHdbvalues.DBBLDUID; duhmaindetail.DealStageID = DUHdbvalues.DealStageID; duhmaindetail.DUID = DUHdbvalues.DUID; duhmaindetail.DUName = DUHdbvalues.DUName; duhmaindetail.LOBID = DUHdbvalues.LOBID; duhmaindetail.LOBName = DUHdbvalues.LOBName; duhmaindetail.Note = DUHdbvalues.Note; duhmaindetail.OpportunityID = DUHdbvalues.OpportunityID; duhmaindetail.OpportunityKeyID = DUHdbvalues.OpportunityKeyID; duhmaindetail.OpportunityLobId = DUHdbvalues.OpportunityLobId; duhmaindetail.OpportunityLobName = DUHdbvalues.OpportunityLobName; duhmaindetail.OpportunityName = DUHdbvalues.OpportunityName; duhmaindetail.poavilable = DUHdbvalues.poavilable; duhmaindetail.pobalance = DUHdbvalues.pobalance; duhmaindetail.ProductGroup = DUHdbvalues.ProductGroup; duhmaindetail.ProductGroupID = DUHdbvalues.ProductGroupID; duhmaindetail.ProgramName = DUHdbvalues.ProgramName; duhmaindetail.ProjectID = DUHdbvalues.ProjectID; duhmaindetail.ProjectName = DUHdbvalues.ProjectName; duhmaindetail.SDUID = DUHdbvalues.SDUID; duhmaindetail.ServiceLine = DUHdbvalues.ServiceLine; duhmaindetail.ServiceLineID = DUHdbvalues.ServiceLineID; duhmaindetail.SowStatus = DUHdbvalues.SOWStatus1; duhmaindetail.S_No = DUHdbvalues.S_No; List <string> Objquater = new List <string>(); List <string> QuaterName = new List <string>(); List <string> Operations = new List <string>(); Operations.Add("_FC"); var dbQuaterlist = financetoolentities.Quaters.Where(i => i.IsActive == true).ToList(); var dbQuater_Actuallist = financetoolentities.quater_Actual.Where(i => i.IsActive == true).ToList(); foreach (var quater in dbQuaterlist) { foreach (var Obj in Operations) { var value = DUHdbvalues.GetType().GetProperty(quater.QuaterName + Obj); var Quartervalue = value.GetValue(DUHdbvalues, null).ToString(); var qvalue = MyCustomFormat(Convert.ToDouble(Quartervalue)); Objquater.Add(qvalue); } QuaterName.Add(quater.QuaterName + "_FC($K)"); // QuaterName.Add(quater.QuaterName + "_ACT($K)"); } Operations.Clear(); Operations.Add("_ACT"); foreach (var quater in dbQuater_Actuallist) { foreach (var Obj in Operations) { var value = DUHdbvalues.GetType().GetProperty(quater.QuaterName + Obj); var Quartervalue = value.GetValue(DUHdbvalues, null).ToString(); var qvalue = MyCustomFormat(Convert.ToDouble(Quartervalue)); Objquater.Add(qvalue); } //QuaterName.Add(quater.QuaterName + "_FC($K)"); QuaterName.Add(quater.QuaterName + "_ACT($K)"); } if (Iteration == 0) { duhmaindetail.QuaterName = QuaterName; } duhmaindetail.Quaterlist = Objquater; DUHMainDetailsResultList.Add(duhmaindetail); Iteration++; } return(DUHMainDetailsResultList); }
public List <DUHMainDetailsResult> Get_SDU_DU_ALL_OldData() { QuaterGenerator.UpdateActiveQuaters(); var DUHGriddetails = financetoolentities.Usp_GetDUHDetails_Comparision_OldDetails("ALL", "ALL", DateTime.Now).ToList(); // var DUHGriddetails = financetoolentities.Usp_GetDUHMainDetails().ToList(); int Iteration = 0; CompareDUHModel objcompareDUHModel = new CompareDUHModel(); List <DUHMainDetailsResult> DUHMainDetailsResultList = new List <DUHMainDetailsResult>(); foreach (var DUHdbvalues in DUHGriddetails) { DUHMainDetailsResult duhmaindetail = new DUHMainDetailsResult(); duhmaindetail.AMID = DUHdbvalues.AMID; duhmaindetail.AMName = DUHdbvalues.AMName; duhmaindetail.CustomerID = DUHdbvalues.CustomerID; duhmaindetail.Customername = DUHdbvalues.Customername; duhmaindetail.DBBLDU = DUHdbvalues.DBBLDU; duhmaindetail.DBBLDUID = DUHdbvalues.DBBLDUID; duhmaindetail.DealStageID = DUHdbvalues.DealStageID; duhmaindetail.DUID = DUHdbvalues.DUID; duhmaindetail.DUName = DUHdbvalues.DUName; duhmaindetail.LOBID = DUHdbvalues.LOBID; duhmaindetail.LOBName = DUHdbvalues.LOBName; duhmaindetail.Note = DUHdbvalues.Note; duhmaindetail.OpportunityID = DUHdbvalues.OpportunityID; duhmaindetail.OpportunityKeyID = DUHdbvalues.OpportunityKeyID; duhmaindetail.OpportunityLobId = DUHdbvalues.OpportunityLobId; duhmaindetail.OpportunityLobName = DUHdbvalues.OpportunityLobName; duhmaindetail.OpportunityName = DUHdbvalues.OpportunityName; duhmaindetail.poavilable = DUHdbvalues.poavilable; duhmaindetail.pobalance = DUHdbvalues.pobalance; duhmaindetail.ProductGroup = DUHdbvalues.ProductGroup; duhmaindetail.ProductGroupID = DUHdbvalues.ProductGroupID; duhmaindetail.ProgramName = DUHdbvalues.ProgramName; duhmaindetail.ProjectID = DUHdbvalues.ProjectID; duhmaindetail.ProjectName = DUHdbvalues.ProjectName; duhmaindetail.SDUID = DUHdbvalues.SDUID; duhmaindetail.ServiceLine = DUHdbvalues.ServiceLine; duhmaindetail.ServiceLineID = DUHdbvalues.ServiceLineID; //duhmaindetail.SowStatus = DUHdbvalues.SOWStatus1; //duhmaindetail.S_No = DUHdbvalues.S_No; List <string> Objquater = new List <string>(); List <string> QuaterName = new List <string>(); List <string> Operations = new List <string>(); Operations.Add("_FC"); var dbQuaterlist = financetoolentities.Quaters.Where(i => i.IsActive == true).ToList(); var dbQuater_Actuallist = financetoolentities.quater_Actual.Where(i => i.IsActive == true).ToList(); foreach (var quater in dbQuaterlist) { foreach (var Obj in Operations) { var value = DUHdbvalues.GetType().GetProperty(quater.QuaterName + Obj); var Quartervalue = value.GetValue(DUHdbvalues, null).ToString(); var qvalue = MyCustomFormat(Convert.ToDouble(Quartervalue)); Objquater.Add(qvalue); } QuaterName.Add(quater.QuaterName + "_FC($K)"); // QuaterName.Add(quater.QuaterName + "_ACT($K)"); } Operations.Clear(); Operations.Add("_ACT"); foreach (var quater in dbQuater_Actuallist) { foreach (var Obj in Operations) { var value = DUHdbvalues.GetType().GetProperty(quater.QuaterName + Obj); var Quartervalue = value.GetValue(DUHdbvalues, null).ToString(); var qvalue = MyCustomFormat(Convert.ToDouble(Quartervalue)); Objquater.Add(qvalue); } //QuaterName.Add(quater.QuaterName + "_FC($K)"); QuaterName.Add(quater.QuaterName + "_ACT($K)"); } if (Iteration == 0) { duhmaindetail.QuaterName = QuaterName; } duhmaindetail.Quaterlist = Objquater; DUHMainDetailsResultList.Add(duhmaindetail); Iteration++; } return(DUHMainDetailsResultList); }
public ActionResult Index() { QuaterGenerator.UpdateActiveQuaters(); var DUHGriddetails = financetoolentities.Usp_GetDUHMainDetailsByUserID_V2(Session["UserId"].ToString()).Where(i => i.IsUpdated == false).ToList(); // var DUHGriddetails = financetoolentities.Usp_GetDUHMainDetails().ToList(); int Iteration = 0; List <DUHMainDetailsResult> DUHMainDetailsResultList = new List <DUHMainDetailsResult>(); foreach (var DUHdbvalues in DUHGriddetails) { DUHMainDetailsResult duhmaindetail = new DUHMainDetailsResult(); duhmaindetail.AMID = DUHdbvalues.AMID; duhmaindetail.AMName = DUHdbvalues.AMName; duhmaindetail.CustomerID = DUHdbvalues.CustomerID; duhmaindetail.Customername = DUHdbvalues.Customername; duhmaindetail.DBBLDU = DUHdbvalues.DBBLDU; duhmaindetail.DBBLDUID = DUHdbvalues.DBBLDUID; duhmaindetail.DealStageID = DUHdbvalues.DealStageID; duhmaindetail.DUID = DUHdbvalues.DUID; duhmaindetail.DUName = DUHdbvalues.DUName; duhmaindetail.LOBID = DUHdbvalues.LOBID; duhmaindetail.LOBName = DUHdbvalues.LOBName; duhmaindetail.Note = DUHdbvalues.Note; duhmaindetail.OpportunityID = DUHdbvalues.OpportunityID; duhmaindetail.OpportunityKeyID = DUHdbvalues.OpportunityKeyID; duhmaindetail.OpportunityLobId = DUHdbvalues.OpportunityLobId; duhmaindetail.OpportunityLobName = DUHdbvalues.OpportunityLobName; duhmaindetail.OpportunityName = DUHdbvalues.OpportunityName; duhmaindetail.pobalance = DUHdbvalues.pobalance; duhmaindetail.ProductGroup = DUHdbvalues.ProductGroup; duhmaindetail.ProductGroupID = DUHdbvalues.ProductGroupID; duhmaindetail.ProgramName = DUHdbvalues.ProgramName; duhmaindetail.ProjectID = DUHdbvalues.ProjectID; duhmaindetail.ProjectName = DUHdbvalues.ProjectName; duhmaindetail.SDUID = DUHdbvalues.SDUID; duhmaindetail.ServiceLine = DUHdbvalues.ServiceLine; duhmaindetail.ServiceLineID = DUHdbvalues.ServiceLineID; duhmaindetail.SowStatus = DUHdbvalues.SOWStatus1; duhmaindetail.S_No = DUHdbvalues.S_No; if (DUHdbvalues.poavilable == "1") { duhmaindetail.poavilable = "Yes"; } else if (DUHdbvalues.poavilable == "0") { duhmaindetail.poavilable = "No"; } List <string> Objquater = new List <string>(); List <string> QuaterName = new List <string>(); List <string> Operations = new List <string>(); Operations.Add("_FC"); var dbQuaterlist = financetoolentities.Quaters.Where(i => i.IsActive == true).ToList(); var dbQuater_Actuallist = financetoolentities.quater_Actual.Where(i => i.IsActive == true).ToList(); foreach (var quater in dbQuaterlist) { foreach (var Obj in Operations) { var value = DUHdbvalues.GetType().GetProperty(quater.QuaterName + Obj); var Quartervalue = value.GetValue(DUHdbvalues, null).ToString(); var qvalue = MyCustomFormat(Convert.ToDouble(Quartervalue)); Objquater.Add(qvalue); } QuaterName.Add(quater.QuaterName + "_FC($K)"); // QuaterName.Add(quater.QuaterName + "_ACT($K)"); } Operations.Clear(); Operations.Add("_ACT"); foreach (var quater in dbQuater_Actuallist) { foreach (var Obj in Operations) { var value = DUHdbvalues.GetType().GetProperty(quater.QuaterName + Obj); var Quartervalue = value.GetValue(DUHdbvalues, null).ToString(); var qvalue = MyCustomFormat(Convert.ToDouble(Quartervalue)); Objquater.Add(qvalue); } //QuaterName.Add(quater.QuaterName + "_FC($K)"); QuaterName.Add(quater.QuaterName + "_ACT($K)"); } if (Iteration == 0) { duhmaindetail.QuaterName = QuaterName; } duhmaindetail.Quaterlist = Objquater; DUHMainDetailsResultList.Add(duhmaindetail); Iteration++; } return(View(DUHMainDetailsResultList)); }