public static void InitializeData() { using (var context = new MyDbContext()) { context.Database.EnsureDeleted(); context.Database.EnsureCreated(); var a = new AEntity { Name = "Root" }; for (var i = 0; i < 10; i++) { var b = new BEntity { Name = $"Item {i}" }; a.Bs.Add(b); for (var j = 0; j < 20; j++) { b.Cs.Add(new CEntity { Name = $"Item {i}.{j}" }); } } context.As.Add(a); context.SaveChanges(); } }
protected override void Because_of() { var be = new BEntity(); be.BP1 = 3; be.BP2.Add( new AEntity() { AP1 = 1, AP2 = "hello", B = be } ); be.BP2.Add( new AEntity() { AP1 = 2, AP2 = "two", B = be } ); var belist = new List <BEntity>(); belist.Add(be); _bei = belist.AsQueryable(); }
public void Should_not_throw_exception() { Mapper.CreateMap <BEntity, B>(); Mapper.CreateMap <AEntity, A>(); Mapper.AssertConfigurationIsValid(); var be = new BEntity { BP1 = 3 }; be.BP2.Add(new AEntity() { AP1 = 1, AP2 = "hello" }); be.BP2.Add(new AEntity() { AP1 = 2, AP2 = "two" }); var b = Mapper.Map <BEntity, B>(be); var belist = new List <BEntity> { be }; var bei = belist.AsQueryable(); typeof(Exception).ShouldNotBeThrownBy(() => bei.ProjectTo <B>()); }
public void Should_not_throw_exception() { var config = new MapperConfiguration(cfg => { cfg.CreateMap <BEntity, B>(); cfg.CreateMap <AEntity, A>(); }); //config.AssertConfigurationIsValid(); var be = new BEntity(); be.BP1 = 3; be.BP2.Add(new AEntity() { AP1 = 1, AP2 = "hello" }); be.BP2.Add(new AEntity() { AP1 = 2, AP2 = "two" }); var b = config.CreateMapper().Map <BEntity, B>(be); var belist = new List <BEntity>(); belist.Add(be); IQueryable <BEntity> bei = belist.AsQueryable(); typeof(Exception).ShouldNotBeThrownBy(() => bei.ProjectTo <B>(config)); }
public BEntity GetEntity(Vector2 pos, float range = 2000f) { BEntity result = null; float distance = range; for (int i = 0; i < entities.Count; i++) { float dis = Vector2.Distance(entities[i].position, pos); if (dis < distance) { distance = dis; result = entities[i]; } } return(result); }
public void Should_not_throw_exception() { Mapper.CreateMap<BEntity, B>(); Mapper.CreateMap<AEntity, A>(); Mapper.AssertConfigurationIsValid(); var be = new BEntity(); be.BP1 = 3; be.BP2.Add(new AEntity() { AP1 = 1, AP2 = "hello" }); be.BP2.Add(new AEntity() { AP1 = 2, AP2 = "two" }); var b = Mapper.Map<BEntity, B>(be); var belist = new List<BEntity>(); belist.Add(be); IQueryable<BEntity> bei = belist.AsQueryable(); typeof(Exception).ShouldNotBeThrownBy(() => bei.Project().To<B>()); }
private static bool MasterAction(BEntity op, ILocalBox box) { switch (op.ActionType) { case ActionType.Insert: return box.Insert(op.TableName, op.Value); case ActionType.Delete: return box.Delete(op.TableName, op.Key); case ActionType.Update: if (box.Update(op.TableName, op.Key, op.Value)) { return true; } else { return box.Insert(op.TableName, op.Value); } } throw new Exception(""); }
private static bool MasterAction(BEntity op, ILocalBox box) { switch (op.ActionType) { case ActionType.Insert: return(box.Insert(op.TableName, op.Value)); case ActionType.Delete: return(box.Delete(op.TableName, op.Key)); case ActionType.Update: if (box.Update(op.TableName, op.Key, op.Value)) { return(true); } else { return(box.Insert(op.TableName, op.Value)); } } throw new Exception(""); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { UserBL userBL = new UserBL(); int year = Utils.GetIntValue(Request["Year"]); string mode = Utils.GetStringValue(Request["Mode"]); UserEntity user = Session[Constants.USERSESSIONVAR] as UserEntity; BEntity bb = userBL.GetFormBData(year, user.UserId); if (bb != null) { LastYearSharesNo.Value = bb.LastYearSharesNo.ToString(); LastYearSharesValue.Value = bb.LastYearSharesValue.ToString(); LastyearSharesCostofacquisition.Value = bb.LastyearSharesCostofacquisition.ToString(); CurrentYearSharesNo.Value = bb.CurrentYearSharesNo.ToString(); CurrentYearSharesValue.Value = bb.CurrentYearSharesValue.ToString(); CurrentyearSharesCostofacquisition.Value = bb.CurrentyearSharesCostofacquisition.ToString(); ThisyearSharesCostofacquisition.Value = bb.ThisyearSharesCostofacquisition.ToString(); SharesFundingSource.Value = bb.SharesFundingSource.ToString(); LastYearDebenturesNo.Value = bb.LastYearDebenturesNo.ToString(); LastYearDebenturesValue.Value = bb.LastYearDebenturesValue.ToString(); LastyearDebenturesCostofacquisition.Value = bb.LastyearDebenturesCostofacquisition.ToString(); CurrentYearDebenturesNo.Value = bb.CurrentYearDebenturesNo.ToString(); CurrentYearDebenturesValue.Value = bb.CurrentYearDebenturesValue.ToString(); CurrentyearDebenturesCostofacquisition.Value = bb.CurrentyearDebenturesCostofacquisition.ToString(); ThisyearDebenturesCostofacquisition.Value = bb.ThisyearDebenturesCostofacquisition.ToString(); DebenturesFundingSource.Value = bb.DebenturesFundingSource.ToString(); LastYearUnitsNo.Value = bb.LastYearUnitsNo.ToString(); LastYearUnitsValue.Value = bb.LastYearUnitsValue.ToString(); LastyearUnitsCostofacquisition.Value = bb.LastyearUnitsCostofacquisition.ToString(); CurrentYearUnitsNo.Value = bb.CurrentYearUnitsNo.ToString(); CurrentYearUnitsValue.Value = bb.CurrentYearUnitsValue.ToString(); CurrentyearUnitsCostofacquisition.Value = bb.CurrentyearUnitsCostofacquisition.ToString(); ThisyearUnitsCostofacquisition.Value = bb.ThisyearUnitsCostofacquisition.ToString(); UnitsFundingSource.Value = bb.UnitsFundingSource.ToString(); LastYearNSCNo.Value = bb.LastYearNSCNo.ToString(); LastYearNSCValue.Value = bb.LastYearNSCValue.ToString(); LastyearNSCCostofacquisition.Value = bb.LastyearNSCCostofacquisition.ToString(); CurrentYearNSCNo.Value = bb.CurrentYearNSCNo.ToString(); CurrentYearNSCValue.Value = bb.CurrentYearNSCValue.ToString(); CurrentyearNSCCostofacquisition.Value = bb.CurrentyearNSCCostofacquisition.ToString(); ThisyearNSCCostofacquisition.Value = bb.ThisyearNSCCostofacquisition.ToString(); NSCFundingSource.Value = bb.NSCFundingSource.ToString(); LastYearNSSNo.Value = bb.LastYearNSSNo.ToString(); LastYearNSSValue.Value = bb.LastYearNSSValue.ToString(); LastyearNSSCostofacquisition.Value = bb.LastyearNSSCostofacquisition.ToString(); CurrentYearNSSNo.Value = bb.CurrentYearNSSNo.ToString(); CurrentYearNSSValue.Value = bb.CurrentYearNSSValue.ToString(); CurrentyearNSSCostofacquisition.Value = bb.CurrentyearNSSCostofacquisition.ToString(); ThisyearNSSCostofacquisition.Value = bb.ThisyearNSSCostofacquisition.ToString(); NSSFundingSource.Value = bb.NSSFundingSource.ToString(); LastYearBondsNo.Value = bb.LastYearBondsNo.ToString(); LastYearBondsValue.Value = bb.LastYearBondsValue.ToString(); LastyearBondsCostofacquisition.Value = bb.LastyearBondsCostofacquisition.ToString(); CurrentYearBondsNo.Value = bb.CurrentYearBondsNo.ToString(); CurrentYearBondsValue.Value = bb.CurrentYearBondsValue.ToString(); CurrentyearBondsCostofacquisition.Value = bb.CurrentyearBondsCostofacquisition.ToString(); ThisyearBondsCostofacquisition.Value = bb.ThisyearBondsCostofacquisition.ToString(); BondsFundingSource.Value = bb.BondsFundingSource.ToString(); LastYearDepositsNo.Value = bb.LastYearDepositsNo.ToString(); LastYearDepositsValue.Value = bb.LastYearDepositsValue.ToString(); LastYearDepositsCostofacquisition.Value = bb.LastyearDepositsCostofacquisition.ToString(); CurrentYearDepositsNo.Value = bb.CurrentYearDepositsNo.ToString(); CurrentYearDepositsValue.Value = bb.CurrentYearDepositsValue.ToString(); CurrentyearDepositsCostofacquisition.Value = bb.CurrentyearDepositsCostofacquisition.ToString(); ThisyearDepositsCostofacquisition.Value = bb.ThisyearDepositsCostofacquisition.ToString(); DepositsFundingSource.Value = bb.DepositsFundingSource.ToString(); LastYearOthersNo.Value = bb.LastYearOthersNo.ToString(); LastYearOthersValue.Value = bb.LastYearOthersValue.ToString(); LastyearOthersCostofacquisition.Value = bb.LastyearOthersCostofacquisition.ToString(); CurrentYearOthersNo.Value = bb.CurrentYearOthersNo.ToString(); CurrentYearOthersValue.Value = bb.CurrentYearOthersValue.ToString(); CurrentyearOthersCostofacquisition.Value = bb.CurrentyearOthersCostofacquisition.ToString(); ThisyearOthersCostofacquisition.Value = bb.ThisyearOthersCostofacquisition.ToString(); OthersFundingSource.Value = bb.OthersFundingSource.ToString(); } if (mode == Constants.VIEWMODE) { foreach (Control c in Page.Controls) { foreach (Control ctrl in c.Controls) { if (ctrl is TextBox) { (ctrl as TextBox).Enabled = false; } } } } } }
protected void btnSave_Click(object sender, EventArgs e) { BEntity bb = new BEntity(); bb.LastYearSharesNo = Utils.GetIntValue(LastYearSharesNo.Value); bb.LastYearSharesValue = Utils.GetDoubleValue(LastYearSharesValue.Value); bb.LastyearSharesCostofacquisition = Utils.GetDoubleValue(LastyearSharesCostofacquisition.Value); bb.CurrentYearSharesNo = Utils.GetIntValue(CurrentYearSharesNo.Value); bb.CurrentYearSharesValue = Utils.GetDoubleValue(CurrentYearSharesValue.Value); bb.CurrentyearSharesCostofacquisition = Utils.GetDoubleValue(CurrentyearSharesCostofacquisition.Value); bb.ThisyearSharesCostofacquisition = Utils.GetDoubleValue(ThisyearSharesCostofacquisition.Value); bb.SharesFundingSource = Utils.GetStringValue(SharesFundingSource.Value); bb.LastYearDebenturesNo = Utils.GetIntValue(LastYearDebenturesNo.Value); bb.LastYearDebenturesValue = Utils.GetDoubleValue(LastYearDebenturesValue.Value); bb.LastyearDebenturesCostofacquisition = Utils.GetDoubleValue(LastyearDebenturesCostofacquisition.Value); bb.CurrentYearDebenturesNo = Utils.GetIntValue(CurrentYearDebenturesNo.Value); bb.CurrentYearDebenturesValue = Utils.GetDoubleValue(CurrentYearDebenturesValue.Value); bb.CurrentyearDebenturesCostofacquisition = Utils.GetDoubleValue(CurrentyearDebenturesCostofacquisition.Value); bb.ThisyearDebenturesCostofacquisition = Utils.GetDoubleValue(ThisyearDebenturesCostofacquisition.Value); bb.DebenturesFundingSource = Utils.GetStringValue(DebenturesFundingSource.Value); bb.LastYearUnitsNo = Utils.GetIntValue(LastYearUnitsNo.Value); bb.LastYearUnitsValue = Utils.GetDoubleValue(LastYearUnitsValue.Value); bb.LastyearUnitsCostofacquisition = Utils.GetDoubleValue(LastyearUnitsCostofacquisition.Value); bb.CurrentYearUnitsNo = Utils.GetIntValue(CurrentYearUnitsNo.Value); bb.CurrentYearUnitsValue = Utils.GetDoubleValue(CurrentYearUnitsValue.Value); bb.CurrentyearUnitsCostofacquisition = Utils.GetDoubleValue(CurrentyearUnitsCostofacquisition.Value); bb.ThisyearUnitsCostofacquisition = Utils.GetDoubleValue(ThisyearUnitsCostofacquisition.Value); bb.UnitsFundingSource = Utils.GetStringValue(UnitsFundingSource.Value); bb.LastYearBondsNo = Utils.GetIntValue(LastYearBondsNo.Value); bb.LastYearBondsValue = Utils.GetDoubleValue(LastYearBondsValue.Value); bb.LastyearBondsCostofacquisition = Utils.GetDoubleValue(LastyearBondsCostofacquisition.Value); bb.CurrentYearBondsNo = Utils.GetIntValue(CurrentYearBondsNo.Value); bb.CurrentYearBondsValue = Utils.GetDoubleValue(CurrentYearBondsValue.Value); bb.CurrentyearBondsCostofacquisition = Utils.GetDoubleValue(CurrentyearBondsCostofacquisition.Value); bb.ThisyearBondsCostofacquisition = Utils.GetDoubleValue(ThisyearBondsCostofacquisition.Value); bb.BondsFundingSource = Utils.GetStringValue(BondsFundingSource.Value); bb.LastYearNSCNo = Utils.GetIntValue(LastYearNSCNo.Value); bb.LastYearNSCValue = Utils.GetDoubleValue(LastYearNSCValue.Value); bb.LastyearNSCCostofacquisition = Utils.GetDoubleValue(LastyearNSCCostofacquisition.Value); bb.CurrentYearNSCNo = Utils.GetIntValue(CurrentYearNSCNo.Value); bb.CurrentYearNSCValue = Utils.GetDoubleValue(CurrentYearNSCValue.Value); bb.CurrentyearNSCCostofacquisition = Utils.GetDoubleValue(CurrentyearNSCCostofacquisition.Value); bb.ThisyearNSCCostofacquisition = Utils.GetDoubleValue(ThisyearNSCCostofacquisition.Value); bb.NSCFundingSource = Utils.GetStringValue(NSCFundingSource.Value); bb.LastYearNSSNo = Utils.GetIntValue(LastYearNSSNo.Value); bb.LastYearNSSValue = Utils.GetDoubleValue(LastYearNSSValue.Value); bb.LastyearNSSCostofacquisition = Utils.GetDoubleValue(LastyearNSSCostofacquisition.Value); bb.CurrentYearNSSNo = Utils.GetIntValue(CurrentYearNSSNo.Value); bb.CurrentYearNSSValue = Utils.GetDoubleValue(CurrentYearNSSValue.Value); bb.CurrentyearNSSCostofacquisition = Utils.GetDoubleValue(CurrentyearNSSCostofacquisition.Value); bb.ThisyearNSSCostofacquisition = Utils.GetDoubleValue(ThisyearNSSCostofacquisition.Value); bb.NSSFundingSource = Utils.GetStringValue(NSSFundingSource.Value); bb.LastYearDepositsNo = Utils.GetIntValue(LastYearDepositsNo.Value); bb.LastYearDepositsValue = Utils.GetDoubleValue(LastYearDepositsValue.Value); bb.LastyearDepositsCostofacquisition = Utils.GetDoubleValue(LastYearDepositsCostofacquisition.Value); bb.CurrentYearDepositsNo = Utils.GetIntValue(CurrentYearDepositsNo.Value); bb.CurrentYearDepositsValue = Utils.GetDoubleValue(CurrentYearDepositsValue.Value); bb.CurrentyearDepositsCostofacquisition = Utils.GetDoubleValue(CurrentyearDepositsCostofacquisition.Value); bb.ThisyearDepositsCostofacquisition = Utils.GetDoubleValue(ThisyearDepositsCostofacquisition.Value); bb.DepositsFundingSource = Utils.GetStringValue(DepositsFundingSource.Value); bb.LastYearOthersNo = Utils.GetIntValue(LastYearOthersNo.Value); bb.LastYearOthersValue = Utils.GetDoubleValue(LastYearOthersValue.Value); bb.LastyearOthersCostofacquisition = Utils.GetDoubleValue(LastyearOthersCostofacquisition.Value); bb.CurrentYearOthersNo = Utils.GetIntValue(CurrentYearOthersNo.Value); bb.CurrentYearOthersValue = Utils.GetDoubleValue(CurrentYearOthersValue.Value); bb.CurrentyearOthersCostofacquisition = Utils.GetDoubleValue(CurrentyearOthersCostofacquisition.Value); bb.ThisyearOthersCostofacquisition = Utils.GetDoubleValue(ThisyearOthersCostofacquisition.Value); bb.OthersFundingSource = Utils.GetStringValue(OthersFundingSource.Value); UserBL userBL = new UserBL(); int year = Utils.GetIntValue(Request["Year"]); UserEntity user = Session[Constants.USERSESSIONVAR] as UserEntity; userBL.SaveFormB(bb, year, user.UserId); }
public BEntity GetFormBData(int year, int userId) { BEntity formB = null; DataSet dsFormB = new DataSet(); SpParamCollection spParams = new SpParamCollection(); sqlConn = new SqlConnection(m_connectionString); spParams.Add(new SpParam("@userId", userId)); spParams.Add(new SpParam("@Year", year)); DBHelper.ExecProcAndFillDataSet("GetFormBData", spParams, dsFormB, sqlConn); if (dsFormB != null && dsFormB.Tables.Count > 0) { try { DataTable dtFormA = dsFormB.Tables[0]; if (dtFormA != null && dtFormA.Rows.Count > 0) { DataRow drFormA = dtFormA.Rows[0]; formB = new BEntity(); formB.LastYearSharesNo = Utils.GetIntValue(drFormA["shares_lastyear_totalno"]); formB.LastYearSharesValue = Utils.GetDoubleValue(drFormA["shares_lastyear_facevalue"]); formB.LastyearSharesCostofacquisition = Utils.GetDoubleValue(drFormA["shares_lastyear_costofacquisition"]); formB.CurrentYearSharesNo = Utils.GetIntValue(drFormA["shares_currentyear_totalno"]); formB.CurrentYearSharesValue = Utils.GetDoubleValue(drFormA["shares_currentyear_facevalue"]); formB.CurrentyearSharesCostofacquisition = Utils.GetDoubleValue(drFormA["shares_currentyear_costofacquisition"]); formB.ThisyearSharesCostofacquisition = Utils.GetDoubleValue(drFormA["shares_costofacquisition_thisyear"]); formB.SharesFundingSource = Utils.GetStringValue(drFormA["SharesFundingSource"]); formB.LastYearDebenturesNo = Utils.GetIntValue(drFormA["Debentures_lastyear_totalno"]); formB.LastYearDebenturesValue = Utils.GetDoubleValue(drFormA["Debentures_lastyear_facevalue"]); formB.LastyearDebenturesCostofacquisition = Utils.GetDoubleValue(drFormA["Debentures_lastyear_costofacquisition"]); formB.CurrentYearDebenturesNo = Utils.GetIntValue(drFormA["Debentures_currentyear_totalno"]); formB.CurrentYearDebenturesValue = Utils.GetDoubleValue(drFormA["Debentures_currentyear_facevalue"]); formB.CurrentyearDebenturesCostofacquisition = Utils.GetDoubleValue(drFormA["Debentures_currentyear_costofacquisition"]); formB.ThisyearDebenturesCostofacquisition = Utils.GetDoubleValue(drFormA["Debentures_costofacquisition_thisyear"]); formB.DebenturesFundingSource = Utils.GetStringValue(drFormA["DebenturesFundingSource"]); formB.LastYearUnitsNo = Utils.GetIntValue(drFormA["Units_lastyear_totalno"]); formB.LastYearUnitsValue = Utils.GetDoubleValue(drFormA["Units_lastyear_facevalue"]); formB.LastyearUnitsCostofacquisition = Utils.GetDoubleValue(drFormA["Units_lastyear_costofacquisition"]); formB.CurrentYearUnitsNo = Utils.GetIntValue(drFormA["Units_currentyear_totalno"]); formB.CurrentYearUnitsValue = Utils.GetDoubleValue(drFormA["Units_currentyear_facevalue"]); formB.CurrentyearUnitsCostofacquisition = Utils.GetDoubleValue(drFormA["Units_currentyear_costofacquisition"]); formB.ThisyearUnitsCostofacquisition = Utils.GetDoubleValue(drFormA["Units_costofacquisition_thisyear"]); formB.UnitsFundingSource = Utils.GetStringValue(drFormA["UnitsFundingSource"]); formB.LastYearNSCNo = Utils.GetIntValue(drFormA["NSC_lastyear_totalno"]); formB.LastYearNSCValue = Utils.GetDoubleValue(drFormA["NSC_lastyear_facevalue"]); formB.LastyearNSCCostofacquisition = Utils.GetDoubleValue(drFormA["NSC_lastyear_costofacquisition"]); formB.CurrentYearNSCNo = Utils.GetIntValue(drFormA["NSC_currentyear_totalno"]); formB.CurrentYearNSCValue = Utils.GetDoubleValue(drFormA["NSC_currentyear_facevalue"]); formB.CurrentyearNSCCostofacquisition = Utils.GetDoubleValue(drFormA["NSC_currentyear_costofacquisition"]); formB.ThisyearNSCCostofacquisition = Utils.GetDoubleValue(drFormA["NSC_costofacquisition_thisyear"]); formB.NSCFundingSource = Utils.GetStringValue(drFormA["NSCFundingSource"]); formB.LastYearNSSNo = Utils.GetIntValue(drFormA["NSS_lastyear_totalno"]); formB.LastYearNSSValue = Utils.GetDoubleValue(drFormA["NSS_lastyear_facevalue"]); formB.LastyearNSSCostofacquisition = Utils.GetDoubleValue(drFormA["NSS_lastyear_costofacquisition"]); formB.CurrentYearNSSNo = Utils.GetIntValue(drFormA["NSS_currentyear_totalno"]); formB.CurrentYearNSSValue = Utils.GetDoubleValue(drFormA["NSS_currentyear_facevalue"]); formB.CurrentyearNSSCostofacquisition = Utils.GetDoubleValue(drFormA["NSS_currentyear_costofacquisition"]); formB.ThisyearNSSCostofacquisition = Utils.GetDoubleValue(drFormA["NSS_costofacquisition_thisyear"]); formB.NSSFundingSource = Utils.GetStringValue(drFormA["NSSFundingSource"]); formB.LastYearBondsNo = Utils.GetIntValue(drFormA["Bonds_lastyear_totalno"]); formB.LastYearBondsValue = Utils.GetDoubleValue(drFormA["Bonds_lastyear_facevalue"]); formB.LastyearBondsCostofacquisition = Utils.GetDoubleValue(drFormA["Bonds_lastyear_costofacquisition"]); formB.CurrentYearBondsNo = Utils.GetIntValue(drFormA["Bonds_currentyear_totalno"]); formB.CurrentYearBondsValue = Utils.GetDoubleValue(drFormA["Bonds_currentyear_facevalue"]); formB.CurrentyearBondsCostofacquisition = Utils.GetDoubleValue(drFormA["Bonds_currentyear_costofacquisition"]); formB.ThisyearBondsCostofacquisition = Utils.GetDoubleValue(drFormA["Bonds_costofacquisition_thisyear"]); formB.BondsFundingSource = Utils.GetStringValue(drFormA["BondsFundingSource"]); formB.LastYearDepositsNo = Utils.GetIntValue(drFormA["Deposits_lastyear_totalno"]); formB.LastYearDepositsValue = Utils.GetDoubleValue(drFormA["Deposits_lastyear_facevalue"]); formB.LastyearDepositsCostofacquisition = Utils.GetDoubleValue(drFormA["Deposits_lastyear_costofacquisition"]); formB.CurrentYearDepositsNo = Utils.GetIntValue(drFormA["Deposits_currentyear_totalno"]); formB.CurrentYearDepositsValue = Utils.GetDoubleValue(drFormA["Deposits_currentyear_facevalue"]); formB.CurrentyearDepositsCostofacquisition = Utils.GetDoubleValue(drFormA["Deposits_currentyear_costofacquisition"]); formB.ThisyearDepositsCostofacquisition = Utils.GetDoubleValue(drFormA["Deposits_costofacquisition_thisyear"]); formB.DepositsFundingSource = Utils.GetStringValue(drFormA["DepositsFundingSource"]); formB.LastYearOthersNo = Utils.GetIntValue(drFormA["Others_lastyear_totalno"]); formB.LastYearOthersValue = Utils.GetDoubleValue(drFormA["Others_lastyear_facevalue"]); formB.LastyearOthersCostofacquisition = Utils.GetDoubleValue(drFormA["Others_lastyear_costofacquisition"]); formB.CurrentYearOthersNo = Utils.GetIntValue(drFormA["Others_currentyear_totalno"]); formB.CurrentYearOthersValue = Utils.GetDoubleValue(drFormA["Others_currentyear_facevalue"]); formB.CurrentyearOthersCostofacquisition = Utils.GetDoubleValue(drFormA["Others_currentyear_costofacquisition"]); formB.ThisyearOthersCostofacquisition = Utils.GetDoubleValue(drFormA["Others_costofacquisition_thisyear"]); formB.OthersFundingSource = Utils.GetStringValue(drFormA["OthersFundingSource"]); } } catch (Exception ex) { throw ex; } } return(formB); }
public void SaveFormB(BEntity bb, int year, int userId) { DataSet dsUsers = new DataSet(); SpParamCollection spParams = new SpParamCollection(); sqlConn = new SqlConnection(m_connectionString); spParams.Add(new SpParam("@userID", userId)); spParams.Add(new SpParam("@shares_lastyear_totalno", bb.LastYearSharesNo)); spParams.Add(new SpParam("@shares_lastyear_facevalue", bb.LastYearSharesValue)); spParams.Add(new SpParam("@shares_lastyear_costofacquisition ", bb.LastyearSharesCostofacquisition)); spParams.Add(new SpParam("@shares_currentyear_totalno", bb.CurrentYearSharesNo)); spParams.Add(new SpParam("@shares_currentyear_facevalue ", bb.CurrentYearSharesValue)); spParams.Add(new SpParam("@shares_currentyear_costofacquisition ", bb.CurrentyearSharesCostofacquisition)); spParams.Add(new SpParam("@shares_costofacquisition_thisyear ", bb.ThisyearSharesCostofacquisition)); spParams.Add(new SpParam("@shares_sourceof_funding", bb.SharesFundingSource)); spParams.Add(new SpParam("@debenture_lastyear_totalno", bb.LastYearDebenturesNo)); spParams.Add(new SpParam("@debenture_lastyear_facevalue", bb.LastYearDebenturesValue)); spParams.Add(new SpParam("@debenture_lastyear_costofacquisition", bb.LastyearDebenturesCostofacquisition)); spParams.Add(new SpParam("@debenture_currentyear_totalno", bb.CurrentYearDebenturesNo)); spParams.Add(new SpParam("@debenture_currentyear_facevalue", bb.CurrentYearDebenturesValue)); spParams.Add(new SpParam("@debenture_currentyear_costofacquisition", bb.CurrentyearDebenturesCostofacquisition)); spParams.Add(new SpParam("@debenture_costofacquisition_thisyear", bb.ThisyearDebenturesCostofacquisition)); spParams.Add(new SpParam("@debenture_sourceof_funding", bb.DebenturesFundingSource)); spParams.Add(new SpParam("@units_lastyear_totalno", bb.LastYearUnitsNo)); spParams.Add(new SpParam("@units_lastyear_facevalue ", bb.LastYearUnitsValue)); spParams.Add(new SpParam("@units_lastyear_costofacquisition ", bb.LastyearUnitsCostofacquisition)); spParams.Add(new SpParam("@units_currentyear_totalno", bb.CurrentYearUnitsNo)); spParams.Add(new SpParam("@units_currentyear_facevalue ", bb.CurrentYearUnitsValue)); spParams.Add(new SpParam("@units_currentyear_costofacquisition ", bb.CurrentyearUnitsCostofacquisition)); spParams.Add(new SpParam("@units_costofacquisition_thisyear ", bb.ThisyearUnitsCostofacquisition)); spParams.Add(new SpParam("@units_sourceof_funding", bb.UnitsFundingSource)); spParams.Add(new SpParam("@nscs_lastyear_totalno", bb.LastYearNSCNo)); spParams.Add(new SpParam("@nscs_lastyear_facevalue ", bb.LastYearNSCValue)); spParams.Add(new SpParam("@nscs_lastyear_costofacquisition ", bb.LastyearNSCCostofacquisition)); spParams.Add(new SpParam("@nscs_currentyear_totalno", bb.CurrentYearNSCNo)); spParams.Add(new SpParam("@nscs_currentyear_facevalue ", bb.CurrentYearNSCValue)); spParams.Add(new SpParam("@nscs_currentyear_costofacquisition ", bb.CurrentyearNSCCostofacquisition)); spParams.Add(new SpParam("@nscs_costofacquisition_thisyear ", bb.ThisyearNSCCostofacquisition)); spParams.Add(new SpParam("@nscs_sourceof_funding", bb.NSCFundingSource)); spParams.Add(new SpParam("@nss_lastyear_totalno", bb.LastYearNSSNo)); spParams.Add(new SpParam("@nss_lastyear_facevalue ", bb.LastYearNSSValue)); spParams.Add(new SpParam("@nss_lastyear_costofacquisition ", bb.LastyearNSSCostofacquisition)); spParams.Add(new SpParam("@nss_current_totalno", bb.CurrentYearNSSNo)); spParams.Add(new SpParam("@nss_current_facevalue ", bb.CurrentYearNSSValue)); spParams.Add(new SpParam("@nss_current_Costofacquisition ", bb.CurrentyearNSSCostofacquisition)); spParams.Add(new SpParam("@nss_Costofacquisition_thisyear ", bb.ThisyearNSSCostofacquisition)); spParams.Add(new SpParam("@nss_sourceof_funding ", bb.NSSFundingSource)); spParams.Add(new SpParam("@allbank_lastyear_totalno", bb.LastYearDepositsNo)); spParams.Add(new SpParam("@allbank_lastyear_facevalue ", bb.LastYearDepositsValue)); spParams.Add(new SpParam("@allbank_lastyear_costofacquisition ", bb.LastyearDepositsCostofacquisition)); spParams.Add(new SpParam("@allbank_currentyear_totalno", bb.CurrentYearDepositsNo)); spParams.Add(new SpParam("@allbank_currentyear_facevalue ", bb.CurrentYearDepositsValue)); spParams.Add(new SpParam("@allbank_currentyear_costofacquisition ", bb.CurrentyearDepositsCostofacquisition)); spParams.Add(new SpParam("@allbank_costofacquisition_thisyear ", bb.ThisyearDepositsCostofacquisition)); spParams.Add(new SpParam("@allbank_sourceof_funding", bb.DepositsFundingSource)); spParams.Add(new SpParam("@othersecurity_lastyear_totalno", bb.LastYearBondsNo)); spParams.Add(new SpParam("@othersecurity_lastyear_facevalue ", bb.LastYearBondsValue)); spParams.Add(new SpParam("@othersecurity_lastyear_costofacquisition ", bb.LastyearBondsCostofacquisition)); spParams.Add(new SpParam("@othersecurity_currentyear_totalno", bb.CurrentYearBondsNo)); spParams.Add(new SpParam("@othersecurity_currentyear_facevalue ", bb.CurrentYearBondsValue)); spParams.Add(new SpParam("@othersecurity_currentyear_costofacquisition ", bb.CurrentyearBondsCostofacquisition)); spParams.Add(new SpParam("@othersecurity_costofacquisition_thisyear ", bb.ThisyearBondsCostofacquisition)); spParams.Add(new SpParam("@othersecurity_sourceof_funding", bb.BondsFundingSource)); spParams.Add(new SpParam("@allother_lastyear_totalno", bb.LastYearBondsNo)); spParams.Add(new SpParam("@allother_lastyear_facevalue ", bb.LastYearBondsValue)); spParams.Add(new SpParam("@allother_lastyear_costofacquisition ", bb.LastyearBondsCostofacquisition)); spParams.Add(new SpParam("@allother_currentyear_totalno", bb.CurrentYearBondsNo)); spParams.Add(new SpParam("@allother_currentyear_facevalue", bb.CurrentYearBondsValue)); spParams.Add(new SpParam("@allother_currentyear_costofacquisition", bb.CurrentyearBondsCostofacquisition)); spParams.Add(new SpParam("@allother_costofacquisition_thisyear ", bb.ThisyearBondsCostofacquisition)); spParams.Add(new SpParam("@allother_sourceof_funding", bb.OthersFundingSource)); spParams.Add(new SpParam("@year", year)); DBHelper.ExecProcNonQuery("SaveFormB", spParams, sqlConn); }
public void DisposeEntity(BEntity entity) { entities.Remove(entity); }
public void CreateEntity(BEntity entity) { entities.Add(entity); entities = entities.OrderBy(e => e.position.Y).ToList <BEntity>(); }
public void SaveFormB(BEntity bb, int year, int userId) { DBProvider prov = new DBProvider(); prov.SaveFormB(bb, year, userId); }