static void Main(string[] args) { TotalInt total = delegate(int x) { int tt = 0; for (int i = 0; i < x; i++) { tt += i; } return(tt); }; Console.WriteLine(total(5)); HelloWorld hw = delegate(string s) { Console.WriteLine("Well well well " + s); }; hw(" Hello world anonymously "); hw = new HelloWorld(PrintSomething); //from pre c# 2.0 days hw(" from pre c# 2.0 days"); ///////////////////////////////////////////////////////////// StandardDelegate standard = Count; standard(); ////////////////////////////////// }
protected void Submit_Click(object sender, EventArgs e) { try { double Total, TotalInt; int n = 0; if (RdbCompoundQ.Checked == true) { n = 4; } else if (RdbCompoundM.Checked == true) { n = 12; } else if (RdbCompoundHY.Checked == true) { n = 2; } Total = RD.Calc_RD(Convert.ToDouble(TxtMonthAmt.Text), Convert.ToDouble(TxtROI.Text), n, Convert.ToDouble(TxtPeriodMonths.Text)); Total = Math.Round(Total, 2); TxtTotalMat.Text = Total.ToString(); TotalInt = RD.Calc_IntRD(Convert.ToDouble(TxtMonthAmt.Text), Total, Convert.ToDouble(TxtPeriodMonths.Text)); TotalInt = Math.Round(TotalInt, 2); TxtTotalIntAmt.Text = TotalInt.ToString(); FL = "Insert";//Dhanya Shetty string Res = CLM.LOGDETAILS(FL, Session["BRCD"].ToString(), Session["MID"].ToString(), "RDcalculator _" + Session["LOGINCODE"].ToString() + "", "00", Session["MID"].ToString()); } catch (Exception EX) { ExceptionLogging.SendErrorToText(EX); } }