public static List<Object> GetDepItem(string id = "")
        {
            DepartmentService s = new DepartmentService();
            string itemid = id;
            List<object> itemlist = new List<object>();
            itemlist = s.getItemByDep(id);

            return itemlist;
        }
        public static bool SaveDisbursement(List<int> quant, List<int> dep, int itemID, List<int> quantreq)
        {
            DepartmentService sdepser = new DepartmentService();
            //int count;
            int totcount;
            totcount = dep.Count();
            bool ans = true;
            int userid= Convert.ToInt32(HttpContext.Current.Session["userid"].ToString());

            Disbursement_M disb=new Disbursement_M();
            for (int i = 0; i < totcount; i++)
            {
                disb.ItemID = itemID;
                disb.DepID = dep[i];
                disb.RequiredQuant = quantreq[i];
                disb.QuantinHand = quant[i];
                sdepser.savedisb(disb,userid);

            }

            return ans;
        }
Exemple #3
0
        public bool CreateDisbursement(DisbursementM[] disbursement)
        {
            DepartmentService departmentService = new DepartmentService();
            try
            {
                for (int i = 0; i < disbursement.Count(); i++)
                {
                    DisbursementM d = disbursement[i];
                    Disbursement_M m = new Disbursement_M();
                    m.DepID = Convert.ToInt32( d.DepID);
                    m.ItemID = Convert.ToInt32(d.ItemID);
                    m.QuantinHand = Convert.ToInt32(d.QuantityInHand);
                    m.RequiredQuant =Convert.ToInt32( d.RequiredQuant);
                    departmentService.savedisb(m,Convert.ToInt32(d.UpdatedUserID));

                }
                return true;
            }
            catch (Exception ex)
            {
                return false;
            }
        }
Exemple #4
0
        public RequisitionItemByDepartment[] GetDataItemByDepartment(String itemID)
        {
            DepartmentService department = new DepartmentService();
            var objItemByDepartment = department.getItemByDep(itemID);
            RequisitionItemByDepartment[] itemList = new RequisitionItemByDepartment[objItemByDepartment.Count];
            int count = 0;
            foreach (var obj in objItemByDepartment)
            {
                RequisitionItemByDepartment d = new RequisitionItemByDepartment();
                Type t = obj.GetType();
                PropertyInfo dep_ID = t.GetProperty("DepID");
                PropertyInfo item_Description = t.GetProperty("ItemDescription");
                PropertyInfo dep_Name = t.GetProperty("DepName");
                PropertyInfo required_Qty = t.GetProperty("Required_Quantity");
                d.DepID = dep_ID.GetValue(obj, null).ToString();
                d.DepName = dep_Name.GetValue(obj, null).ToString();
                d.ItemDescription = item_Description.GetValue(obj, null).ToString();
                d.Required_Quantity = required_Qty.GetValue(obj, null).ToString();

                itemList.SetValue(d,count);
                count++;

            }
            return itemList;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            bool isTempHead = false;
            RegistrationService rser = new RegistrationService();
            string userId = HttpContext.Current.User.Identity.Name;
            isTempHead = rser.IsTempDepHead(userId);

            if ((HttpContext.Current.User.IsInRole("Department Head") != true) && (isTempHead != true))
            {
                Response.Redirect("/Presentation/Login.aspx");

            }

            _RequisitionService = new RequisitionService();
            _EmployeeService = new EmployeeService();
            _DepartmentService = new DepartmentService();
            _ItemService = new ItemService();

            if (!IsPostBack)
            {
                int QueryStringReqID = Int32.Parse(Request.QueryString["ID"]);

                var Req_Emp_DeptDetails = _RequisitionService.GetReq_Emp_DeptDetailsListByReqId(QueryStringReqID);

                Type t = Req_Emp_DeptDetails.GetType();

                PropertyInfo EmployeeName = t.GetProperty("EmployeeName");
                lblEmployeeName.Text = Convert.ToString(EmployeeName.GetValue(Req_Emp_DeptDetails,null));
                PropertyInfo EmpNo = t.GetProperty("EmployeeID");
                lblEmpNo.Text = Convert.ToString(EmpNo.GetValue(Req_Emp_DeptDetails, null));
                PropertyInfo EmpEmail = t.GetProperty("EmployeeEmail");
                lblEmpEmail.Text = Convert.ToString(EmpEmail.GetValue(Req_Emp_DeptDetails, null));

                PropertyInfo DeptName = t.GetProperty("DepName");
                lblDeptName.Text = Convert.ToString(DeptName.GetValue(Req_Emp_DeptDetails, null));
                PropertyInfo DeptCode = t.GetProperty("DepID");
                lblDeptCode.Text = Convert.ToString(DeptCode.GetValue(Req_Emp_DeptDetails, null));
                PropertyInfo reason=t.GetProperty("ReqReason");
                txtReason.Text = Convert.ToString(reason.GetValue(Req_Emp_DeptDetails, null));

                PropertyInfo status= t.GetProperty("ReqStatus");
                string searchStatus = Convert.ToString(status.GetValue(Req_Emp_DeptDetails, null));
                if (searchStatus == "approved")
                {
                    btnConfirmRequisition.Enabled = false;
                    btnRejectRequisition.Enabled = false;
                    txtReason.Enabled = false;
                    PanelApprove.Visible = true;
                }

                loadItemGridViewData(QueryStringReqID);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            bool isTempHead = false;
            RegistrationService rser = new RegistrationService();
            string userId = HttpContext.Current.User.Identity.Name;
            isTempHead = rser.IsTempDepHead(userId);

            if ((HttpContext.Current.User.IsInRole("Department Head") != true) && (isTempHead != true))
            {
                Response.Redirect("/Presentation/Login.aspx");

            }

            _EmployeeService = new EmployeeService();
            _DepartmentService = new DepartmentService();

            if (!IsPostBack)
            {
                int i = Convert.ToInt32(Session["userid"].ToString());
                currentEmployee = new employee();
                currentEmployee = _EmployeeService.GetEmployeeDetailsByEmpID(i);

                if (currentEmployee!=null)
                {
                    int DepID = currentEmployee.EmployeeDepId ?? default(int);
                    currentDepartment = new department();
                    currentDepartment = _DepartmentService.GetdepartmentDetailsByDeptID(DepID);

                    lblDeptName.Text = currentDepartment.DepName;
                    txtDeptContactName.Text = currentDepartment.DepContactName;
                    txtDeptContactNum.Text = currentDepartment.DepContactNumber.ToString();
                    lblCurrentDeptRep.Text = currentDepartment.DepRepName;

                }
                else
                {
                    PanelError.Visible = true;
                }

                int curdeptID = currentEmployee.EmployeeDepId ?? default(int);
                employeeList = new List<employee>();
                employeeList = _EmployeeService.GetEmployeeDetailsByDeptID(curdeptID, i);

                if (employeeList!=null)
                {
                    ddlDeptRep.DataSource = employeeList;
                    ddlDeptRep.DataTextField = "EmployeeName";
                    ddlDeptRep.DataValueField = "EmployeeID";
                    ddlDeptRep.DataBind();
                }
                else
                {
                    PanelError.Visible = true;
                }
                ddlCollectionID.SelectedValue = currentDepartment.DepCollectionPointID.ToString();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            bool isTempHead = false;
            RegistrationService rser = new RegistrationService();
            string userId = HttpContext.Current.User.Identity.Name;
            isTempHead=rser.IsTempDepHead(userId);

            if ((HttpContext.Current.User.IsInRole("Department Head") != true) && (isTempHead != true))
            {
                Response.Redirect("/Presentation/Login.aspx");

            }

            _EmployeeService = new EmployeeService();
            _DepartmentService = new DepartmentService();
            _DelegationService = new DelegationService();

            if (!IsPostBack)
            {
                #region ** ClearAll
                ClearNewAllData();
                BtnEnable(false);
                #endregion

                #region ** DataBind for ddl with DeptID
                int LoginId = Convert.ToInt32(Session["userid"].ToString());

                currentEmp = new employee();
                currentEmp = _EmployeeService.GetEmployeeDetailsByEmpID(LoginId);

                int curdeptID = currentEmp.EmployeeDepId ?? default(int);
                employeeList = new List<employee>();
                employeeList = _EmployeeService.GetEmployeeDetailsByDeptID(curdeptID, LoginId);
                ddlEmpName.DataSource = employeeList;
                ddlEmpName.DataBind();
                #endregion

                searchDelegation();
            }
        }