public static int in_out_others(int userid, int typ, int per, string ds) { bus_eleave_ugc1 bus2 = new bus_eleave_ugc1(); bus2.userid = userid; bus2.ltype = typ; bus2.rdays = getc(per, ds); int res1 = bus2.check_in_out(); return(res1); }
public static int in_out_maternity(int userid, int typ, int per, string sd, string ed, int region) { double ct1 = 0.0; bus_eleave_ugc1 bus1 = new bus_eleave_ugc1(); if (region == 1) { List <DateTime> holday = new List <DateTime>(); DataTable dtio = fetchdatesmaternity(userid); for (int i = 0; i < dtio.Rows.Count; i++) { holday.Add(DateTime.Parse(dtio.Rows[i]["dates1"].ToString())); } DateTime sd1 = DateTime.Parse(sd); DateTime ed1 = DateTime.Parse(ed); while (sd1 <= ed1) { if (holday.Contains(sd1)) { sd1 = sd1.AddDays(1); } else { // get the count ct1 = ct1 + 1; sd1 = sd1.AddDays(1); } } } else if (region == 2) { List <DateTime> holday = new List <DateTime>(); DataTable dtio = fetchdatesmaternity_cochin(userid); for (int i = 0; i < dtio.Rows.Count; i++) { holday.Add(DateTime.Parse(dtio.Rows[i]["dates1"].ToString())); } DateTime sd1 = DateTime.Parse(sd); DateTime ed1 = DateTime.Parse(ed); while (sd1 <= ed1) { if (holday.Contains(sd1)) { sd1 = sd1.AddDays(1); } else { // get the count ct1 = ct1 + 1; sd1 = sd1.AddDays(1); } } } bus1.userid = userid; bus1.ltype = typ; if (per == 1) { bus1.rdays = ct1; } else { bus1.rdays = ct1 / 2; } int res = bus1.check_in_out(); return(res); }