示例#1
0
        protected void btnSave_Click2(object sender, EventArgs e)
        {
            WorkflowsDTO workflowsDTO = new WorkflowsDTO(txtboxLanguage.Text.Trim(), txtboxCode.Text.Trim(), txtboxWFName.Text.Trim(),
                                                         chkboxInactive.Checked);
            WorkflowsService workflowsService = new WorkflowsService();
            bool             workflowExists   = false;

            try
            {
                workflowsService.SaveWorkflow(workflowsDTO);
            }catch (DuplicateNameException ex) {
                workflowExists = true;
            }

            if (workflowExists)
            {
                lblResult.Text = "Workflow name already exists. Try using a different name";
                btnAdd.Enabled = true;
                txtboxWFName.Focus();
            }
            else
            {
                lblResult.Text    = "Your Workflow is being Saved";
                btnAdd.Enabled    = true;
                txtboxCode.Text   = "";
                txtboxWFName.Text = "";
            }
        }
        protected void btnShowALL_Click(object sender, EventArgs e)
        {
            WorkflowsService        workflowsService = new WorkflowsService();
            List <ViewWorkflowsDTO> workflowsDtos    = workflowsService.SearchWorkflowName(txtboxName.Text = "");

            //List<ViewWorkflowsDTO> workflowsDtos = workflowsService.GridEditSelectWorkflow();
            GridViewSelectWorkflow.PageIndex = 0;

            dt = new DataTable();
            Populate_Grid(workflowsDtos);
        }
        protected void GridViewSteps_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "delete_click")
            {
                //int RowIndex = Convert.ToInt32((e.CommandArgument).ToString());
                ////GridViewRow gvr = (GridViewRow)(((ButtonField)e.CommandSource).);
                //dt = new DataTable();
                //dt.Columns.Add("Str", typeof(string));

                //dt = (DataTable) ViewState["dtTable"];


                //ViewState["dtTable"]= dt;
                //GridViewSteps.DataSource = dt;
                //GridViewSteps.DataBind();

                DataTable dt = (DataTable)ViewState["dtTable"];

                int index = Convert.ToInt32(e.CommandArgument);

                DataRow row    = dt.Rows[index];
                String  stepId = row["Id"].ToString();
                //GridViewRow row = GridViewSteps.Rows[index];
                //String stepId = Server.HtmlDecode(row.Cells[2].Text);
                WorkflowsService workflowsService = new WorkflowsService();
                workflowsService.DeleteWorkflowStep(txtboxName.Text, stepId);
                dt.Rows.RemoveAt(index);
                GridViewSteps.DataSource = dt;
                GridViewSteps.DataBind();
                ViewState["dtTable"] = dt;
            }
            else
            {
                Response.Write("Cant");
            }
            if (e.CommandName == "package_click")
            {
                // Retrieve the row index stored in the
                // CommandArgument property.
                int index = Convert.ToInt32(e.CommandArgument);

                // Retrieve the row that contains the button
                // from the Rows collection.
                GridViewRow row        = GridViewSteps.Rows[index];
                ListItem    WfStepName = new ListItem();
                WfStepName.Text = Server.HtmlDecode(row.Cells[1].Text);
                String WorkflowName = Server.HtmlDecode(txtboxName.Text);
                String stepId       = Server.HtmlDecode(row.Cells[2].Text);
                Response.Redirect("EDITWorkflowTask.aspx?wfname=" + WfStepName + "&workflowname=" + WorkflowName + "&stepId=" + stepId);
            }
            else
            {
            }
        }
示例#4
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            String                   searchBy           = dropDownSearch.SelectedValue.ToString();
            String                   filterBy           = txtBoxFilterBy.Text.ToString();
            WorkflowsService         wfservice          = new WorkflowsService();
            List <EmployeeSearchDTO> employeesearchDtos = wfservice.SearchEmployee(searchBy, filterBy);

            ListBox1.DataSource     = employeesearchDtos;
            ListBox1.DataTextField  = "id";
            ListBox1.DataValueField = "name";
            ListBox1.DataBind();
        }
示例#5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string language = Session["mylang"].ToString();

            check.LanguageCheck(language);

            base.InitializeCulture();

            WorkflowsService        workflowsService = new WorkflowsService();
            List <ViewWorkflowsDTO> workflowsDtos    = workflowsService.SearchWorkflowName(txtboxName.Text);

            //List<ViewWorkflowsDTO> workflowsDtos = workflowsService.GridEditSelectWorkflow();

            dt = new DataTable();
            Populate_Grid(workflowsDtos);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            string language = Session["mylang"].ToString();

            check.LanguageCheck(language);

            base.InitializeCulture();


            btnAdd.Enabled  = false;
            btnEdit.Enabled = false;
            //btnReturn.Enabled = false;
            ////accessing workflow name
            wfname = Request.QueryString["WfName"];
            //txtboxWFName.Text = wfname;
            //txtboxWFName.Text = Session["WfName"].ToString();
            // txtboxWFName.Text = Request.Cookies["WfName"].Value;

            if (!IsPostBack)
            {
                txtboxWFName.Text = wfname;
                WorkflowsService workflowsService = new WorkflowsService();
                EditWorkflowsDTO editworkflowsDto = workflowsService.EditWorkflow(wfname);
                txtboxLanguage.Text      = editworkflowsDto.Language;
                txtboxCode.Text          = editworkflowsDto.Code;
                CheckBoxInactive.Checked = editworkflowsDto.Inactive;
            }
            else
            {
            }

            // //accessing language
            // lang= Session["myLang"].ToString();
            // txtboxLanguage.Text = lang;

            //// accessing code from database


            //EditWorkflowsDTO editworkflowsDto = new EditWorkflowsDTO();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            string language = Session["mylang"].ToString();

            check.LanguageCheck(language);

            base.InitializeCulture();
            if (!Page.IsPostBack)
            {
                SetInitialRow();
            }


            workflowname       = Request.QueryString["wfname"];
            hiddenWFName.Value = workflowname;
            //txtboxWorkflow.Text = workflowname;
            stepname             = Request.QueryString["stepname"];
            hiddenStepName.Value = stepname;
            // txtboxStepName.Text = stepname;

            stepID             = Request.QueryString["stepId"];
            hiddenStepID.Value = stepID;


            check.LanguageCheck(language);

            base.InitializeCulture();
            WorkflowsService workflowsService = new WorkflowsService();

            LoadWFTaskChkListDTO dto = workflowsService.LoadWFTaskCHklist(workflowname, stepID);



            txtboxLanguage.Text = dto.language;
            txtboxWFCode.Text   = dto.workflowCode;
            txtboxWFName.Text   = dto.workflowName;
            txtboxStepNo.Text   = dto.stepNo.ToString();
            txtboxStepName.Text = stepname;
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string stepID;

            dt = new DataTable();
            dt.Columns.Add("Str", typeof(string));
            dt.Columns.Add("Id", typeof(string));
            if (ViewState["dtTable"] != null)
            {
                dt = (DataTable)ViewState["dtTable"];
            }

            WorkflowsService workflowsService = new WorkflowsService();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DataRow row = dt.Rows[i];
                stepID = row["Id"].ToString();

                workflowsService.SaveWorkflowSteps(txtboxName.Text, stepID, i);
            }
            lbltxt.Text = "Your Steps are being Saved";
        }
示例#9
0
        protected void btnSave_Click1(object sender, EventArgs e)
        {
            WorkflowsService workflowsService = new WorkflowsService();

            if (Request.QueryString["workflowFormId"] == null)
            {
                WorkflowTaskFormsDTO workflowTaskFormsDto = new WorkflowTaskFormsDTO(txtboxSubEmpID.Text.Trim(),
                                                                                     txtboxSubEmpName.Text.Trim(), txtboxFrom.Text.Trim(), HiddenTO.Value.ToString(), HiddenCC.Value.Trim(), HiddenBCC.Value.Trim(),
                                                                                     txtboxSubject.Text.Trim(), txtboxMessage.Text.Trim(), HiddenEscTO.Value.Trim(), txtboxEscalateAfter.Text,
                                                                                     txtboxCompleted.Text.Trim(), txtboxAdmin.Text.Trim(),
                                                                                     stepID, txtboxWFName.Text.Trim());

                workflowsService.SaveTaskForm(workflowTaskFormsDto);
                lblMessage.Text = "Your Form is being Saved!";
            }
            else
            {
                string wfFormId = Request.QueryString["workflowFormId"];
                WorkflowTaskFormsDTO workflowTaskFormsDto_Update = new WorkflowTaskFormsDTO(HiddenTO.Value.ToString(), HiddenCC.Value.Trim(), HiddenBCC.Value.Trim(),
                                                                                            txtboxSubject.Text.Trim(), txtboxMessage.Text.Trim(), HiddenEscTO.Value.Trim(), txtboxEscalateAfter.Text, wfFormId);

                workflowsService.UpdateTaskForm(workflowTaskFormsDto_Update);
            }
        }
        protected void btnGenerate_Click(object sender, EventArgs e)
        {
            String workflow_name_default = ddlWorkflowName.SelectedValue;
            // String workflow_status = ddlWorkflowStatus.SelectedValue;
            String subject_emp_name = ddlSubjectEmployee.SelectedValue;
            String RBSelect         = cbReport1.ToString();

            WorkflowReportDTO workflow_reportDTO = new WorkflowReportDTO();

            WorkflowsService workflowsService = new WorkflowsService();

            workflowsService.Workflow_Report(workflow_name_default, subject_emp_name, RBSelect);


            DateTime d = new DateTime();
            // workflow_reportDTO.
            String created             = workflow_reportDTO.Created;
            String createdby           = workflow_reportDTO.Created_By;
            String subject_Employee_Id = workflow_reportDTO.Subject_Employee_Id;
            String from_Employee_Name  = workflow_reportDTO.From_Employee_Name;
            String employee_To         = workflow_reportDTO.Escalate_To;
            String employeecc          = workflow_reportDTO.Employee_CC;
            String employeebcc         = workflow_reportDTO.Employee_BCC;
            String subject             = workflow_reportDTO.Subject;
            String messagebox          = workflow_reportDTO.Message_Box;
            String escalateTo          = workflow_reportDTO.Escalate_To;
            String escalateAfter       = workflow_reportDTO.Escalate_After;
            String signoff             = workflow_reportDTO.Sign_Off;
            String cancelBy            = workflow_reportDTO.Cancel_By;
            String step_Screen_id      = workflow_reportDTO.Step_Screen_Id;
            String escalateTimestamp   = workflow_reportDTO.Escalate_Timestamp;
            String signOffTimestamp    = workflow_reportDTO.Signoff_Timestamp;
            String cancelTimestamp     = workflow_reportDTO.Cancel_Timestamp;



            // String s = cmd.CommandText;

            //Printing PDF file
            try
            {
                Document  pdfDoc    = new Document(PageSize.A4, 25, 10, 25, 10);
                PdfWriter pdfWriter = PdfWriter.GetInstance(pdfDoc, Response.OutputStream);
                pdfDoc.Open();

                pdfWriter.CloseStream = false;



                var titleFont         = FontFactory.GetFont("Arial", 18, Font.BOLD);
                var subTitleFont      = FontFactory.GetFont("Arial", 14, Font.BOLD);
                var boldTableFont     = FontFactory.GetFont("Arial", 12, Font.BOLD);
                var endingMessageFont = FontFactory.GetFont("Arial", 10, Font.ITALIC);
                var bodyFont          = FontFactory.GetFont("Arial", 12, Font.NORMAL);


                ////Logo Header
                var logo = iTextSharp.text.Image.GetInstance(Server.MapPath("Images/logo.gif"));
                logo.SetAbsolutePosition(0, 800);
                pdfDoc.Add(logo);



                // Read in the contents of the Receipt.htm file...
                string contents = File.ReadAllText(Server.MapPath("~/HTMLTemplate/Report.htm"));

                // Replace the placeholders with the user-specified text

                //contents = contents.Replace("[TOTALPRICE]", Convert.ToDecimal(txtTotalPrice.Text).ToString("c"));
                //contents = contents.Replace("[ORDERDATE]", DateTime.Now.ToShortDateString());



                contents = contents.Replace("[workflowname]", workflow_name_default);
                contents = contents.Replace("[created]", created);
                //contents = contents.Replace("[workflowstatus]", );
                contents = contents.Replace("[createdby]", createdby);
                contents = contents.Replace("[subjectid]", subject_Employee_Id);
                contents = contents.Replace("[stepname]", step_Screen_id);
                //contents = contents.Replace("[lastupdated]", );
                //contents = contents.Replace("[stepstatus]", );
                //contents = contents.Replace("[updatedby]", );
                //contents = contents.Replace("[tasknumber]", );
                contents = contents.Replace("[messagefrom]", from_Employee_Name);
                contents = contents.Replace("[messageto]", employee_To);
                contents = contents.Replace("[messagecc]", employeecc);
                contents = contents.Replace("[messagebcc]", employeebcc);
                contents = contents.Replace("[messagesubject]", subject);
                //contents = contents.Replace("[taskform]", );
                //contents = contents.Replace("[taskformstatus]", );
                contents = contents.Replace("[escalateto]", escalateTo);
                contents = contents.Replace("[signoff]", signoff);
                contents = contents.Replace("[cancel]", cancelBy);
                contents = contents.Replace("[MessageBox]", messagebox);
                contents = contents.Replace("[EscalateAfter]", escalateAfter);
                contents = contents.Replace("[EscalateTimestamp]", escalateTimestamp);
                contents = contents.Replace("[SignoffTimestamp]", signOffTimestamp);
                contents = contents.Replace("[CancelTimestamp]", cancelTimestamp);



                // Step 4: Parse the HTML string into a collection of elements...
                var parsedHtmlElements = HTMLWorker.ParseToList(new StringReader(contents), null);

                // Enumerate the elements, adding each one to the Document...
                foreach (var htmlElement in parsedHtmlElements)
                {
                    pdfDoc.Add(htmlElement as IElement);
                }


                pdfDoc.Close();
                Response.Buffer      = true;
                Response.ContentType = "application/pdf";
                Response.AddHeader("content-disposition", "attachment;filename=Report.pdf");
                Response.Cache.SetCacheability(HttpCacheability.NoCache);
                Response.Write(pdfDoc);
                Response.End();
            }
            catch (Exception ex)
            { Response.Write(ex.Message); }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            string language = Session["mylang"].ToString();

            check.LanguageCheck(language);

            base.InitializeCulture();
            wfname             = Request.QueryString["WfName"];
            txtboxName.Text    = wfname;
            txtboxName.Enabled = false;

            // Response.Write(language);

            if (language == "en-US")
            {
                c = 'e';
            }

            else
            {
                c = 'f';
            }



            if (!Page.IsPostBack)
            {
                //lbltxt.Text = "1st time";


                DataTable dt_module = fill_module(c);
                DropDownModule.DataSource     = dt_module;
                DropDownModule.DataTextField  = "Str";
                DropDownModule.DataValueField = "Id";
                DropDownModule.DataBind();

                DataTable dt_category = fill_category(c);
                DropDownCategory.DataSource     = dt_category;
                DropDownCategory.DataTextField  = "Str";
                DropDownCategory.DataValueField = "Id";
                DropDownCategory.DataBind();
                WorkflowsService workflowsService = new WorkflowsService();

                List <LoadWorkflowStepsDTO> wfsdto = workflowsService.LoadWorkflowStepsDTO(txtboxName.Text);
                if (wfsdto.Count > 0)
                {
                    DataTable dtsteps = new DataTable();
                    dtsteps.Columns.Add("Str", typeof(string));
                    dtsteps.Columns.Add("Id", typeof(string));

                    foreach (LoadWorkflowStepsDTO wfs in wfsdto)
                    {
                        DataRow row = dtsteps.NewRow();
                        row["Id"]  = wfs.step_Id;
                        row["Str"] = wfs.step_Screen_Name;
                        dtsteps.Rows.Add(row);
                    }

                    GridViewSteps.DataSource = dtsteps;

                    GridViewSteps.DataBind();
                    GridViewSteps.Columns[2].Visible = false;

                    ViewState["dtTable"] = dtsteps;
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            string language = Session["mylang"].ToString();

            check.LanguageCheck(language);

            base.InitializeCulture();
            if (Request.QueryString["workflowname"] != null)
            {
                workflowname        = Request.QueryString["workflowname"];
                txtboxWorkflow.Text = workflowname;
            }
            if (Request.QueryString["wfname"] != null)
            {
                stepname            = Request.QueryString["wfname"];
                txtboxStepName.Text = stepname;
            }
            if (Request.QueryString["stepId"] != null)
            {
                stepId = Request.QueryString["stepId"];
                //lbl.Text = stepId;
            }


            if (Request.QueryString["wfname1"] != null)
            {
                workflowname        = Request.QueryString["wfname1"];
                txtboxWorkflow.Text = workflowname;
            }
            if (Request.QueryString["stepname"] != null)
            {
                stepname            = Request.QueryString["stepname"];
                txtboxStepName.Text = stepname;
            }

            // if (Request.QueryString["stepid1"] != null)
            //{
            //    stepId = Request.QueryString["stepid1"];
            //    lbl.Text = stepId;
            //}

            WorkflowsService           wfservice      = new WorkflowsService();
            List <LoadWorkflowTaskDTO> loadWFTaskDtos = wfservice.LoadTask(stepId, workflowname);

            if (loadWFTaskDtos.Count > 0)
            {
                DataTable dtsteps = new DataTable();
                dtsteps.Columns.Add("Name", typeof(string));
                dtsteps.Columns.Add("Id", typeof(string));

                foreach (LoadWorkflowTaskDTO wfs in loadWFTaskDtos)
                {
                    DataRow row = dtsteps.NewRow();
                    row["Id"]   = wfs.wftask_Id;
                    row["Name"] = wfs.emp_Name;
                    dtsteps.Rows.Add(row);
                }

                GridViewWFStepsNames.DataSource = dtsteps;

                GridViewWFStepsNames.DataBind();
                GridViewWFStepsNames.Columns[1].Visible = false;

                ViewState["dtTable"] = dtsteps;
            }
        }
示例#13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string language = Session["mylang"].ToString();

            workflowname = Request.QueryString["wfname"];
            //hiddenWFName.Value = workflowname;
            stepname = Request.QueryString["stepname"];
            //hiddenStepName.Value = stepname;
            stepID = Request.QueryString["stepId"];
            //hiddenStepID.Value = stepID;

            if (!IsPostBack)
            {
                stepID             = Request.QueryString["stepId"];
                hiddenStepID.Value = stepID;


                check.LanguageCheck(language);

                base.InitializeCulture();
                WorkflowsService workflowsService = new WorkflowsService();

                LoadTaskformDTO dto = workflowsService.LoadTaskForm(workflowname, stepID);



                txtboxLanguage.Text = dto.language;
                txtboxWFCode.Text   = dto.workflowCode;
                txtboxWFName.Text   = dto.workflowName;
                txtboxStepNo.Text   = dto.stepNo.ToString();
                txtboxStepName.Text = stepname;


                if (Request.QueryString["workflowFormId"] != null)
                {
                    txtboxTo.Text = Request.QueryString["empName"];
                    String          workFlowId       = Request.QueryString["workflowFormId"];
                    LoadTaskformDTO loadTaskFormDtos = workflowsService.LoadWFTaskformtoEdit(workFlowId);

                    txtboxLanguage.Text = loadTaskFormDtos.language;
                    txtboxStatus.Text   = "";

                    txtboxStepName.Text    = stepname;
                    txtboxCreated.Text     = loadTaskFormDtos.created;
                    txtboxLastUpdated.Text = loadTaskFormDtos.updated;
                    txtboxFrom.Text        = loadTaskFormDtos.fromEmp;

                    txtboxCc.Text            = loadTaskFormDtos.cc;
                    txtboxBcc.Text           = loadTaskFormDtos.bcc;
                    txtboxSubEmpName.Text    = loadTaskFormDtos.subEmpName;
                    txtboxMessage.Text       = loadTaskFormDtos.msgBox;
                    txtboxEscalateTO.Text    = loadTaskFormDtos.escToName;
                    txtboxEscalateAfter.Text = loadTaskFormDtos.escalateAfter;
                    txtboxCompleted.Text     = loadTaskFormDtos.signOff;
                    HiddenTO.Value           = loadTaskFormDtos.Employee_To_Id;
                    HiddenCC.Value           = loadTaskFormDtos.Employee_CC_Id;
                    HiddenBCC.Value          = loadTaskFormDtos.Employee_BCC_Id;
                    HiddenEscTO.Value        = loadTaskFormDtos.Escalate_To_Id;
                }
            }
            btnEmployeeSearch1.Attributes["onclick"] =
                string.Format("showWindow( 'EmployeeSearch.aspx', '{0}', '{1}','{2}','{3}','{4}' );",
                              workflowname, stepname, stepID, txtboxTo.ClientID, HiddenTO.ClientID);
            btnEmployeeSearch2.Attributes["onclick"] =
                string.Format("showWindow( 'EmployeeSearch.aspx', '{0}', '{1}','{2}','{3}','{4}' );",
                              workflowname, stepname, stepID, txtboxCc.ClientID, HiddenCC.ClientID);
            btnEmployeeSearch3.Attributes["onclick"] =
                string.Format("showWindow( 'EmployeeSearch.aspx', '{0}', '{1}','{2}','{3}','{4}' );",
                              workflowname, stepname, stepID, txtboxBcc.ClientID, HiddenBCC.ClientID);
            btnEmployeeSearch.Attributes["onclick"] =
                string.Format("showWindow( 'EmployeeSearch.aspx', '{0}', '{1}','{2}','{3}','{4}' );",
                              workflowname, stepname, stepID, txtboxEscalateTO.ClientID, HiddenEscTO.ClientID);
        }