Esempio n. 1
0
        private void Save(int intRequest)
        {
            int intItem    = Int32.Parse(lblItem.Text);
            int intNumber  = Int32.Parse(lblNumber.Text);
            int intService = Int32.Parse(lblService.Text);
            int intProject = oRequest.GetProjectNumber(intRequest);

            //if (intProject == -1)
            //    oServiceRequest.Update(intRequest, txtTitle.Text);
            oServiceEditor.AddRequest(intRequest, intService, intNumber, txtTitle.Text, Int32.Parse(radPriority.SelectedItem.Value), txtStatement.Text, DateTime.Now, DateTime.Now, (radExpediteYes.Checked ? 1 : 0));
            oServiceEditor.SaveForm(Request, intRequest, intService, intNumber, false, intEnvironment, dsn);

            //Reset the Resource Request and Workflow status for returned requests
            if (boolReqReturned == true)
            {
                int intReturned = 0;
                Int32.TryParse(lblReturned.Text, out intReturned);
                ResourceRequest oResourceRequest = new ResourceRequest(0, dsn);
                DataSet         dsRR             = oResourceRequest.GetRequestService(intRequest, intReturned, Int32.Parse(lblNumber.Text));
                if (dsRR.Tables[0].Rows.Count > 0)
                {
                    int intRRId = Int32.Parse(dsRR.Tables[0].Rows[0]["parent"].ToString());
                    oResourceRequest.updateResourceRequestReturnCompleted(Int32.Parse(lblReqReturnedId.Text));
                    DataSet dsRRWF = oResourceRequest.GetWorkflowsParent(intRRId);
                    oResourceRequest.UpdateStatusRequest(intRRId, 2);
                    foreach (DataRow dr in dsRRWF.Tables[0].Rows)
                    {
                        int intRRWFId = Int32.Parse(dr["id"].ToString());
                        oResourceRequest.UpdateWorkflowStatus(intRRWFId, 2, true);
                    }
                }
            }
            //Reset the Resource Request and approval process for denied requests
            if (boolReqDenied == true)
            {
                ResourceRequest oResourceRequest = new ResourceRequest(0, dsn);
                DataSet         dsResource       = oResourceRequest.GetAllService(intRequest, intService, Int32.Parse(lblNumber.Text));
                if (dsResource.Tables[0].Rows.Count > 0)
                {
                    int     intResource = Int32.Parse(dsResource.Tables[0].Rows[0]["rrid"].ToString());
                    DataSet dsRR        = oResourceRequest.Get(intResource);
                    if (dsRR.Tables[0].Rows.Count > 0)
                    {
                        oResourceRequest.UpdateStatusOverall(intResource, 2);
                        oService.UpdateSelectedApprove(intRequest, intService, Int32.Parse(lblNumber.Text), 0, 0, DateTime.Now, "");
                        if (oServiceRequest.NotifyApproval(intResource, intResourceRequestApprove, intEnvironment, "", dsnServiceEditor) == false)
                        {
                            oServiceRequest.NotifyTeamLead(intItem, intResource, intAssignPage, intViewPage, intEnvironment, "", dsnServiceEditor, dsnAsset, dsnIP, 0);
                        }
                    }
                }
            }
        }