public List <requestDTO> GetAll() { requestBL requestListBL = new requestBL(); List <requestDTO> request = requestListBL.GetAllRequest(); return(request); }
private void FillStatusDropDown(int wmsid) { try { _rqstbl = new requestBL(); DataSet ds = _rqstbl.getStatusValues(wmsid); if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0) { ddlChangeStatus.DataSource = ds.Tables[0]; ddlChangeStatus.DataValueField = ds.Tables[0].Columns[0].ToString(); ddlChangeStatus.DataTextField = ds.Tables[0].Columns[1].ToString(); ddlChangeStatus.DataBind(); ddlChangeStatus.Items.Insert(0, "Select Status"); ddlChangeStatusEvent(); statusdiv.Visible = true; } else { statusdiv.Visible = false; } trclosure.Attributes.CssStyle.Add("Display", "none"); rfvtxtIntime.Enabled = false; rfvtxtOutTime.Enabled = false; rgvtxtOutTime.Enabled = false; } catch (Exception ex) { statusdiv.Visible = false; throw; } }
public string GetStatsData(string Timeframe) { requestBL _rqstbl = new requestBL(); int userid = Convert.ToInt16(Session["UserId"]); List <PriorityByStatus> lstPriorityByStatus = new List <PriorityByStatus>(); DataTable dtRequest = _rqstbl.GetDashboardInfo(userid, Timeframe).Tables[1]; foreach (DataRow row in dtRequest.Rows) { lstPriorityByStatus.Add(new PriorityByStatus { PriorityId = Convert.ToInt16(row["PriorityID"]), PriorityName = Convert.ToString(row["PriorityName"]), StatusId = Convert.ToInt16(row["StatusId"]), StatusName = Convert.ToString(row["StatusName"]), StatusCount = Convert.ToInt16(row["StatusCount"]), }); } //var data = from p in lstPriorityByStatus // group p by p.PriorityName // into g // select new // { // PriorityName = g.Key, // PriorityCount = (int) g.Sum(a => a.StatusCount) // }; return(new JavaScriptSerializer().Serialize(lstPriorityByStatus)); }
public string GetRequestDataByStatus(int Status) { requestBL _rqstbl = new requestBL(); int userid = Convert.ToInt16(Session["UserId"]); List <RequestData> lstRequestData = new List <RequestData>(); DataTable dtRequest = _rqstbl.GetRequestDetailsByStatus(userid, Status); foreach (DataRow row in dtRequest.Rows) { lstRequestData.Add(new RequestData { WMSID = Convert.ToInt32(row["WMSID"]), PriorityName = Convert.ToString(row["PriorityName"]), BranchName = Convert.ToString(row["BranchName"]), AffectOperation = Convert.ToString(row["AffectOperation"]), Scope = Convert.ToString(row["Scope"]), SectionName = Convert.ToString(row["SectionName"]), Category = Convert.ToString(row["Category"]), Requestor = Convert.ToString(row["Requestor"]), CreatedDate = Convert.ToDateTime(row["CreatedDate"]) }); } return(new JavaScriptSerializer().Serialize(lstRequestData)); }
private void FillRequestDetails(int wmsId) { try { _rqstbl = new requestBL(); var ds = _rqstbl.GetRequestDetail(wmsId); if (ds.Tables[0].Rows.Count > 0) { Form_Request.DataSource = ds.Tables[0]; Form_Request.DataBind(); lblCurrentStatusValue.Text = ds.Tables[0].Rows[0]["StatusName"].ToString(); if (Convert.ToInt16(ds.Tables[0].Rows[0]["StatusId"]) == 3 || Convert.ToInt16(ds.Tables[0].Rows[0]["StatusId"]) == 4) { var btnEditRequest = (Button)Form_Request.FindControl("btnEditRequest"); btnEditRequest.Visible = false; } else { var btnEditRequest = (Button)Form_Request.FindControl("btnEditRequest"); if (btnEditRequest != null) { btnEditRequest.Visible = true; } } Session["wmsId"] = wmsId; } } catch (Exception ex) { throw; } }
public List <requestDTO> GetRequestByCodeInstation(int id) { requestBL requests = new requestBL(); List <requestDTO> request = requests.GetRequestByCodeInstatition(id); return(request); }
protected void Form_Request_ItemInserting(object sender, FormViewInsertEventArgs e) { try { _rqstbo = CreateRequest(); _rqstbo.InsUpdFlag = 0; _rqstbo.statusId = 1; _rqstbo.assignedTo = 1; if (Session["UserBO"] == null) { Response.Redirect("Login.aspx", false); } else { _userBO = new UserBO(); _userBO = (UserBO)Session["UserBO"]; // change after adding branch drop down for admin if (_userBO.RoleID == 1) { _rqstbo.branchId = 1; } else { _rqstbo.branchId = _userBO.BranchID; } } // change after login page _rqstbl = new requestBL(); var tranid = _rqstbl.insertUpdateRequest(_rqstbo); if (!(tranid.Equals(0))) { lblMessage.Text = "Request placed succesfully"; lblMessage.Visible = true; Form_Request.ChangeMode(FormViewMode.ReadOnly); FillRequestDetails(tranid); FillStatusDropDown(tranid); lblWmsIdValue.Text = tranid.ToString(); } else { lblMessage.Text = "Request creation failed. Please try again"; lblMessage.Visible = true; } } catch (Exception ex) { Session["wmsId"] = null; throw; } finally { _rqstbo = null; _rqstbl = null; } }
private void FillDropDown(DropDownList ddlAssignTo, string selectQuery, string table, string condition) { try { _rqstbl = new requestBL(); DataSet ds = _rqstbl.getDropDownValues(selectQuery, table, condition); ddlAssignTo.DataSource = ds.Tables[0]; ddlAssignTo.DataValueField = ds.Tables[0].Columns[0].ToString(); ddlAssignTo.DataTextField = ds.Tables[0].Columns[1].ToString(); ddlAssignTo.DataBind(); } catch (Exception ex) { throw; } }
protected void btnSubmitStatus_Click(object sender, EventArgs e) { try { _statusbo = new statusBO(); _statusbo.closureFlag = 0; _statusbo.wmsId = Convert.ToInt32(lblWmsIdValue.Text); _statusbo.status = Convert.ToInt32(ddlChangeStatus.SelectedValue); _statusbo.assignedTo = 0; if (ddlAssignTo.SelectedValue != "" && ddlAssignTo.SelectedValue != null) { _statusbo.assignedTo = Convert.ToInt32(ddlAssignTo.SelectedValue); } _statusbo.comment = txtAdminComment.Text; if (ddlChangeStatus.SelectedItem.Text == "Close") { _statusbo.closureFlag = 1; _statusbo.materialsUsed = txtMaterialsUsed.Text; _statusbo.teamMembers = txtTeamMembers.Text; _statusbo.timeIn = Convert.ToDateTime(txtIntime.Text.ToString()); _statusbo.timeOut = Convert.ToDateTime(txtOutTime.Text.ToString()); } _rqstbl = new requestBL(); var tranid = _rqstbl.changestatus(_statusbo); if (!(tranid.Equals(0))) { lblMessage.Text = "Status updated succesfully"; lblMessage.Visible = true; FillStatusDropDown(tranid); FillRequestDetails(tranid); txtAdminComment.Text = ""; } else { lblMessage.Text = "Status updation failed. Please try again"; lblMessage.Visible = true; } } catch (Exception ex) { throw; } }
public string GetStatuses() { requestBL _rqstbl = new requestBL(); List <Statuses> lstStatuses = new List <Statuses>(); DataTable dtStatuses = _rqstbl.GetMasterStatus(); foreach (DataRow row in dtStatuses.Rows) { lstStatuses.Add(new Statuses { StatusID = Convert.ToInt32(row["StatusID"]), StatusName = Convert.ToString(row["StatusName"]) }); } return(new JavaScriptSerializer().Serialize(lstStatuses)); }
private void FillCheckBox(string chk, string selectQuery, string table, string condition) { try { var chkname = (CheckBoxList)Form_Request.FindControl(chk); _rqstbl = new requestBL(); DataSet ds = _rqstbl.getDropDownValues(selectQuery, table, condition); chkname.DataSource = ds.Tables[0]; chkname.DataValueField = ds.Tables[0].Columns[0].ToString(); chkname.DataTextField = ds.Tables[0].Columns[1].ToString(); chkname.DataBind(); } catch (Exception ex) { throw; } }
public string GetRequestbyStatus(int Status) { Status = 1; requestBL _rqstbl = new requestBL(); List <RequestCriticalityData> lstRequestCriticalityData = new List <RequestCriticalityData>(); int Userid = Convert.ToInt16(Session["UserId"]); DataTable dtRequest = _rqstbl.getRequestbyStatus(Status, Userid).Tables[0]; foreach (DataRow row in dtRequest.Rows) { lstRequestCriticalityData.Add(new RequestCriticalityData { Criticality = Convert.ToString(row["Criticality"]), IssueCount = Convert.ToInt16(row["IssueCount"]), ChartColor = Convert.ToString(row["ChartColor"]), }); } return(new JavaScriptSerializer().Serialize(lstRequestCriticalityData)); }
//פונקצית הערכה //מקבלת אוסף -ליסט- של השיבוץ של כל בית הספר //ומחזירה ציון לשיבוץ //לפי //1. פרק הזמן שאמא לכמה בנות שוהה בבית הספר //2. רמת סטיה מבקשות של אמהות private double mark() { //!!!!!!!!!!!!!!!!!!!!לשלוף את כל האמהות מהמסד נתונים List <parents> lst_par = perentsDAL.GetAllParents(); double avg = 0, cntExp = 0; TimeSpan min = new TimeSpan(00, 0, 0); TimeSpan max = new TimeSpan(12, 0, 0); TimeSpan temp; perentsBL pars = new perentsBL(); requestBL r = new requestBL(); //1. פרק הזמן שאמא לכמה בנות שוהה בבית הספר foreach (parents p in lst_par) { List <studens> lst_k = pars.get_Allkids(p.id); for (int i = 0; i < lst_k.Count(); i++) { //השוואה של timespan temp = lstscheduling.Where(x => x.id_student == lst_k[i].id).FirstOrDefault().hour_; if (temp > (max)) { max = temp; } if (temp < min) { min = temp; } } avg = Convert.ToInt32(max - min) / lst_k.Count(); if (avg > 30) { cntExp++; } } //2. רמת סטיה מבקשות של אמהות foreach (parents p in lst_par) { //List<request> lst_r =r; } return(0); }
public void addRequest() { requestDTO r = new requestDTO(); StreamReader read = new StreamReader(@"d:\request.csv", Encoding.Default); string str = read.ReadToEnd(); string[] arr = str.Split('\n'); for (int i = 0; i < arr.Length; i++) { int j = 0; string[] arr1 = arr[i].Split(','); r.code = int.Parse(arr1[j++]); r.id_parent = arr1[j++]; r.from_hour = TimeSpan.Parse(arr1[j++]); r.to_hour = TimeSpan.Parse(arr1[j++]); requestBL rBL = new requestBL(); rBL.AddRequest(r); Console.WriteLine(); } Console.ReadLine(); }
public void Post(requestDTO request) { requestBL requestListBL = new requestBL(); requestListBL.AddRequest(request); }
public Boolean check(requestDTO request) { requestBL requestListBL = new requestBL(); return(requestListBL.check(request)); }
public void Post1() { requestBL requestListBL = new requestBL(); requestListBL.addRequestFromExcel(); }
public void Put(requestDTO requestDTO) { requestBL requestListBL = new requestBL(); requestListBL.UpdateRequest(requestDTO); }
public void Delete(string requestID) { requestBL requestListBL = new requestBL(); requestListBL.DeleteRequest(requestID); }