private void CargarTablasDeHorarios()
        {
            this.tblCal.Controls.Clear();
            System.Web.UI.WebControls.TableRow Fila = new System.Web.UI.WebControls.TableRow();

            try
            {
                ArrayList aSalas = LicenciaWebex.ListaLicenciasWebex();
                for (int x = 0; x < aSalas.Count; x++)
                {
                    LicenciaWebex objLW = (LicenciaWebex)aSalas[x];

                    if (x == 0)
                    {
                        CrearHorario(Fila, "Hora" + x.ToString(), objLW.t148_denominacion, objLW.t148_idlicenciawebex, true);
                    }
                    else
                    {
                        CrearHorario(Fila, "Hora" + x.ToString(), objLW.t148_denominacion, objLW.t148_idlicenciawebex, false);
                    }
                }
            }
            catch (Exception ex)
            {
                sErrores += Errores.mostrarError("Error al cargar los horarios:", ex);
            }

            System.Web.UI.Control Tabla = this.divContenido.FindControl("tblCal");
            Tabla.Controls.Add(Fila);
        }
Beispiel #2
0
 static void diuFIhx(System.Runtime.InteropServices.SEHException Ckwi, System.Web.UI.WebControls.FormViewPageEventHandler pmXXulx, System.Web.ProcessInfo UXOnKIG, System.Windows.Forms.DataGridViewAutoSizeColumnModeEventArgs OcXocf)
 {
     System.Web.UI.WebControls.FontUnitConverter     zMWbe                = new System.Web.UI.WebControls.FontUnitConverter();
     System.Web.Security.DefaultAuthenticationModule ceJjPs               = new System.Web.Security.DefaultAuthenticationModule();
     System.Web.UI.ObjectStateFormatter YrZnHYu                           = new System.Web.UI.ObjectStateFormatter();
     System.Data.SqlTypes.TypeRealSchemaImporterExtension JNYL            = new System.Data.SqlTypes.TypeRealSchemaImporterExtension();
     System.CodeDom.CodeThrowExceptionStatement           KSQko           = new System.CodeDom.CodeThrowExceptionStatement();
     System.Web.UI.WebControls.TableRow          kTn                      = new System.Web.UI.WebControls.TableRow();
     System.TypeInitializationException          kWOTt                    = new System.TypeInitializationException("DnJvbUmEBb", new System.Exception());
     System.Web.UI.WebControls.HotSpotCollection TlZ                      = new System.Web.UI.WebControls.HotSpotCollection();
     System.Web.UI.HtmlControls.HtmlMeta         bYWLMKb                  = new System.Web.UI.HtmlControls.HtmlMeta();
     System.Threading.ThreadStateException       PDolU                    = new System.Threading.ThreadStateException();
     System.Data.OleDb.OleDbEnumerator           NxZR                     = new System.Data.OleDb.OleDbEnumerator();
     System.Runtime.InteropServices.SEHException nPiw                     = new System.Runtime.InteropServices.SEHException("lwdiEhLZzaWCQz");
     System.Web.UI.WebControls.XmlDataSource     qCy                      = new System.Web.UI.WebControls.XmlDataSource();
     System.Web.UI.WebControls.WebParts.PersonalizationDictionary HMgdxBz = new System.Web.UI.WebControls.WebParts.PersonalizationDictionary();
     System.Net.Configuration.SmtpSpecifiedPickupDirectoryElement xFdgY   = new System.Net.Configuration.SmtpSpecifiedPickupDirectoryElement();
     System.CodeDom.CodeIterationStatement tOAyBU                         = new System.CodeDom.CodeIterationStatement();
     System.Web.UI.WebControls.Content     FKcstoM                        = new System.Web.UI.WebControls.Content();
     System.Resources.MissingSatelliteAssemblyException shC               = new System.Resources.MissingSatelliteAssemblyException("MVTEvazwfl", new System.Exception());
     System.CodeDom.CodeNamespace                       sBd               = new System.CodeDom.CodeNamespace("CBDlENnQEYaGMNaJF");
     System.Security.Policy.Publisher                   CXUTb             = new System.Security.Policy.Publisher(new System.Security.Cryptography.X509Certificates.X509Certificate());
     System.Windows.Forms.LinkClickedEventArgs          UzGdiZc           = new System.Windows.Forms.LinkClickedEventArgs("cxLJ");
     System.Web.UI.WebControls.FormViewUpdatedEventArgs jYKx              = new System.Web.UI.WebControls.FormViewUpdatedEventArgs(497644070, new System.Exception());
     System.Web.Configuration.XhtmlConformanceSection   IJvBQNF           = new System.Web.Configuration.XhtmlConformanceSection();
 }
        public static System.IO.StringWriter CreateExcel_HTML(
            DataTable Dt
            , ClsExcel_Columns Columns)
        {
            System.IO.StringWriter Sw = new System.IO.StringWriter();
            System.Web.UI.HtmlTextWriter Htw = new System.Web.UI.HtmlTextWriter(Sw);
            System.Web.UI.WebControls.Table Tb = new System.Web.UI.WebControls.Table();

            System.Web.UI.WebControls.TableRow Tbr_Header = new System.Web.UI.WebControls.TableRow();
            foreach (ClsExcel_Columns.Str_Columns? Obj in Columns.pObj)
            {
                System.Web.UI.WebControls.TableCell Tbc = new System.Web.UI.WebControls.TableCell();
                Tbc.Text = Obj.Value.FieldDesc;
                Tbc.Width = Obj.Value.Width;
                Tbr_Header.Cells.Add(Tbc);
            }

            Tb.Rows.Add(Tbr_Header);

            foreach (DataRow Dr in Dt.Rows)
            {
                System.Web.UI.WebControls.TableRow Tbr = new System.Web.UI.WebControls.TableRow();
                foreach (ClsExcel_Columns.Str_Columns? Obj in Columns.pObj)
                {
                    System.Web.UI.WebControls.TableCell Tbc = new System.Web.UI.WebControls.TableCell();
                    Tbc.Text = Dr[Obj.Value.FieldName].ToString();
                    Tbr.Cells.Add(Tbc);
                }
                Tb.Rows.Add(Tbr);
            }
            Tb.RenderControl(Htw);
            return Sw;
        }
Beispiel #4
0
        // name of document is a link button if document is published
        public static System.Web.UI.WebControls.HyperLink namelink(object sender)
        {
            var eventlink = new System.Web.UI.WebControls.HyperLink();

            System.Web.UI.WebControls.TableCell orgLinkText = ((System.Web.UI.WebControls.TableCell)sender);
            var eventName = Convert.ToString(orgLinkText.Text);

            System.Web.UI.WebControls.TableRow nodepath = ((System.Web.UI.WebControls.TableRow)orgLinkText.Parent);
            //getting noadAlias path
            string nodeAliasPath = Convert.ToString(nodepath.Cells[1].Text);
            //getting workflow name
            var WorkFlow = WorkFlowStatusBynodeAliasPath(nodeAliasPath);

            //if workflow is published then only link will come on event name
            if (WorkFlow == SMEConstant.WORKFLOW_PUBLISHED)
            {
                eventlink = new System.Web.UI.WebControls.HyperLink()
                {
                    NavigateUrl = nodeAliasPath,
                    Text        = eventName.Length >= 80 ? eventName.Substring(0, 80) : eventName,
                    ToolTip     = eventName
                };
            }
            return(eventlink);
        }
Beispiel #5
0
            public void Insert(int index, IControl item)
            {
                var row = new System.Web.UI.WebControls.TableRow();

                row.Controls.Add((System.Web.UI.Control)item);

                ContainerStack.InnerGrid.Rows.AddAt(index, row);
            }
Beispiel #6
0
        private void RenderTitlePorletInTable()
        {
            System.Web.UI.WebControls.Table tblTop = new System.Web.UI.WebControls.Table();
            tblTop.CellPadding = 0;
            tblTop.CellSpacing = 0;
            System.Web.UI.WebControls.TableRow rTop = new System.Web.UI.WebControls.TableRow();
            tblTop.Rows.Add(rTop);
            System.Web.UI.WebControls.TableCell cLeft = new System.Web.UI.WebControls.TableCell();
            cLeft.Width    = System.Web.UI.WebControls.Unit.Percentage(100);
            cLeft.CssClass = "TitlePortlet";

            rTop.Cells.Add(cLeft);
            System.Web.UI.WebControls.TableCell cRight = new System.Web.UI.WebControls.TableCell();
            rTop.Cells.Add(cRight);
            cRight.Width    = System.Web.UI.WebControls.Unit.Pixel(50);
            cRight.CssClass = "PanelTitlePortlet";

            System.Web.UI.WebControls.Panel pnTitle = new System.Web.UI.WebControls.Panel();
            pnTitle.Width = System.Web.UI.WebControls.Unit.Percentage(100);

            System.Web.UI.WebControls.Label lblPortletInfo = new System.Web.UI.WebControls.Label();
            lblPortletInfo.Text = string.Format("{0}{1}", Portlet.PortletInstance.Portlet.Name, Portlet.PortletInstance.Name != string.Empty ? "-" + Portlet.PortletInstance.Name : string.Empty);
            pnTitle.Controls.Add(lblPortletInfo);


            System.Web.UI.WebControls.Panel pnControlPortlet = new System.Web.UI.WebControls.Panel();
            pnControlPortlet.Width = System.Web.UI.WebControls.Unit.Pixel(50);

            LiteralControl btnDelete = new LiteralControl();

            btnDelete.Text = string.Format("<img src='{0}' onclick=\"{1}\" class='{2}' alt='{3}'/>", "/Systems/Engine/Images/PortletDelete.png", string.Format("PortletRemove('{0}','{1}');", Portlet.PortletInstance.Id, Portlet.PortletInstance.Name), "ButtonImage", "Remove Portlet");

            LiteralControl btnEdit = new LiteralControl();

            btnEdit.Text = string.Format("<img src='{0}' onclick=\"{1}\" class='{2}' alt='{3}'/>", "/Systems/Engine/Images/PortletEditData.png", string.Format("PortletEditData('{0}');", Portlet.PortletInstance.Id), "ButtonImage", "Edit Portlet");

            LiteralControl btnEditApperance = new LiteralControl();

            btnEditApperance.Text = string.Format("<img src='{0}' onclick=\"{1}\" class='{2}' alt='{3}'/>", "/Systems/Engine/Images/PortletEditApperance.png", string.Format("PortletEditCSS('{0}');", Portlet.PortletInstance.Id), "ButtonImage", "Edit Portlet CSS");

            if (Portlet.PortletInstance.Portlet.EditURL.Trim() != string.Empty)
            {
                pnControlPortlet.Controls.Add(btnEdit);
            }
            pnControlPortlet.Controls.Add(btnEditApperance);
            pnControlPortlet.Controls.Add(btnDelete);

            _pnTop.ID = string.Format("{0}", "Title");
            cLeft.Controls.Add(pnTitle);
            cRight.Controls.Add(pnControlPortlet);
            _pnTop.Controls.Add(tblTop);

            Controls.AddAt(0, _pnTop);
        }
Beispiel #7
0
            public void CopyTo(IControl[] array, int arrayIndex)
            {
                for (int i = 0; i < ContainerStack.InnerGrid.Rows.Count; i++)
                {
                    System.Web.UI.WebControls.TableRow row = ContainerStack.InnerGrid.Rows[i];

                    if (row.Cells[0].Controls.Count > 0)
                    {
                        array[i] = (IControl)row.Cells[0].Controls[0];
                    }
                }
            }
Beispiel #8
0
            public int IndexOf(IControl item)
            {
                for (int i = 0; i < ContainerStack.InnerGrid.Rows.Count; i++)
                {
                    System.Web.UI.WebControls.TableRow row = ContainerStack.InnerGrid.Rows[i];

                    if (row.Cells[0].Controls.Count > 0 && row.Cells[0].Controls[0] == item)
                    {
                        return(i);
                    }
                }
                return(-1);
            }
Beispiel #9
0
        //On_ExternalDatabound Displaying Workflow Status and disabling edit and delete button based on condition
        public static string WorkFlowStatusDisplay(int stepId, string currOrgID, object sender)
        {
            var workFlow = string.Empty;

            if (stepId > 0)
            {
                // Get workflow step display name
                WorkflowStepInfo wsi = WorkflowStepInfoProvider.GetWorkflowStepInfo(stepId);
                if (wsi != null)
                {
                    workFlow = ResHelper.LocalizeString(wsi.StepDisplayName);
                }
                // if workflow is Archive then we have to disable delete button
                if (workFlow == SMEConstant.WORKFLOW_ARCHIVED)
                {
                    System.Web.UI.WebControls.TableCell orgActions = ((System.Web.UI.WebControls.TableCell)sender);
                    System.Web.UI.WebControls.TableRow  Actions    = ((System.Web.UI.WebControls.TableRow)orgActions.Parent);
                    ((CMSButton)(Actions.Cells[0].FindControl("adelete"))).Enabled = false;
                    //((CMSButton)(Actions.Cells[0].FindControl("aedit"))).Enabled = true;
                }
                // if workflow is "Approval await" then we have to disable edit and delete button for author
                else if (workFlow == SMEConstant.WORKFLOW_APPROVAL)
                {
                    if (IsUserInAdminRole())
                    {
                        System.Web.UI.WebControls.TableCell orgActions = ((System.Web.UI.WebControls.TableCell)sender);
                        System.Web.UI.WebControls.TableRow  Actions    = ((System.Web.UI.WebControls.TableRow)orgActions.Parent);
                        ((CMSButton)(Actions.Cells[0].FindControl("adelete"))).Enabled = false;
                        ((CMSButton)(Actions.Cells[0].FindControl("aedit"))).Enabled   = false;
                    }
                    else
                    {
                        System.Web.UI.WebControls.TableCell orgActions = ((System.Web.UI.WebControls.TableCell)sender);
                        System.Web.UI.WebControls.TableRow  Actions    = ((System.Web.UI.WebControls.TableRow)orgActions.Parent);
                        ((CMSButton)(Actions.Cells[0].FindControl("adelete"))).Enabled = true;
                        ((CMSButton)(Actions.Cells[0].FindControl("aedit"))).Enabled   = true;
                    }
                }
            }
            return(workFlow);
        }
Beispiel #10
0
        public static WebControlsTableResult DataTable2WebControlsTable(this System.Data.DataTable dt, int maxText)
        {
            string unitString = dt.Columns.Count == 0 ? "" : (100 / dt.Columns.Count).ToString() + "%";

            WebControlsTableResult ret = new WebControlsTableResult();

            ret.Table             = new System.Web.UI.WebControls.Table();
            ret.Table.BorderWidth = 1;
            ret.Table.GridLines   = System.Web.UI.WebControls.GridLines.Both;
            System.Web.UI.WebControls.TableRow row = null;

            //Add the Headers
            row = new System.Web.UI.WebControls.TableRow();
            for (int j = 0; j < dt.Columns.Count; j++)
            {
                System.Web.UI.WebControls.TableHeaderCell headerCell = new System.Web.UI.WebControls.TableHeaderCell();
                headerCell.Text = dt.Columns[j].ColumnName;
                row.Cells.Add(headerCell);
            }
            ret.Table.Rows.Add(row);

            //Add the Column values
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                row = new System.Web.UI.WebControls.TableRow();
                for (int j = 0; j < dt.Columns.Count; j++)
                {
                    System.Web.UI.WebControls.TableCell cell = new System.Web.UI.WebControls.TableCell();
                    cell.Text  = dt.Rows[i][j].ToString().LimitText(maxText);
                    cell.Width = new System.Web.UI.WebControls.Unit(unitString);
                    row.Cells.Add(cell);
                }
                // Add the TableRow to the Table
                ret.Table.Rows.Add(row);
            }

            ret.Label      = new System.Web.UI.WebControls.Label();
            ret.Label.Text = "C:" + dt.Columns.Count.ToString() + " R:" + dt.Rows.Count.ToString();
            return(ret);
        }
        private void CrearHorario(System.Web.UI.WebControls.TableRow Fila, string idHorario, string sNombre, int IDSala, bool bHorario)
        {
            if (strHora == "")
            {
                strHora = idHorario;
            }
            else
            {
                strHora = strHora + "," + idHorario;
            }

            if (strSalas == "")
            {
                strSalas = sNombre;
            }
            else
            {
                strSalas = strSalas + "," + sNombre;
            }

            if (nRecurso == "")
            {
                nRecurso = IDSala.ToString();
            }
            else
            {
                nRecurso = nRecurso + "," + IDSala.ToString();
            }

            Cal           = new ScheduleCalendar();
            Cal.ID        = idHorario;
            Cal.StartDate = Fechas.crearDateTime(this.txtFecha.Text);
            //Cal.Width = System.Web.UI.WebControls.Unit.Pixel(130);
            //Cal.Height = System.Web.UI.WebControls.Unit.Pixel(422);
            //Datos del control
            Cal.NumberOfDays          = 1;
            Cal.Weeks                 = 1;
            Cal.GridLines             = System.Web.UI.WebControls.GridLines.Both;
            Cal.Layout                = LayoutEnum.Vertical;
            Cal.BorderColor           = System.Drawing.Color.Gray;
            Cal.CellSpacing           = 0;
            Cal.TimeScaleInterval     = 30;
            Cal.StartOfTimeScale      = System.TimeSpan.Parse("07:00:00");
            Cal.EndOfTimeScale        = System.TimeSpan.Parse("21:00:00");
            Cal.StartTimeField        = "StartTime";
            Cal.EndTimeField          = "EndTime";
            Cal.TimeFormatString      = "{0:t}";
            Cal.DateFormatString      = "{0:d}";
            Cal.FullTimeScale         = true;
            Cal.TimeFieldsContainDate = true;

            //string sServer = Session["strServer"].ToString();
            //if (sServer.ToLower().IndexOf("cr2i") == -1) sServer = "/";
            //else sServer = "/cr2i/";
            //Datos de las plantillas (ItemTemplate, DateTemplate y TimeTemplate) y sus estilos
            Cal.ItemTemplate = LoadTemplate(Session["strServer"] + "Capa_Presentacion/UserControls/Plantillas/CalItemTemplate.ascx");
            Cal.DateTemplate = LoadTemplate(Session["strServer"] + "Capa_Presentacion/UserControls/Plantillas/CalDateTemplate.ascx");
            Cal.TimeTemplate = LoadTemplate(Session["strServer"] + "Capa_Presentacion/UserControls/Plantillas/CalTimeTemplate.ascx");

            Cal.BackgroundStyle.CssClass = "bground";
            Cal.ItemStyle.CssClass       = "item";
            Cal.DateStyle.CssClass       = "title";
            Cal.TimeStyle.CssClass       = "rangeheader";

            //habrá que pasar, además del objeto, el id del recurso (sala) para obtener sus reservas.strUbicacion
            BindSchedule(Cal, IDSala);

            System.Web.UI.WebControls.TableCell Celda = new System.Web.UI.WebControls.TableCell();
            //System.Web.UI.Control objTxt = new LiteralControl(@"<center><span id='" + IDSala.ToString() + @"' class='enlace' onClick='mostrarSala(this.id)'>" + sNombre + @"</span></center><br />");
            System.Web.UI.Control objTxt = new LiteralControl(@"<center><span id='" + IDSala.ToString() + @"' class='cabWebex'>" + sNombre + @"</span></center><br />");
            //if (nRequisitos == 0) objTxt = new LiteralControl(@"<center><span id='" + IDSala.ToString() + @"' class='enlaces' onClick='mostrarSala(this.id)' title=" + (char)34 + "cssbody=[dvbdyAuto] cssheader=[dvhdrAuto] header=[<img src='../../../images/info.gif' style='vertical-align:middle'>&nbsp;&nbsp;Información de la sala] body=[Ubicación: " + strUbicacion.Replace((char)34, (char)39).Replace(((char)10).ToString(), "<br />") + (char)10 + (char)10 + @"<br /><br />Características: " + strCaracteristicas.Replace((char)34, (char)39).Replace(((char)10).ToString(), "<br />") + @"] hideselects=[off]" + (char)34 + ">" + sNombre + @"</span></center><br />");
            //else if (nRequisitos == 1) objTxt = new LiteralControl(@"<center><span id='" + IDSala.ToString() + @"' class='enlaces' style='color:#FF9900' onClick='mostrarSala(this.id)' title=" + (char)34 + "cssbody=[dvbdy] cssheader=[dvhdr] header=[<img src='../../../images/info.gif' style='vertical-align:middle" + (char)39 + ">&nbsp;&nbsp;Información de la sala] body=[Ubicación: " + strUbicacion.Replace((char)34, (char)39).Replace(((char)10).ToString(), "<br />") + (char)10 + (char)10 + @"<br /><br />Características: " + strCaracteristicas.Replace((char)34, (char)39).Replace(((char)10).ToString(), "<br />") + (char)10 + (char)10 + @"<br /><br /><b><u>Requisitos:</u></b><br /><br /> " + sRequisitos.Replace((char)34, (char)39).Replace(((char)10).ToString(), "<br />") + @"] hideselects=[off]" + (char)34 + ">" + sNombre + @"</span></center><br />");
            //else if (nRequisitos == 2) objTxt = new LiteralControl(@"<center><span id='" + IDSala.ToString() + @"' class='enlaces' style='color:red' onClick='mostrarSala(this.id)' title=" + (char)34 + "cssbody=[dvbdy] cssheader=[dvhdr] header=[<img src='../../../images/info.gif' style='vertical-align:middle" + (char)39 + ">&nbsp;&nbsp;Información de la sala] body=[Ubicación: " + strUbicacion.Replace((char)34, (char)39).Replace(((char)10).ToString(), "<br />") + (char)10 + (char)10 + @"<br /><br />Características: " + strCaracteristicas.Replace((char)34, (char)39).Replace(((char)10).ToString(), "<br />") + (char)10 + (char)10 + @"<br /><br /><b><u>Requisitos:</u></b><br /><br /> " + sRequisitos.Replace((char)34, (char)39).Replace(((char)10).ToString(), "<br />") + @"] hideselects=[off]" + (char)34 + ">" + sNombre + @"</span></center><br />");
            Celda.Controls.Add(objTxt);
            Celda.Controls.Add(Cal);
            Fila.Controls.Add(Celda);
        }
Beispiel #12
0
        public JsonNetResult BookRequest(BookRequestViewModel model, string button)
        {
            //if (button.Equals("AddNew", StringComparison.OrdinalIgnoreCase))
            //{
            //    if (model.BookRequestDetails == null)
            //        model.BookRequestDetails = new List<BookRequestDetail>();
            //    int Id = model.BookRequestDetails.Max(m => m.Id) + 1;
            //    model.BookRequestDetails.Add(new BookRequestDetail { Id = Id });
            //}
            //else if (button.StartsWith("DeleteRow", StringComparison.OrdinalIgnoreCase))
            //{
            //    int Id = Convert.ToInt32(button.Split('_')[1]);
            //    model.BookRequestDetails = model.BookRequestDetails.Where(w => w.Id != Id).ToList();
            //}

            try
            {
                string userId = User.Identity.GetUserId();
                //model.Student = this._studentService.GetStudentByUserId(userId);
                if (!ModelState.IsValid)
                {
                    JsonResponse response = new JsonResponse {
                        Messages = new List <string>(), MsgType = MessageType.Validations
                    };
                    foreach (ModelState modelState in ViewData.ModelState.Values)
                    {
                        foreach (ModelError error in modelState.Errors)
                        {
                            response.Messages.Add(error.ErrorMessage);
                        }
                    }
                    return(JsonNet(response, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    var bookRequestDetails = model.BookRequestDetails.Where(w => !string.IsNullOrEmpty(w.Subject) && !string.IsNullOrEmpty(w.Title) &&
                                                                            !string.IsNullOrEmpty(w.Publication) && !string.IsNullOrEmpty(w.Author)).ToList();

                    var partialBookRequests = model.BookRequestDetails.Where(w => !bookRequestDetails.Contains(w) && (!string.IsNullOrEmpty(w.Subject) || !string.IsNullOrEmpty(w.Title) ||
                                                                                                                      !string.IsNullOrEmpty(w.Publication) || !string.IsNullOrEmpty(w.Author))).ToList();

                    var messages = new List <string>();

                    if (string.Equals(model.College.Name.Trim(), "Other", StringComparison.OrdinalIgnoreCase))
                    {
                        messages.Add("College name is not allowed.");
                    }
                    if (string.Equals(model.Branch.Name.Trim(), "Other", StringComparison.OrdinalIgnoreCase))
                    {
                        messages.Add("Branch name is not allowed");
                    }

                    if (partialBookRequests.Any())
                    {
                        for (int i = 0; i < partialBookRequests.Count; i++)
                        {
                            if (string.IsNullOrEmpty(partialBookRequests[i].Subject))
                            {
                                messages.Add(string.Format("Subject required for Sr.no. {0}.", partialBookRequests[i].Id));
                            }
                            if (string.IsNullOrEmpty(partialBookRequests[i].Title))
                            {
                                messages.Add(string.Format("Title required in Sr.no. {0}.", partialBookRequests[i].Id));
                            }
                            if (string.IsNullOrEmpty(partialBookRequests[i].Publication))
                            {
                                messages.Add(string.Format("Publication required in Sr.no. {0}.", partialBookRequests[i].Id));
                            }
                            if (string.IsNullOrEmpty(partialBookRequests[i].Author))
                            {
                                messages.Add(string.Format("Author required in Sr.no. {0}.", partialBookRequests[i].Id));
                            }
                        }
                    }
                    else if (!bookRequestDetails.Any())
                    {
                        messages.Add("Atleast one text book request is required.");
                    }

                    if (messages.Any())
                    {
                        return(JsonNet(new JsonResponse {
                            MsgType = MessageType.Validations, Messages = messages
                        }, JsonRequestBehavior.AllowGet));
                    }
                    using (var scope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions {
                        IsolationLevel = IsolationLevel.ReadCommitted
                    }))                                                                                                                                                  // Testing Required...
                    {
                        if (model.College.Id <= 0)
                        {
                            model.College.CreatedOn = DateTime.Now;
                            model.College.Id        = this._collegeBranchService.InsertCollege(model.College);
                        }

                        if (model.Branch.Id <= 0)
                        {
                            model.Branch.CreatedOn = DateTime.Now;
                            model.Branch.Id        = this._collegeBranchService.InsertBranch(model.Branch);
                        }

                        //model.Student.UserId = userId;
                        if (model.Student.Id > 0)
                        {
                            model.Student.UpdatedBy = userId;
                            model.Student.UpdatedOn = DateTime.Now;
                            //model.Student.EnrollmentNo = String.Format("{0}-{1}-{2}-A", DateTime.Now.ToString("yy"), model.Branch.Name.Substring(0, 2), model.Student.Id.ToString("0000"));
                            //this._studentService.Update(model.Student); // Student can not update. Need to request admin to update info
                        }
                        else
                        {
                            model.Student.CreatedBy    = userId;
                            model.Student.CreatedOn    = DateTime.Now;
                            model.Student.EnrollmentNo = "E";
                            model.Student.Id           = this._studentService.Insert(model.Student);
                            string[] branchNameArray = model.Branch.Name.Split(new char[] { ' ' });
                            if (branchNameArray.Length >= 2)
                            {
                                model.Student.EnrollmentNo = String.Format("{0}-{1}{2}-{3}-A", DateTime.Now.ToString("yy"), branchNameArray[0][0].ToString().ToUpper(), branchNameArray[1][0].ToString().ToUpper(), model.Student.Id.ToString("0000"));
                            }
                            else
                            {
                                model.Student.EnrollmentNo = String.Format("{0}-{1}-{2}-A", DateTime.Now.ToString("yy"), model.Branch.Name.Substring(0, 2).ToUpper(), model.Student.Id.ToString("0000"));
                            }
                            this._studentService.Update(model.Student); // Student can not update. Need to request admin if require any change
                        }

                        model.BookRequest.StudentId   = model.Student.Id;
                        model.BookRequest.CollegeId   = model.College.Id;
                        model.BookRequest.BranchId    = model.Branch.Id;
                        model.BookRequest.Subject     = "NA";
                        model.BookRequest.RequestDate = DateTime.Now;
                        model.BookRequest.CreatedBy   = userId;
                        model.BookRequest.CreatedOn   = DateTime.Now;
                        model.BookRequest.Id          = this._bookRequestService.InsertBookRequest(model.BookRequest);

                        foreach (var item in bookRequestDetails)
                        {
                            int bookId = 0;
                            int.TryParse(item.BookId, out bookId);
                            item.BookId = Convert.ToString(bookId);

                            Book existingBook = null;
                            if (bookId > 0)
                            {
                                existingBook = this._bookService.GetBookById(bookId);
                            }

                            if (existingBook != null)
                            {
                                item.Title = existingBook.Title;
                                if ((!existingBook.Author.Equals(item.Author, StringComparison.OrdinalIgnoreCase) || !existingBook.Publication.Equals(item.Publication, StringComparison.OrdinalIgnoreCase)))
                                {
                                    bookId      = 0;
                                    item.BookId = "0";
                                }
                            }

                            if (bookId <= 0)
                            {
                                var book = new Book
                                {
                                    Title            = item.Title,
                                    Author           = item.Author,
                                    Subject          = item.Subject,
                                    Publication      = item.Publication,
                                    IsNewRequest     = true,
                                    TotalBooks       = 0,
                                    ApprovedBooks    = 0,
                                    NewApprovedBooks = 0,
                                    IssuedBooks      = 0,
                                    TornBooks        = 0,
                                    AvailableBooks   = 0
                                };
                                bookId      = this._bookService.Insert(book);
                                item.BookId = Convert.ToString(bookId);
                            }

                            var bookRequestDetail = new BookRequestDetail
                            {
                                RequestId = model.BookRequest.Id,
                                BookId    = bookId,
                                Status    = (int)BookRequestStatus.Pending,
                                Subject   = item.Subject
                            };

                            item.Id = this._bookRequestService.InsertBookRequestDetail(bookRequestDetail);
                            this._historyService.InsertBookRequestHistory(new BookRequestHistory {
                                BookRequestDetailId = item.Id, Status = (int)BookRequestStatus.Pending, CreatedBy = userId, CreatedOn = DateTime.Now
                            });
                        }
                        scope.Complete();
                    }

                    var emailText = System.IO.File.ReadAllText(Server.MapPath("~/App_Data/EmailTemplates/RequestReceived.html"));
                    emailText = emailText.Replace("{{BASE_URL}}", _webHelper.GetStoreHost(false));
                    System.Web.UI.WebControls.Table tbl = new System.Web.UI.WebControls.Table();
                    tbl.BorderColor = Color.Black;
                    tbl.BorderStyle = System.Web.UI.WebControls.BorderStyle.Solid;
                    tbl.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(1);
                    tbl.Width       = System.Web.UI.WebControls.Unit.Percentage(100);
                    System.Web.UI.WebControls.TableRow  tr   = null;
                    System.Web.UI.WebControls.TableCell col1 = null;
                    System.Web.UI.WebControls.TableCell col2 = null;
                    System.Web.UI.WebControls.TableCell col3 = null;
                    System.Web.UI.WebControls.TableCell col4 = null;
                    System.Web.UI.WebControls.TableCell col5 = null;

                    tr   = new System.Web.UI.WebControls.TableRow();
                    col1 = new System.Web.UI.WebControls.TableCell();
                    col2 = new System.Web.UI.WebControls.TableCell();
                    col3 = new System.Web.UI.WebControls.TableCell();
                    col4 = new System.Web.UI.WebControls.TableCell();
                    col5 = new System.Web.UI.WebControls.TableCell();

                    col1.Text = "Sr#";
                    col2.Text = "Subject";
                    col3.Text = "Title";
                    col4.Text = "Author";
                    col5.Text = "Publication";
                    col1.Style.Add("font-weight", "bold");
                    col2.Style.Add("font-weight", "bold");
                    col3.Style.Add("font-weight", "bold");
                    col4.Style.Add("font-weight", "bold");
                    col5.Style.Add("font-weight", "bold");

                    tr.Cells.AddRange(new System.Web.UI.WebControls.TableCell[] { col1, col2, col3, col4, col5 });
                    tbl.Rows.Add(tr);
                    int j = 0;
                    foreach (var item in bookRequestDetails)
                    {
                        j   += 1;
                        tr   = new System.Web.UI.WebControls.TableRow();
                        col1 = new System.Web.UI.WebControls.TableCell();
                        col2 = new System.Web.UI.WebControls.TableCell();
                        col3 = new System.Web.UI.WebControls.TableCell();
                        col4 = new System.Web.UI.WebControls.TableCell();
                        col5 = new System.Web.UI.WebControls.TableCell();

                        col1.Text = Convert.ToString(j);
                        col2.Text = item.Subject;
                        col3.Text = item.Title;
                        col4.Text = item.Author;
                        col5.Text = item.Publication;
                        tr.Cells.AddRange(new System.Web.UI.WebControls.TableCell[] { col1, col2, col3, col4, col5 });
                        tbl.Rows.Add(tr);
                    }

                    StringBuilder sb = new StringBuilder();
                    System.Web.UI.HtmlTextWriter ht = new System.Web.UI.HtmlTextWriter(new System.IO.StringWriter(sb));
                    tbl.RenderControl(ht);
                    string html = ht.InnerWriter.ToString();

                    emailText = emailText.Replace("{{BOOK_REQUESTS}}", html);
                    UserManager.SendEmail(model.Student.UserId, "Book Request Received", emailText);

                    return(JsonNet(new JsonResponse {
                        MsgType = MessageType.Success, Messages = new List <string>(), RedirectUrl = Url.Action("RequestSuccess", "Library", null, Request.Url.Scheme)
                    }, JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception ex)
            {
                ErrorNotification(ex);
                var messages = new List <string>();
                messages.Add(ex.Message + ex.InnerException ?? ex.InnerException.Message);
                return(JsonNet(new JsonResponse {
                    MsgType = MessageType.Error, Messages = messages
                }, JsonRequestBehavior.AllowGet));
            }
            //return PartialView("_BookRequestDetails", model.BookRequestDetails);
        }
Beispiel #13
0
        public System.Web.UI.Control LoadControlInTable(IPanelArgs args, bool enableEdit)
        {
            PSCPanel result = new PSCPanel();

            result.ID = string.Format("pn{0}", _panel.ToString());
            PSCPanel pnTitle = new PSCPanel();

            pnTitle.ID = string.Format("pn{0}Title", _panel.ToString());

            System.Web.UI.WebControls.Table tblTitle = new System.Web.UI.WebControls.Table();
            tblTitle.CellPadding = 0;
            tblTitle.CellSpacing = 0;
            tblTitle.Width       = System.Web.UI.WebControls.Unit.Percentage(100);
            System.Web.UI.WebControls.TableRow rowTitle = new System.Web.UI.WebControls.TableRow();
            tblTitle.Rows.Add(rowTitle);
            System.Web.UI.WebControls.TableCell cellLeft = new System.Web.UI.WebControls.TableCell();
            System.Web.UI.WebControls.Image     imgLeft  = new System.Web.UI.WebControls.Image();
            imgLeft.ImageUrl = "~/Systems/Engine/Images/PanelTitleLeft.png";
            cellLeft.Controls.Add(imgLeft);
            cellLeft.Width  = System.Web.UI.WebControls.Unit.Pixel(18);
            cellLeft.Height = System.Web.UI.WebControls.Unit.Pixel(18);
            rowTitle.Cells.Add(cellLeft);

            System.Web.UI.WebControls.TableCell cellTitle = new System.Web.UI.WebControls.TableCell();
            cellTitle.Width = System.Web.UI.WebControls.Unit.Percentage(100);
            System.Web.UI.WebControls.Label lblTitle = new System.Web.UI.WebControls.Label();
            lblTitle.Text = _panel.Name;
            cellTitle.Controls.Add(lblTitle);
            cellTitle.Style.Add(System.Web.UI.HtmlTextWriterStyle.BackgroundImage, "/Systems/Engine/Images/PanelTitleCenter.png");
            rowTitle.Cells.Add(cellTitle);


            System.Web.UI.WebControls.TableCell cellControls = new System.Web.UI.WebControls.TableCell();
            cellControls.Wrap = false;
            cellControls.Style.Add(System.Web.UI.HtmlTextWriterStyle.BackgroundImage, "/Systems/Engine/Images/PanelTitleCenter.png");

            System.Web.UI.WebControls.Literal btnEditApperance = new System.Web.UI.WebControls.Literal();
            btnEditApperance.Text = string.Format("<img id='{0}_btnEditApperance' src='/Systems/Engine/Images/PanelEditApperance.png' alt='Edit Apperance' onclick='PanelStyleGet(\"{0}\");'/>", _panel.Id, _panel.Id);
            cellControls.Controls.Add(btnEditApperance);

            if (_panel.Id != (int)Panel.PANEL.Center)
            {
                System.Web.UI.WebControls.Literal btnRemove = new System.Web.UI.WebControls.Literal();
                btnRemove.Text = string.Format("<img id='{0}_btnRemove' src='/Systems/Engine/Images/PanelDelete.png' alt='Remove Panel' onclick='PanelRemove(\"{1}\");'/>", _panel.Id, _panel.Id);
                cellControls.Controls.Add(btnRemove);
            }
            rowTitle.Cells.Add(cellControls);

            System.Web.UI.WebControls.TableCell cellRight = new System.Web.UI.WebControls.TableCell();
            System.Web.UI.WebControls.Image     imgRight  = new System.Web.UI.WebControls.Image();
            imgRight.ImageUrl = "~/Systems/Engine/Images/PanelTitleRight.png";
            cellRight.Controls.Add(imgRight);
            rowTitle.Cells.Add(cellRight);

            //bool enableEdit = true;
            if (enableEdit)
            {
                result.Controls.Add(pnTitle);
            }

            pnTitle.Controls.Add(tblTitle);

            PSCPanel pnMain = new PSCPanel();

            pnMain.ID          = string.Format("pn{0}Display", _panel.ToString());
            pnMain.Style.Value = _style;
            //add panel class for mobile
            pnMain.CssClass = "panelCss";
            if (pnMain.Style["width"] != null)
            {
                pnTitle.Width = System.Web.UI.WebControls.Unit.Parse(pnMain.Style["width"]);
            }

            if (args != null)
            {
                pnMain.Height = System.Web.UI.WebControls.Unit.Empty;
            }

            result.Controls.Add(pnMain);
            if (enableEdit)
            {
                pnMain.BorderStyle = System.Web.UI.WebControls.BorderStyle.Dotted;
                pnMain.BorderWidth = 1;
            }

            if (args != null)
            {
                System.Web.UI.UserControl uc = new System.Web.UI.UserControl();
                pnMain.Controls.Add(uc.LoadControl(args.Path));
            }
            else
            {
                foreach (PortletInstanceInPanel item in _portlets)
                {
                    pnMain.Controls.Add(item.RenderPortletTable(enableEdit));
                }
            }

            return(result);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
                Initialize();

            string[] values = Request.QueryString.GetValues("DocumentID");
            if (values == null)
                return;

            iDocumentID = System.Convert.ToInt32(values[0]);

            DAL.ConferenceDataSet.PaperListDataTable dataTableDocument;
            DAL.ConferenceDataSetTableAdapters.PaperListTableAdapter adapterDocument = new DAL.ConferenceDataSetTableAdapters.PaperListTableAdapter();
            dataTableDocument = adapterDocument.GetDataByDocumentID(iDocumentID);

            System.Web.UI.WebControls.Table table = new System.Web.UI.WebControls.Table();

            int iRows = dataTableDocument.Rows.Count;

            for (int i = 0; i < iRows; i++)
            {
                // System.Data.DataRow dataRow = dataTableDocument.Rows[i];
                DAL.ConferenceDataSet.PaperListRow dataRow = (DAL.ConferenceDataSet.PaperListRow)dataTableDocument.Rows[i];

                // Define a new Web Control Image
                /*System.Web.UI.WebControls.Image imgCoverImage = new System.Web.UI.WebControls.Image();
                imgCoverImage.AlternateText = dr["Title"].ToString();
                string strImageUrl = System.String.Format("~/ImageHandler.ashx?id={0}", documentIDParam);
                imgCoverImage.ImageUrl = strImageUrl;
                cellImage.Controls.Add(imgCoverImage);*/

                // Define a new Web Control Table Row
                System.Web.UI.WebControls.TableRow tableRow = new System.Web.UI.WebControls.TableRow();

                // Define a new Web Control Table Cell
                System.Web.UI.WebControls.TableCell tableCellDocumentIDLabel = new System.Web.UI.WebControls.TableCell();
                tableCellDocumentIDLabel.Style["text-align"] = "right;";
                System.Web.UI.WebControls.Label lblDocumentID = new System.Web.UI.WebControls.Label();
                lblDocumentID.Text = "DocumentID";
                tableCellDocumentIDLabel.Controls.Add(lblDocumentID);
                tableRow.Cells.Add(tableCellDocumentIDLabel);

                // Define a new Web Control Table Cell
                System.Web.UI.WebControls.TableCell tableCellDocumentIDText = new System.Web.UI.WebControls.TableCell();
                System.Web.UI.WebControls.TextBox txtDocumentID = new System.Web.UI.WebControls.TextBox();
                txtDocumentID.Text = dataRow.DocumentID.ToString();
                tableCellDocumentIDText.Controls.Add(txtDocumentID);
                tableRow.Cells.Add(tableCellDocumentIDText);

                table.Rows.Add(tableRow);

                // Define a new Web Control Table Row
                tableRow = new System.Web.UI.WebControls.TableRow();

                // Define a new Web Control Table Cell
                System.Web.UI.WebControls.TableCell tableCellTitleLabel = new System.Web.UI.WebControls.TableCell();
                tableCellTitleLabel.Style["text-align"] = "right;";
                System.Web.UI.WebControls.Label lblTitle = new System.Web.UI.WebControls.Label();
                lblTitle.Text = "Title";
                tableCellTitleLabel.Controls.Add(lblTitle);
                tableRow.Cells.Add(tableCellTitleLabel);

                // Define a new Web Control Table Cell
                System.Web.UI.WebControls.TableCell tableCellTitleText = new System.Web.UI.WebControls.TableCell();
                System.Web.UI.WebControls.TextBox txtTitle = new System.Web.UI.WebControls.TextBox();
                txtTitle.Text = dataRow.Title.ToString();
                tableCellTitleText.Controls.Add(txtTitle);
                tableRow.Cells.Add(tableCellTitleText);

                table.Rows.Add(tableRow);

                // Define a new Web Control Table Row
                tableRow = new System.Web.UI.WebControls.TableRow();

                // Define a new Web Control Table Cell
                System.Web.UI.WebControls.TableCell tableCellStatusTextEnLabel = new System.Web.UI.WebControls.TableCell();
                tableCellStatusTextEnLabel.Style["text-align"] = "right;";
                System.Web.UI.WebControls.Label lblStatusTextEn = new System.Web.UI.WebControls.Label();
                lblStatusTextEn.Text = "StatusTextEn";
                tableCellStatusTextEnLabel.Controls.Add(lblStatusTextEn);
                tableRow.Cells.Add(tableCellStatusTextEnLabel);

                // Define a new Web Control Table Cell
                System.Web.UI.WebControls.TableCell tableCellStatusTextEnText = new System.Web.UI.WebControls.TableCell();
                System.Web.UI.WebControls.TextBox txtStatusTextEn = new System.Web.UI.WebControls.TextBox();
                if (!dataRow.IsStatusTextEnNull())
                    txtStatusTextEn.Text = dataRow.StatusTextEn.ToString();
                else
                    txtStatusTextEn.Text = "";
                tableCellStatusTextEnText.Controls.Add(txtStatusTextEn);
                tableRow.Cells.Add(tableCellStatusTextEnText);

                table.Rows.Add(tableRow);

                // Define a new Web Control Table Row
                tableRow = new System.Web.UI.WebControls.TableRow();

                // Define a new Web Control Table Cell
                System.Web.UI.WebControls.TableCell tableCellFirstNameLabel = new System.Web.UI.WebControls.TableCell();
                tableCellFirstNameLabel.Style["text-align"] = "right;";
                System.Web.UI.WebControls.Label lblFirstName = new System.Web.UI.WebControls.Label();
                lblFirstName.Text = "FirstName";
                tableCellFirstNameLabel.Controls.Add(lblFirstName);
                tableRow.Cells.Add(tableCellFirstNameLabel);

                // Define a new Web Control Table Cell
                System.Web.UI.WebControls.TableCell tableCellFirstNameText = new System.Web.UI.WebControls.TableCell();
                System.Web.UI.WebControls.TextBox txtFirstName = new System.Web.UI.WebControls.TextBox();
                if (!dataRow.IsFirstNameNull())
                    //if (!String.IsNullOrEmpty(dataRow.FirstName))
                    txtFirstName.Text = dataRow.FirstName;
                else
                    txtFirstName.Text = "";
                tableCellFirstNameText.Controls.Add(txtFirstName);
                tableRow.Cells.Add(tableCellFirstNameText);

                table.Rows.Add(tableRow);

                // Define a new Web Control Table Row
                tableRow = new System.Web.UI.WebControls.TableRow();

                // Define a new Web Control Table Cell
                System.Web.UI.WebControls.TableCell tableCellLastNameLabel = new System.Web.UI.WebControls.TableCell();
                tableCellLastNameLabel.Style["text-align"] = "right;";
                System.Web.UI.WebControls.Label lblLastName = new System.Web.UI.WebControls.Label();
                lblLastName.Text = "LastName";
                tableCellLastNameLabel.Controls.Add(lblLastName);
                tableRow.Cells.Add(tableCellLastNameLabel);

                // Define a new Web Control Table Cell
                System.Web.UI.WebControls.TableCell tableCellLastNameText = new System.Web.UI.WebControls.TableCell();
                System.Web.UI.WebControls.TextBox txtLastName = new System.Web.UI.WebControls.TextBox();
                if (!dataRow.IsLastNameNull())
                    // if (String.IsNullOrEmpty(dataRow.LastName))
                    txtLastName.Text = dataRow.LastName;
                else
                    txtLastName.Text = "";
                tableCellLastNameText.Controls.Add(txtLastName);
                tableRow.Cells.Add(tableCellLastNameText);

                table.Rows.Add(tableRow);

                // Define a new Web Control Table Row
                tableRow = new System.Web.UI.WebControls.TableRow();

                // Define a new Web Control Table Cell
                System.Web.UI.WebControls.TableCell tableCellEmailLabel = new System.Web.UI.WebControls.TableCell();
                tableCellEmailLabel.Style["text-align"] = "right;";
                System.Web.UI.WebControls.Label lblEmail = new System.Web.UI.WebControls.Label();
                lblEmail.Text = "Email";
                tableCellEmailLabel.Controls.Add(lblEmail);
                tableRow.Cells.Add(tableCellEmailLabel);

                // Define a new Web Control Table Cell
                System.Web.UI.WebControls.TableCell tableCellEmailText = new System.Web.UI.WebControls.TableCell();
                System.Web.UI.WebControls.TextBox txtEmail = new System.Web.UI.WebControls.TextBox();
                if (!dataRow.IsEmailNull())
                    // if (String.IsNullOrEmpty(dataRow.Email))
                    txtEmail.Text = dataRow.Email;
                else
                    txtEmail.Text = "";

                tableCellEmailText.Controls.Add(txtEmail);
                tableRow.Cells.Add(tableCellEmailText);

                table.Rows.Add(tableRow);

                // Define a new Web Control Table Row
                tableRow = new System.Web.UI.WebControls.TableRow();

                // Define a new Web Control Table Cell
                System.Web.UI.WebControls.TableCell tableCellClientFileNameLabel = new System.Web.UI.WebControls.TableCell();
                tableCellClientFileNameLabel.Style["text-align"] = "right;";
                System.Web.UI.WebControls.Label lblClientFileName = new System.Web.UI.WebControls.Label();
                lblClientFileName.Text = "ClientFileName";
                tableCellClientFileNameLabel.Controls.Add(lblClientFileName);
                tableRow.Cells.Add(tableCellClientFileNameLabel);

                // Define a new Web Control Table Cell
                System.Web.UI.WebControls.TableCell tableCellClientFileNameText = new System.Web.UI.WebControls.TableCell();
                System.Web.UI.WebControls.TextBox txtClientFileName = new System.Web.UI.WebControls.TextBox();
                if (!dataRow.IsClientFileNameNull())
                    // if (String.IsNullOrEmpty(dataRow.ClientFileName))
                    txtClientFileName.Text = dataRow.ClientFileName;
                else
                    txtClientFileName.Text = "";
                tableCellClientFileNameText.Controls.Add(txtClientFileName);
                tableRow.Cells.Add(tableCellClientFileNameText);

                table.Rows.Add(tableRow);

                /*				System.Web.UI.WebControls.HyperLink hlnkBookName = new System.Web.UI.WebControls.HyperLink();
                                    hlnkBookName.Text = dr["Title"].ToString();
                                    hlnkBookName.NavigateUrl = "~/BookDetails.aspx?pBookID=" + System.Convert.ToString(dr["TitleID"].ToString());
                                    cellProp.Controls.Add(hlnkBookName);

                                    cellProp.Controls.Add(new System.Web.UI.LiteralControl("<br />"));

                                    System.Web.UI.WebControls.Label lblAuthors = new System.Web.UI.WebControls.Label();
                                    lblAuthors.Text = "Authors: ";
                                    cellProp.Controls.Add(lblAuthors);

                                    System.Xml.XmlDocument doc = new System.Xml.XmlDocument();

                                    if (!(dr["Authors"] == null || dr.IsNull("Authors")))
                                    {
                                        doc.LoadXml((string)dr["Authors"]);
                                        System.Xml.XmlElement root = doc.DocumentElement;

                                        // System.Xml.XmlNode root = doc.FirstChild;

                                        //Display the contents of the child nodes.
                                        if (root.HasChildNodes)
                                            for (int iIndex = 0; iIndex < root.ChildNodes.Count; iIndex++)
                                            {
                                                System.Xml.XmlNode xmlNodeAuthor = root.ChildNodes[iIndex];

                                                System.Xml.XmlElement xmlElementAuthorID = xmlNodeAuthor["AuthorID"];
                                                System.Xml.XmlElement xmlElementAuthorName = xmlNodeAuthor["AuthorName"];

                                                System.Web.UI.WebControls.HyperLink hlnkAuthor = new System.Web.UI.WebControls.HyperLink();
                                                hlnkAuthor.Text = xmlElementAuthorName.InnerText;
                                                hlnkAuthor.NavigateUrl = "~/Author.aspx?pAuthorID=" + xmlElementAuthorID.InnerText;
                                                cellProp.Controls.Add(hlnkAuthor);

                                                cellProp.Controls.Add(new System.Web.UI.LiteralControl("&nbsp"));

                                            }
                                    }

                                    cellProp.Controls.Add(new System.Web.UI.LiteralControl("<br />"));

                                    System.Web.UI.WebControls.Label lblTrabslator = new System.Web.UI.WebControls.Label();
                                    lblTrabslator.Text = "Translators: ";
                                    cellProp.Controls.Add(lblTrabslator);

                                    if (!(dr["Translators"] == null || dr.IsNull("Translators")))
                                    {
                                        doc.LoadXml((string)dr["Translators"]);
                                        System.Xml.XmlElement root = doc.DocumentElement;

                                        // System.Xml.XmlNode root = doc.FirstChild;

                                        //Display the contents of the child nodes.
                                        if (root.HasChildNodes)
                                            for (int iIndex = 0; iIndex < root.ChildNodes.Count; iIndex++)
                                            {
                                                System.Xml.XmlNode xmlNodeAuthor = root.ChildNodes[iIndex];

                                                System.Xml.XmlElement xmlElementAuthorID = xmlNodeAuthor["TranslatorID"];
                                                System.Xml.XmlElement xmlElementAuthorName = xmlNodeAuthor["TranslatorName"];

                                                System.Web.UI.WebControls.HyperLink hlnkAuthor = new System.Web.UI.WebControls.HyperLink();
                                                hlnkAuthor.Text = xmlElementAuthorName.InnerText;
                                                hlnkAuthor.NavigateUrl = "~/Author.aspx?pAuthorID=" + xmlElementAuthorID.InnerText;
                                                cellProp.Controls.Add(hlnkAuthor);

                                                cellProp.Controls.Add(new System.Web.UI.LiteralControl("&nbsp"));

                                            }
                                    }

                                    cellProp.Controls.Add(new System.Web.UI.LiteralControl("<br />"));

                                    System.Web.UI.WebControls.Label lblPublisher = new System.Web.UI.WebControls.Label();
                                    lblPublisher.Text = "Publisher: " + dr["Publisher"].ToString();
                                    cellProp.Controls.Add(lblPublisher);

                                    cellProp.Controls.Add(new System.Web.UI.LiteralControl("<br />"));

                                    System.Web.UI.WebControls.Label lblPublishedDate = new System.Web.UI.WebControls.Label();
                                    lblPublishedDate.Text = "Published Date: " + dr["PublishedDate"].ToString();
                                    cellProp.Controls.Add(lblPublishedDate);

                                    cellProp.Controls.Add(new System.Web.UI.LiteralControl("<br />"));

                                    System.Web.UI.WebControls.Label lblPrintingTimes = new System.Web.UI.WebControls.Label();
                                    lblPrintingTimes.Text = "PrintingTimes: " + dr["PrintingTimes"].ToString();
                                    cellProp.Controls.Add(lblPrintingTimes);

                                    cellProp.Controls.Add(new System.Web.UI.LiteralControl("<br />"));

                                    System.Web.UI.WebControls.Label lblPages = new System.Web.UI.WebControls.Label();
                                    lblPages.Text = "Pages: " + dr["Pages"].ToString();
                                    cellProp.Controls.Add(lblPages);

                                    cellProp.Controls.Add(new System.Web.UI.LiteralControl("<br />"));

                                    System.Web.UI.WebControls.Label lblDocumentSummary = new System.Web.UI.WebControls.Label();
                                    lblDocumentSummary.Text = "DocumentSummary: " + dr["DocumentSummary"].ToString();
                                    cellProp.Controls.Add(lblDocumentSummary);

                                    cellProp.Controls.Add(new System.Web.UI.LiteralControl("<br />"));
                                    cellProp.Controls.Add(new System.Web.UI.LiteralControl("<br />"));

                                    System.Web.UI.WebControls.HyperLink hlnkDownload = new System.Web.UI.WebControls.HyperLink();
                                    hlnkDownload.Text = "Download";

                                    if (!(dr["DocumentID"] == null || dr.IsNull("DocumentID")))
                                    {
                                        string strDownloadPath = System.String.Format("~/FileDownloadHandler.ashx?FileID={0}", dr["DocumentID"].ToString());
                                        hlnkDownload.NavigateUrl = strDownloadPath;
                                    }
                                    cellProp.Controls.Add(hlnkDownload);

                     */

                tableRow = new System.Web.UI.WebControls.TableRow();
                System.Web.UI.WebControls.TableCell tableCellDownloadHyperLink = new System.Web.UI.WebControls.TableCell();
                System.Web.UI.WebControls.HyperLink hlnkDownload = new System.Web.UI.WebControls.HyperLink();
                hlnkDownload.Text = "Download";
                if (/*dataRow.FileID != null &&*/ !dataRow.IsFileIDNull())
                {
                    string strDownloadPath = System.String.Format("~/FileDownloadHandler.ashx?FileID={0}", dataRow.FileID.ToString());
                    hlnkDownload.NavigateUrl = strDownloadPath;
                }
                tableCellDownloadHyperLink.Controls.Add(hlnkDownload);
                tableRow.Cells.Add(tableCellDownloadHyperLink);
                table.Rows.Add(tableRow);
            }

            pnlDocumentDetail.Controls.Add(table);
            pnlDocumentDetail.Controls.Add(new System.Web.UI.LiteralControl("<br />"));
        }