private void TodayEntryList() { try { String refSourceString = String.Empty; DataCaptureManager manager = new DataCaptureManager(); String dateText = HttpContext.Current.Request.QueryString["DateText"]; CustomList <ProductionDataCapture> ProductionDataCaptureList = manager.GetAllProductionDataCapture(dateText); CustomList <HRM_Emp> Emplist = manager.GetAllHRM_Emp(); foreach (ProductionDataCapture pDC in ProductionDataCaptureList) { HRM_Emp item = Emplist.Find(f => f.EmpKey == pDC.EmpKey); pDC.EmpCode = item.EmpCode; pDC.EmpName = item.EmpName; pDC.Value = pDC.Qty * pDC.Rate; } HttpContext.Current.Session["DataCapture_DataCaptureDynamicGridList"] = ProductionDataCaptureList; HttpContext.Current.Response.Clear(); HttpContext.Current.Response.ContentType = "text/plain"; HttpContext.Current.Response.Write(refSourceString); HttpContext.Current.Response.Flush(); } catch (SqlException ex) { string errorMsg = ExceptionHelper.getSqlExceptionMessage(ex); HttpContext.Current.Response.StatusCode = 500; HttpContext.Current.Response.Write(errorMsg); } }
private void AddToGrid() { try { String refSourceString = String.Empty; DataCaptureManager manager = new DataCaptureManager(); String empCode = HttpContext.Current.Request.QueryString["EmpCode"]; String qty = HttpContext.Current.Request.QueryString["Qty"]; String rateID = HttpContext.Current.Request.QueryString["RateID"]; String rate = HttpContext.Current.Request.QueryString["Rate"]; String captureDate = HttpContext.Current.Request.QueryString["CaptureDate"]; CustomList <ProductionDataCapture> ProductionDataCaptureList = (CustomList <ProductionDataCapture>)HttpContext.Current.Session["DataCapture_DataCaptureDynamicGridList"]; CustomList <ProductionDataCapture> EmpListList = manager.GetAllProductionDataCaptureEmp(empCode); ProductionDataCapture item = ProductionDataCaptureList.Find(f => f.EmpCode == empCode); if (item.IsNull()) { ProductionDataCapture newObj = new ProductionDataCapture(); newObj.EmpCode = empCode; if (EmpListList.Count != 0) { newObj.EmpKey = EmpListList[0].EmpKey; newObj.EmpName = EmpListList[0].EmpName; } newObj.DataCaptureRateRuleID = rateID; newObj.Qty = qty.ToInt(); newObj.Rate = rate.ToDecimal(); newObj.Value = newObj.Qty * newObj.Rate; newObj.ProcessDate = captureDate.ToDateTime(); ProductionDataCaptureList.Add(newObj); } else { item.DataCaptureRateRuleID = rateID; item.Qty = qty.ToInt(); item.Rate = rate.ToDecimal(); item.Value = item.Qty * item.Rate; item.ProcessDate = captureDate.ToDateTime(); } HttpContext.Current.Response.Clear(); HttpContext.Current.Response.ContentType = "text/plain"; HttpContext.Current.Response.Write(refSourceString); HttpContext.Current.Response.Flush(); } catch (SqlException ex) { string errorMsg = ExceptionHelper.getSqlExceptionMessage(ex); HttpContext.Current.Response.StatusCode = 500; HttpContext.Current.Response.Write(errorMsg); } }
private void UpdateDataCaptureGrid() { try { String refSourceString = String.Empty; DataCaptureManager manager = new DataCaptureManager(); String vid = HttpContext.Current.Request.QueryString["VID"]; CustomList <ProductionDataCapture> ProductionDataCaptureList = (CustomList <ProductionDataCapture>)HttpContext.Current.Session["DataCapture_DataCaptureDynamicGridList"]; ProductionDataCapture item = ProductionDataCaptureList.Find(f => f.VID == vid.ToInt()); refSourceString = item.EmpCode + ";" + item.DataCaptureRateRuleID + ";" + item.Qty.ToString() + ";" + item.Rate.ToString() + ";" + item.ProcessDate.ToShortDateString(); HttpContext.Current.Response.Clear(); HttpContext.Current.Response.ContentType = "text/plain"; HttpContext.Current.Response.Write(refSourceString); HttpContext.Current.Response.Flush(); } catch (SqlException ex) { string errorMsg = ExceptionHelper.getSqlExceptionMessage(ex); HttpContext.Current.Response.StatusCode = 500; HttpContext.Current.Response.Write(errorMsg); } }