public void UpdateMUF(string muid, string action) { try { BaseBll bll = new BaseBll(); if (action == "add") { tstmnumuf muf = new tstmnumuf(); muf.apnm = Parameter.APPLICATION_NAME; muf.muid = muid.Trim(); muf.urid = Function.GetCurrentUser(); muf.adtm = DateTime.Now; bll.DoInsert <tstmnumuf>(muf); } if (action == "delete") { List <ColumnInfo> parameters = new List <ColumnInfo>() { new ColumnInfo() { ColumnName = "muid", ColumnValue = muid }, new ColumnInfo() { ColumnName = "apnm", ColumnValue = Parameter.APPLICATION_NAME }, new ColumnInfo() { ColumnName = "urid", ColumnValue = Function.GetCurrentUser() } }; tstmnumuf obj = bll.GetSelectedObject <tstmnumuf>(parameters); if (obj != null) { //bll.DoDelete<tstmnumuf>(parameters); bll.DoDelete <tstmnumuf>(obj); } } } catch (UtilException ex) { throw ex; } catch (Exception ex) { throw new UtilException(ex.Message, ex); } }
public List <object> GetCalendarDetails(List <ColumnInfo> _parameter) { List <tatclddtl> result = new List <tatclddtl>(); DateTime startDate = DateTime.Now; DateTime endDate = DateTime.Now; string otcd = string.Empty; string htcd = string.Empty; var q = from p in _parameter where p.ColumnName == "stdt" select p.ColumnValue; startDate = Convert.ToDateTime(q.Single()); q = from p in _parameter where p.ColumnName == "endt" select p.ColumnValue; endDate = Convert.ToDateTime(q.Single()); q = from p in _parameter where p.ColumnName == "otcd" select p.ColumnValue; otcd = q.Single(); q = from p in _parameter where p.ColumnName == "htcd" select p.ColumnValue; htcd = q.Single(); //tbssyscfgBll syscfgBll = new tbssyscfgBll(); int weekday = Convert.ToUInt16(((StSystemConfig)Parameter.CURRENT_SYSTEM_CONFIG).AtWDPW);//syscfgBll.GetSysParameter_Weekwkdas(); bool isHoliday = false; while (startDate <= endDate) { if (weekday == 5) { if ((startDate.DayOfWeek == DayOfWeek.Saturday) || (startDate.DayOfWeek == DayOfWeek.Sunday)) { isHoliday = true; } else { isHoliday = false; } } else if (weekday == 6) { if ((startDate.DayOfWeek == DayOfWeek.Sunday)) { isHoliday = true; } else { isHoliday = false; } } if (isHoliday) { tatclddtl dtl = new tatclddtl() { cddt = startDate, htcd = htcd, otcd = otcd, remk = "auto generation", lmtm = DateTime.Now, lmur = "System" }; result.Add(dtl); } startDate = startDate.AddDays(1); } string htnm = string.Empty; string otnm = string.Empty; BaseBll baseBll = new BaseBll(); tathldtyp ht = baseBll.GetSelectedObject <tathldtyp>(new List <ColumnInfo>() { new ColumnInfo() { ColumnName = "htcd", ColumnValue = htcd } }); htnm = ht.htnm; tottype ottype = baseBll.GetSelectedObject <tottype>(new List <ColumnInfo>() { new ColumnInfo() { ColumnName = "otcd", ColumnValue = otcd } }); otnm = ottype.otnm; var q1 = from p in result select new { p.cddt, p.htcd, p.otcd, p.remk, p.lmtm, p.lmur, htnm = htnm, otnm = otnm }; return(q1.Cast <object>().ToList()); }
private void LoadData(string rpcd, List <ColumnInfo> lstParameters) { BaseBll bll = new BaseBll(); trpexrpdf def = bll.GetSelectedObject <trpexrpdf>(new List <ColumnInfo>() { new ColumnInfo() { ColumnName = "rpcd", ColumnValue = rpcd } }); List <trpexrpdd> lstDtl = bll.GetSelectedRecords <trpexrpdd>(new List <ColumnInfo>() { new ColumnInfo() { ColumnName = "rpcd", ColumnValue = rpcd } }); rpexrpdpBll rpbll = new rpexrpdpBll(); DataSet ds = null; switch (def.rpty) { case "Personnel": ds = rpbll.GetPersonalData(rpcd, lstDtl, lstParameters); break; case "Payroll": ds = rpbll.GetPayrollData(rpcd, lstDtl, lstParameters); break; case "PayrollBankAlloc": ds = rpbll.GetPayrollBankAllocData(rpcd, lstDtl, lstParameters); break; } if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { //Title this.GridView1.Caption = "<B>" + def.rptt + "</B>"; this.GridView1.DataSource = ds; this.GridView1.DataBind(); //Merge Column MergeGridView mergeGV = new MergeGridView(); for (int i = 0; i < lstDtl.Count; i++) { if (lstDtl[i].isme == "Y") { mergeGV.Merge(this.GridView1, i); } } //Summary var q = (from p in lstDtl where p.issu == "Y" select p).ToList(); for (int i = 0; i < q.Count; i++) { //GridViewSummary sum = new GridViewSummary(q[i].itnm, SummaryOperation.Sum); } } else { } }