コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AppCode.ApplicationHelper.ClearSqlPools();
            if (!IsPostBack)
            {
                string userID     = Session["UserSystemID"] as string;
                string userName   = Session["UserID"] as string;
                string userSource = Session["UserSource"] as string;
                string domainName = Session["DomainName"] as string;
                if (!string.IsNullOrEmpty(userID))
                {
                    AccUser.Text    = "Account Balance of " + userName;
                    accBalance.Text = "Account Balance: Rs. " + Helper.UserAccount.GetBalance(userID).ToString();
                }

                numJobs = FileServerPrintJobProvider.ProvidePrintJobs(Session["UserID"].ToString(), userSource, domainName).Rows.Count;
                if (numJobs <= 0)
                {
                    currentPage.Value = "CopyScan.aspx";
                }
                else
                {
                    currentPage.Value = "JobList.aspx";
                }
            }
        }
コード例 #2
0
        private void ProvideNumberOfFiles(out string printFileCount, out string printfileCountBW)
        {
            DataTable dtPrintJobsOriginalBW;
            DataTable dtPrintJobsOriginal;
            string    userSource = string.Empty;
            string    domainName = string.Empty;

            printfileCountBW = "0";
            printFileCount   = "0";
            if (Session["UserSource"] == null)
            {
                string deviceIpAddress = Request.Params["REMOTE_ADDR"].ToString();
                Session["UserSource"] = DataManagerDevice.ProviderDevice.Device.ProvideDeviceAuthenticationSource(deviceIpAddress);
                userSource            = Session["UserSource"] as string;
            }
            else
            {
                userSource = Session["UserSource"] as string;
            }

            if (string.IsNullOrEmpty(domainName))
            {
                DataSet dsCardDetails = DataManagerDevice.ProviderDevice.Users.ProvideUserDetails(Session["UserID"].ToString(), userSource);
                if (dsCardDetails.Tables[0].Rows.Count > 0)
                {
                    domainName = dsCardDetails.Tables[0].Rows[0]["USR_DOMAIN"].ToString();
                    string printJobDomainName = DataManagerDevice.ProviderDevice.ApplicationSettings.ProvideDomainName(domainName);
                    domainName = printJobDomainName;
                }
            }

            dtPrintJobsOriginalBW = FileServerPrintJobProvider.ProvidePrintJobsBW(Session["UserID"].ToString(), userSource, domainName);

            dtPrintJobsOriginal = FileServerPrintJobProvider.ProvidePrintJobs(Session["UserID"].ToString(), userSource, domainName);

            if (dtPrintJobsOriginalBW.Rows != null && dtPrintJobsOriginalBW.Rows.Count > 0)
            {
                printfileCountBW = dtPrintJobsOriginalBW.Rows.Count.ToString();
            }
            if (dtPrintJobsOriginal.Rows != null && dtPrintJobsOriginal.Rows.Count > 0)
            {
                printFileCount = dtPrintJobsOriginal.Rows.Count.ToString();
            }
        }
コード例 #3
0
        private void BindJoblist()
        {
            DataTable dtPrintJobsOriginal = new DataTable();

            dtPrintJobsOriginal.Locale = CultureInfo.InvariantCulture;
            userSource = Session["UserSource"] as string;
            if (Session["UserSource"] == null)
            {
                string deviceIpAddress = Request.Params["REMOTE_ADDR"].ToString();
                Session["UserSource"] = DataManagerDevice.ProviderDevice.Device.ProvideDeviceAuthenticationSource(deviceIpAddress);
                userSource            = Session["UserSource"] as string;
            }

            dtPrintJobsOriginal = FileServerPrintJobProvider.ProvidePrintJobs(Session["UserID"].ToString(), userSource, domainName);

            GridViewJobs.DataSource = dtPrintJobsOriginal;
            GridViewJobs.DataBind();
            GridViewJobs.Visible = true;
        }
コード例 #4
0
        private void DisplayJobList()
        {
            DataTable dtPrintJobsOriginal = FileServerPrintJobProvider.ProvidePrintJobs(Session["UserID"].ToString(), userSource, domainName);

            StringBuilder sbJobListControls = new StringBuilder();

            if (dtPrintJobsOriginal != null)
            {
                int jobsCount = dtPrintJobsOriginal.Rows.Count;
                for (int job = 0; job < jobsCount; job++)
                {
                    //sbJobListControls.Append(string.Format("<input id='menu{0}' type='text' value='{1}' />", job, dtPrintJobsOriginal.Rows[job]["NAME"].ToString()));
                    string jobID   = dtPrintJobsOriginal.Rows[job]["JOBID"].ToString();
                    string jobName = dtPrintJobsOriginal.Rows[job]["NAME"].ToString();
                    jobName = jobName.Replace('"', ' ');
                    jobName.Trim();
                    string value = "Job" + job.ToString();
                    sbJobListControls.Append(string.Format("<option title='{0}' value='{1}' icon='id_check' readonly='false'/>", jobName, jobID));
                }
                jobList = sbJobListControls.ToString();
            }
        }
コード例 #5
0
        /// <summary>
        /// Gets the job list.
        /// </summary>
        /// <remarks>
        /// Sequence Diagram:<br/>
        ///     <img src="SequenceDiagrams/SD_PrintRoverWeb.Administration.JobList.GetJobList.jpg"/>
        /// </remarks>
        private void GetJobList()
        {
            string selectedUser   = DropDownUser.SelectedValue;
            string selectedSource = DropDownListUserSource.SelectedValue;


            if (selectedSource == Constants.USER_SOURCE_DM)
            {
                selectedSource = Constants.USER_SOURCE_AD;
            }

            if (IsServiceLive())
            {
                DataTable dtJobList = null;
                if (DropDownListUserSource.SelectedValue != "DB")
                {
                    domainName = DropDownListDomainName.SelectedValue;
                }
                if (selectedUser.Equals("-1"))
                {
                    dtJobList = FileServerPrintJobProvider.ProvideAllPrintJobs(selectedSource, domainName);
                }
                else
                {
                    dtJobList = FileServerPrintJobProvider.ProvidePrintJobs(selectedUser, selectedSource, domainName);
                }
                int slno = 0;
                if (dtJobList != null)
                {
                    LabelNoJobs.Visible = false;
                    for (int row = 0; row < dtJobList.Rows.Count; row++)
                    {
                        TableRow trJoblist = new TableRow();
                        AppController.StyleTheme.SetGridRowStyle(trJoblist);

                        TableCell tdSlNo = new TableCell();
                        tdSlNo.Text            = Convert.ToString(slno + 1, CultureInfo.CurrentCulture);
                        tdSlNo.HorizontalAlign = HorizontalAlign.Left;

                        TableCell tdUsername = new TableCell();
                        tdUsername.Text     = dtJobList.Rows[row]["USERID"].ToString();
                        tdUsername.CssClass = "GridLeftAlign";
                        tdUsername.Attributes.Add("onclick", "togall(" + slno + ")");

                        TableCell tdJobName = new TableCell();
                        string    filename  = dtJobList.Rows[row]["NAME"].ToString();
                        filename = filename.Replace('"', ' ');
                        filename.Trim();
                        tdJobName.Text = filename;
                        tdJobName.Attributes.Add("onclick", "togall(" + slno + ")");
                        tdJobName.CssClass = "GridLeftAlign";
                        TableCell tdcreateddate = new TableCell();

                        DateTime jobDate        = Convert.ToDateTime(dtJobList.Rows[row]["DATE"]);
                        string   currentCulture = Session["SelectedCulture"] as string;
                        tdcreateddate.Text = string.Format(CultureInfo.CreateSpecificCulture(currentCulture), "{0:g}", jobDate);

                        tdcreateddate.CssClass = "GridLeftAlign";
                        tdcreateddate.Attributes.Add("onclick", "togall(" + slno + ")");
                        TableCell tdJobcheck = new TableCell();
                        string    jobId      = dtJobList.Rows[row]["JOBID"].ToString();
                        string    userId     = dtJobList.Rows[row]["USERID"].ToString();
                        if (isReleaseJobsFromWeb.ToLower() == "yes")
                        {
                            tdJobcheck.Text = "<input type='checkbox' name='__JOBLIST' value='" + jobId + "' onclick='javascript:ValidateSelectedCount()'/>";
                        }
                        else
                        {
                            tdJobcheck.Text = "<input type='checkbox' name='__JOBLIST' value='" + jobId + "," + userId + "' onclick='javascript:ValidateSelectedCount()'/>";
                        }

                        tdJobcheck.HorizontalAlign = HorizontalAlign.Left;

                        trJoblist.Cells.Add(tdJobcheck);
                        trJoblist.Cells.Add(tdSlNo);
                        trJoblist.Cells.Add(tdUsername);
                        trJoblist.Cells.Add(tdcreateddate);
                        trJoblist.Cells.Add(tdJobName);
                        TableJobList.Rows.Add(trJoblist);
                        slno++;
                    }
                    HiddenJobsCount.Value = dtJobList.Rows.Count.ToString();
                }

                if (slno == 0)
                {
                    TableCellDelete.Visible = false;
                    //ISplit.Visible = false;
                    //TableCell7.Visible = false;
                    //ImageButtonRefresh.Visible = false;
                    //TableCell9.Visible = false;
                    PanelMainData.Visible       = false;
                    TableWarningMessage.Visible = true;
                }
                else
                {
                    PanelMainData.Visible       = true;
                    TableWarningMessage.Visible = false;
                    TableCellDelete.Visible     = true;
                    // ISplit.Visible = true;
                    //TableCell7.Visible = true;
                    //ImageButtonRefresh.Visible = true;
                    //TableCell9.Visible = true;
                }
                recordsCount = slno;
            }
            else
            {
                TableCellDelete.Visible = false;
                //ISplit.Visible = false;
                //TableCell7.Visible = false;
                //ImageButtonRefresh.Visible = false;
                //TableCell9.Visible = false;
                string serverMessage = Localization.GetServerMessage("", Session["selectedCulture"] as string, "SERVICE_NOTRESPONDING");
                GetMasterPage().DisplayActionMessage(AppLibrary.MessageType.Error.ToString(), serverMessage, null);
            }
        }