protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack == false)
            {
                string id = Request.QueryString["RequestID"];

                lblResourceAllocation.Text = id;
                lblAccount.Text            = Request.QueryString["AccountName"];
                lblProcessName.Text        = Request.QueryString["ProcessName"];

                List <CPT_ResourceMaster> lstdetils = new List <CPT_ResourceMaster>();
                lstdetils = (List <CPT_ResourceMaster>)Session["UserDetails"];

                AllocateResourceBL displaydemand = new AllocateResourceBL();
                displaydemand.AllocateResourceByID(rptResourceAllocation, id, lstdetils[0].RolesID);

                foreach (RepeaterItem item in rptResourceAllocation.Items)
                {
                    float NoOfRes          = 0;
                    float NoOfAllocate     = 0;
                    Label lblNoOfResources = (Label)item.FindControl("lblNoOfResources");
                    Label lblAllocated     = (Label)item.FindControl("Allocated");
                    Label lblRole          = (Label)item.FindControl("RoleName");
                    NoOfRes      = float.Parse(lblNoOfResources.Text);
                    NoOfAllocate = float.Parse(lblAllocated.Text);
                    if (NoOfRes == NoOfAllocate)
                    {
                        Button btn = (Button)item.FindControl("btnAlign");
                        btn.Enabled = false;
                    }
                }
            }
        }
示例#2
0
        public void BindValue()
        {
            if (!string.IsNullOrEmpty(Request.QueryString["RequestID"]))
            {
                requestID = Request.QueryString["RequestID"].Trim();
            }



            CPT_ResourceDemand cPT_ResourceDemand = new CPT_ResourceDemand();

            cPT_ResourceDemand.RequestID = requestID;
            ResourceDemandBL   resource = new ResourceDemandBL();
            CPT_ResourceDemand demand   = new CPT_ResourceDemand();

            demand.RequestID = requestID;
            List <CPT_ResourceDemand> lst = resource.ViewResourceDemand(demand);

            reqID.Text        = lst[0].RequestID;
            salesStageDD.Text = lst[0].SalesStageID.ToString();
            accNameDD.Text    = lst[0].AccountID.ToString();
            proccName.Text    = lst[0].ProcessName;
            oppTypeDD.Text    = lst[0].OpportunityID.ToString();
            List <int> regionIDs = ResourceDemandBL.getRegionID(lst[0].AccountID);

            regionID = regionIDs[0];
            regionNameDD.Items.FindByValue(regionID.ToString()).Selected = true;


            ResourceDetailsBL.ViewResourceDetails(rptResourceDetails, requestID);
            AllocateResourceBL.viewResourceMaping(rptMapping, requestID);
        }
        public void SearchAvailability()
        {
            string id = Request.QueryString["RequestID"];

            lblSuggestions.Text = id;
            AllocateResourceBL rbl = new AllocateResourceBL();

            rbl.getFreeEmployee(rptSuggestions, roleID, EndDate, skillID, StartDate);
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                string RequestID             = Request.QueryString["RequestID"];
                string RequesterEmailID      = AllocateResourceBL.GetRequesterEmail(RequestID);
                CPT_AllocateResource details = new CPT_AllocateResource();
                CPT_ResourceMaster   empID   = new CPT_ResourceMaster();
                AllocateResourceBL   rbl     = new AllocateResourceBL();

                foreach (var item in name)
                {
                    details.ResourceID      = Convert.ToInt32(item);
                    details.RequestDetailID = requestDetailID;
                    details.RequestID       = RequestID;
                    details.AccountID       = AllocateResourceBL.getAccountID(details.RequestID.ToString());
                    details.StartDate       = Convert.ToDateTime(StartDate);
                    details.EndDate         = Convert.ToDateTime(EndDate);
                    empID.EmployeeMasterID  = Convert.ToInt32(item);
                    details.RoleMasterID    = roleID;
                    details.Released        = false;
                    details.IsDeployed      = false;
                    details.Utilization     = float.Parse(ViewState["utilization"].ToString());

                    string acnt = rbl.getAccountByID(details.AccountID);
                    List <CPT_ResourceMaster> lst = rbl.getMailDetails(Convert.ToInt32(item));
                    string name  = lst[0].EmployeetName;
                    string email = lst[0].Email;
                    rbl.Insert(details);
                    rbl.updateMap(empID);
                    sendConfirmation(name, email, RequesterEmailID, acnt, details.StartDate, details.EndDate);
                }
                Response.Redirect("ResourceMapping.aspx");
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }