public ActionResult HolidaySearch(int Year, int Month) { HttpCookie myCookie = new HttpCookie("UInfo"); myCookie = Request.Cookies["UInfo"]; if (myCookie != null) { Hashtable hst = new Hashtable(); List <DMHoliday> Holiday = new List <DMHoliday>(); DataTable dt = new DataTable(); DBA = new DBClass(); objTools = new Utility(); DataModel.DMUsersLoginDetails DL = objTools.GetClientLoginDetails(myCookie.Value.ToString()); hst.Add("@ClientID", Convert.ToInt16(DL.ClientID)); hst.Add("@Year", Year); hst.Add("@Month", Month); dt = DBA.GetDataTables("[SP_HolidayView]", hst); Holiday = dt.DataTableToList <DMHoliday>(); return(PartialView("_Holiday", Holiday)); } else { return(RedirectPermanent("/")); } }
public ActionResult Invoice() { HttpCookie myCookie = new HttpCookie("UInfo"); myCookie = Request.Cookies["UInfo"]; if (myCookie != null) { Hashtable hst = new Hashtable(); objTools = new Utility(); DataModel.DMUsersLoginDetails DL = objTools.GetClientLoginDetails(myCookie.Value.ToString()); ViewBag.Foto = DL.Foto; ViewBag.UserName = DL.FullName; ViewBag.ClientID = DL.ClientID; ViewBag.LastLogin = Convert.ToDateTime(DL.LastLogin).ToString("dd MMM yyyy HH:mm:ss"); hst.Add("@ClientID", Convert.ToInt16(DL.ClientID)); ViewBag.TxtMenu = objTools.CreateMenu(hst, "[SP_UsersMenuLoad]"); DMSearchField DY = new DMSearchField(); DY.MonthList = objTools.GetMonths(); DY.YearList = objTools.GetYears(); return(View(DY)); } else { return(RedirectPermanent("/")); } }
public ActionResult WorkingTimeGroupSearch(DMSearchField data) { HttpCookie myCookie = new HttpCookie("UInfo"); myCookie = Request.Cookies["UInfo"]; if (myCookie != null) { try { DBA = new DBClass(); objTools = new Utility(); Hashtable hst = new Hashtable(); DataTable dt = new DataTable(); List <DMNewWorkingHour> Data = new List <DMNewWorkingHour>(); DataModel.DMUsersLoginDetails DL = objTools.GetClientLoginDetails(myCookie.Value.ToString()); hst.Add("@ClientID", Convert.ToInt16(DL.ClientID)); hst.Add("@BranchID", data.Searching.Key2); hst.Add("@Key", data.Searching.Key); dt = DBA.GetDataTables("[SP_AttendanceTimeGroup_View]", hst); Data = dt.DataTableToList <DMNewWorkingHour>(); return(PartialView("_WorkingTimeGroupList", Data)); } catch (Exception ex) { return(Json(new { isSuccess = false, msg = string.Format("Failed!<br/>" + ex.Message.ToString()), url = "/" }, JsonRequestBehavior.AllowGet)); } } else { return(RedirectPermanent("/")); } }
public ActionResult UpdateWorkingHour(int TimeGroupID) { HttpCookie myCookie = new HttpCookie("UInfo"); myCookie = Request.Cookies["UInfo"]; if (myCookie != null) { try { DBA = new DBClass(); objTools = new Utility(); Hashtable hst = new Hashtable(); DataTable dt = new DataTable(); List <DMNewWorkingHour> Data = new List <DMNewWorkingHour>(); DataModel.DMUsersLoginDetails DL = objTools.GetClientLoginDetails(myCookie.Value.ToString()); hst.Add("@TimeGroupID", TimeGroupID); hst.Add("@UserName", DL.FullName); dt = DBA.GetDataTables("[SP_AttendanceTimeGroup_FActive]", hst); Data = dt.DataTableToList <DMNewWorkingHour>(); return(PartialView("_WorkingTimeGroupList", Data)); } catch (Exception ex) { return(Json(new { isSuccess = false, msg = string.Format("Failed!<br/>" + ex.Message.ToString()), url = "/" }, JsonRequestBehavior.AllowGet)); } } else { return(RedirectPermanent("/")); } }
public ActionResult EDShiftGroup(int ShiftID, int BranchID = 0) { HttpCookie myCookie = new HttpCookie("UInfo"); myCookie = Request.Cookies["UInfo"]; if (myCookie != null) { try { DBA = new DBClass(); objTools = new Utility(); Hashtable hst = new Hashtable(); DataTable dt = new DataTable(); DMGroupShiftList Data = new DMGroupShiftList(); List <DMGroupShiftHeader> ShiftHeader = new List <DMGroupShiftHeader>(); List <DMGroupShiftDetails> ShiftDetails = new List <DMGroupShiftDetails>(); DataModel.DMUsersLoginDetails DL = objTools.GetClientLoginDetails(myCookie.Value.ToString()); hst.Add("@ShiftID", ShiftID); hst.Add("@UserName", DL.FullName); DBA.ExecSP("[SP_AttendanceShiftGroup_FActive]", hst); hst.Clear(); hst.Add("@ClientID", Convert.ToInt16(DL.ClientID)); hst.Add("@BranchID", BranchID); hst.Add("@Key", String.Empty); dt = DBA.GetDataTables("[SP_AttendanceShiftGroupHeader_View]", hst); ShiftHeader = dt.DataTableToList <DMGroupShiftHeader>(); dt.Clear(); hst.Clear(); for (int i = 0; i <= ShiftHeader.Count - 1; i++) { hst.Clear(); hst.Add("@ShiftID", ShiftHeader[i].ID); dt = DBA.GetDataTables("[SP_AttendanceShiftGroupDetails_View]", hst); for (int y = 0; y <= dt.Rows.Count - 1; y++) { ShiftDetails.Add(new DMGroupShiftDetails { ShiftID = Convert.ToInt32(dt.Rows[y][0].ToString()), WorkingHourID = Convert.ToInt32(dt.Rows[y][1].ToString()), WorkingDay = Convert.ToInt32(dt.Rows[y][2].ToString()), OffDay = Convert.ToInt32(dt.Rows[y][3].ToString()), CurrentIn = Convert.ToDateTime(dt.Rows[y][4].ToString()), CurrentOut = Convert.ToDateTime(dt.Rows[y][5].ToString()) }); } } Data.GroupShiftHeader = ShiftHeader; Data.GroupShiftDetails = ShiftDetails; return(PartialView("_GroupShiftList", Data)); } catch (Exception ex) { return(Json(new { isSuccess = false, msg = string.Format("Failed!<br/>" + ex.Message.ToString()), url = "/" }, JsonRequestBehavior.AllowGet)); } } else { return(RedirectPermanent("/")); } }
public ActionResult NewGroupShift(int BranchID = 0) { HttpCookie myCookie = new HttpCookie("UInfo"); myCookie = Request.Cookies["UInfo"]; if (myCookie != null) { try { objTools = new Utility(); DataModel.DMUsersLoginDetails DL = objTools.GetClientLoginDetails(myCookie.Value.ToString()); List <DMGroupShiftDetails> ChaceGroupShift = HttpContext.Cache["ChaceGroupShift"] as List <DMGroupShiftDetails>; DMGroupShiftInsert AddNew = new DMGroupShiftInsert(); List <DMNewWorkingHour> TimeGroup = new List <DMNewWorkingHour>(); List <DMGroupShiftDetails> GroupShiftDetails = new List <DMGroupShiftDetails>(); DMGroupShiftHeader GroupShiftHeader = new DMGroupShiftHeader(); DataTable Dt = new DataTable(); Hashtable hst = new Hashtable(); DBA = new DBClass(); hst.Add("@ClientID", Convert.ToInt16(DL.ClientID)); hst.Add("@BranchID", Convert.ToInt16(DL.BranchID)); Dt = DBA.GetDataTables("[SP_AttendanceTimeGroupToCombo]", hst); TimeGroup = Dt.DataTableToList <DMNewWorkingHour>(); HttpContext.Cache.Insert("ChaceGroupShift", GroupShiftDetails, null, Cache.NoAbsoluteExpiration, new TimeSpan(0, 30, 0)); GroupShiftDetails.Add(new DMGroupShiftDetails { OffDay = 0, WorkingDay = 0, WorkingHourID = 0, ID = 1 }); HttpContext.Cache.Insert("ChaceGroupShift", GroupShiftDetails, null, Cache.NoAbsoluteExpiration, new TimeSpan(0, 30, 0)); AddNew.TimeGroup = TimeGroup; AddNew.GroupShiftDetails = GroupShiftDetails; if (BranchID == 0) { GroupShiftHeader.BranchName = "All Branch"; } GroupShiftHeader.BranchID = BranchID; AddNew.GroupShiftHeader = GroupShiftHeader; return(PartialView("_GroupShiftNew", AddNew)); } catch { return(PartialView("_GroupShiftNew")); } } else { return(RedirectPermanent("/")); } }
public ActionResult SaveNewWorkingHour(DMNewWorkingHour data) { HttpCookie myCookie = new HttpCookie("UInfo"); myCookie = Request.Cookies["UInfo"]; if (myCookie != null) { try { DBA = new DBClass(); objTools = new Utility(); Hashtable hst = new Hashtable(); DataModel.DMUsersLoginDetails DL = objTools.GetClientLoginDetails(myCookie.Value.ToString()); hst.Add("@ClientID", Convert.ToInt16(DL.ClientID)); hst.Add("@BranchID", data.Branch); hst.Add("@TimeGroupName", data.TimeGroupName); hst.Add("@CurrentIn", data.CurrentIn); hst.Add("@MaxIn", data.MaxIn); hst.Add("@MinIn", data.MinIn); hst.Add("@CurrentOut", data.CurrentOut); hst.Add("@MaxOut", data.MaxOut); hst.Add("@MinOut", data.MinOut); hst.Add("@UserName", DL.FullName); DBA.ExecSP("[SP_AttendanceTimeGroup_Insert]", hst); return(Json(new { isSuccess = true, msg = string.Format("Save") }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(Json(new { isSuccess = false, msg = string.Format("Failed!" + ex.Message.ToString()), url = "/" }, JsonRequestBehavior.AllowGet)); } } else { return(RedirectPermanent("/")); } }
public ActionResult InvoiceSearch(DMSearchField data) { HttpCookie myCookie = new HttpCookie("UInfo"); myCookie = Request.Cookies["UInfo"]; if (myCookie != null) { objTools = new Utility(); DBA = new DBClass(); DataModel.DMUsersLoginDetails DL = objTools.GetClientLoginDetails(myCookie.Value.ToString()); List <DataModel.DMInvoiceList> InvList = new List <DMInvoiceList>(); DataTable Dt = new DataTable(); Hashtable hst = new Hashtable(); hst.Add("@Key", data.Searching.Key); hst.Add("@ClientID", DL.ClientID); hst.Add("@Month", data.Searching.Month); hst.Add("@Years", data.Searching.Year); Dt = DBA.GetDataTables("[SP_UsersInvoiceLoad]", hst); if (Dt.Rows.Count > 0) { InvList = Dt.DataTableToList <DMInvoiceList>(); return(PartialView("_InvoiceList", InvList)); } else { return(Json(new { isSuccess = false, msg = string.Format("No Record(s) found") }, JsonRequestBehavior.AllowGet)); } } else { return(RedirectPermanent("/")); } }
public ActionResult NewInvoice(int CustID = 0, string InvNo = "") { DMClientCustomerToInvoice DC = new DMClientCustomerToInvoice(); List <DataModel.DMNewInvoice> ChaceInvoice = new List <DataModel.DMNewInvoice>(); HttpContext.Cache.Insert("ChaceInvoice", ChaceInvoice, null, Cache.NoAbsoluteExpiration, new TimeSpan(0, 0, 0)); DMCreateNewInvoice DCI = new DMCreateNewInvoice(); DataModel.DMNewInvoice INV = new DMNewInvoice(); List <DMNewInvoice> DI = new List <DMNewInvoice>(); HttpCookie myCookie = new HttpCookie("UInfo"); myCookie = Request.Cookies["UInfo"]; if (myCookie != null) { INV.NoID = 1; INV.Qty = 1; INV.Price = 0; INV.Total = 0; DI.Add(INV); Hashtable hst = new Hashtable(); objTools = new Utility(); DataModel.DMUsersLoginDetails DL = objTools.GetClientLoginDetails(myCookie.Value.ToString()); ViewBag.Foto = DL.Foto; ViewBag.UserName = DL.FullName; ViewBag.ClientID = DL.ClientID; ViewBag.LastLogin = Convert.ToDateTime(DL.LastLogin).ToString("dd MMM yyyy HH:mm:ss"); hst.Add("@ClientID", Convert.ToInt16(DL.ClientID)); ViewBag.TxtMenu = objTools.CreateMenu(hst, "[SP_UsersMenuLoad]"); var t = AddItemInvoice(DI); ViewBag.Total = CountTotal(t); DCI.ListDI = DI; if (CustID > 0) { DataTable dt = new DataTable(); DBA = new DBClass(); hst.Add("@ClientID", DL.ClientID); hst.Add("@ID", CustID); dt = DBA.GetDataTables("[SP_UsersCustomerDetails]", hst); for (var i = 0; i <= dt.Rows.Count - 1; i++) { DC.ClientID = DL.ClientID; DC.ContactPerson = dt.Rows[i]["ContactPerson"].ToString(); DCI.NC = DC; } } else { DCI.NC = DC; } return(View(DCI)); } else { return(RedirectPermanent("/")); } }