TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ancy chacko
NA
71
18.4k
error in increasing value once every month
Mar 2 2015 3:03 AM
Hi
i want to increase the value once in every month.
there is no error ..but i didn't get correct result ..if i login the application it will increase and again login in same day it will again increasing
here is my code:
MySqlCommand Cm;
cn.Open();
MySqlDataAdapter da = new MySqlDataAdapter("select * from leavesummary1 where empcode ='" + Label13.Text + "' ", cn);
DataSet ds = new DataSet();
da.Fill(ds);
int iCurrentMonth = DateTime.Now.Month;
int iCurrentdate = DateTime.Now.Day;
foreach (DataRow dr in ds.Tables[0].Rows)
{
string str = dr["Privilege"].ToString();
Double t = Convert.ToDouble(str);
string str2 = dr["sick"].ToString();
double t1 = Convert.ToDouble(str2);
string str3 = dr["casual"].ToString();
double t2 = Convert.ToDouble(str3);
// Label3.Text = Convert.ToString(t);
if ((iCurrentdate == 1) || (iCurrentdate == 2))
// DateTimeOffset date2 = new DateTimeOffset(2015, 2, 3, 4, 40,45, TimeSpan.Zero);
//int months = date.Subtract(date1).Days / 30;
if ((iCurrentMonth == 3) || (iCurrentMonth == 9))
{
double Dates = Convert.ToDouble(2.5 + t);
Label3.Text = Convert.ToString(t + 2.5);
}
else if ((iCurrentMonth == 6) || (iCurrentMonth == 12))
{
// double Dates = Convert.ToDouble(2 + t);
Label3.Text = Convert.ToString(t + 2);
}
else
{
// double Dates = Convert.ToDouble(1.5+ t);
Label3.Text = Convert.ToString(t + 1.5);
}
Label1.Text = Convert.ToString(0.5 + t1);
Label2.Text = Convert.ToString(0.5 + t2);
}
else
{
Label3.Text = Convert.ToString(t);
Label1.Text = Convert.ToString(t1);
//double dayss = Convert.ToDouble(0.5 );
Label2.Text = Convert.ToString(t2);
}
}
Reply
Answers (
0
)
How to Copy the particular layout from pdf & past to other ?
How to use multiple script in one content page