Ejemplo n.º 1
0
    public void FillCheckBoxForAnnouncementBySchoolBMSID(CheckBoxList clstDivision, int SchoolID, int BMSID)
    {
        DataTable           DtSelect         = new DataTable();
        Announcement_BLogic BAL_Announcement = new Announcement_BLogic();
        //DtSelect = BAL_Announcement.FillCheckBox(SchoolID, BMSID);
        DataAccess DAL_Announcement = new DataAccess();

        arrParameter = new ArrayList();
        arrParameter.Add(new parameter("SchoolID", SchoolID));
        arrParameter.Add(new parameter("BMSID", BMSID));
        DtSelect = DAL_Announcement.DAL_Select("Proc_fillDivisionBySchoolID", arrParameter).Tables[0];
        if (DtSelect.Rows.Count > 0)
        {
            clstDivision.Items.Clear();
            clstDivision.DataSource     = DtSelect;
            clstDivision.DataTextField  = "Division";
            clstDivision.DataValueField = "DivisionID";
            clstDivision.DataBind();
        }
        else
        {
            clstDivision.Items.Clear();
            clstDivision.DataBind();
        }
    }
Ejemplo n.º 2
0
        /// <summary>
        /// Called when the page loads, prepares to handle any operations by setting up
        /// page objects.  If not postback and a UserRid is supplied, gets the data
        /// from the web service to fill the page.
        /// </summary>
        protected void Page_Load(object sender, System.EventArgs e)
        {
            Response.Cache.SetExpires(DateTime.Parse(DateTime.Now.ToString()));
            Response.Cache.SetCacheability(HttpCacheability.NoCache);
            Response.Cache.SetNoStore();

            ////Security Defect - CH1 -START Added the below code to verify if the IP address of the login page and current page is same

            //string ipaddr1 = Request.UserHostAddress;
            //if (Request.Cookies["AuthToken"] == null)
            //{
            //    Response.Redirect("/PaymentToolmscr/Forms/login.aspx");
            //}
            //else if (!ipaddr1.Equals(
            //    Request.Cookies["AuthToken"].Value))
            //{
            //    // redirect to the login page in real application
            //    Response.Redirect("/PaymentToolmscr/Forms/login.aspx");

            //}
            ////Security Defect - CH1 -End Added the below code to verify if the IP address of the login page and current page is same
            //else
            //{
            string CurrentUser = Page.User.Identity.Name;

            //STAR Retrofit II.Ch1 - START :The boolean variable "Initialized" has been commented as it is no longer being used.
            //if (!Initialized) Initialize();
            //STAR Retrofit II.Ch1 - END
            //STAR Retrofit II.Ch3 - START :The condition to check if the Cache "AUTH_REPDO" is null has been included in the Page_Load event.If it is
            //null,then the Initialize() function is called to populate the cache
            if (Cache["AUTH_REPDO"] == null)
            {
                Initialize();
            }
            //STAR Retrofit II.Ch3 - END
            if (!IsPostBack)
            {
                _DO.DataSource = (DataTable)Cache["AUTH_REPDO"];
                _DO.DataBind();
                _AppName.DataSource = GetApps();     //(DataTable)Context.Items["Apps"];
                _AppName.DataBind();
                AppName            = (string)Context.Items["AppName"];
                OrderService.AppId = AppName;
                _Roles.DataSource  = OrderService.LookupDataSet("Authentication", "GetRoles", new object[] { AppName });
                _Roles.DataBind();
                UserRid = (int)Context.Items["UserRid"];
                if (UserRid != 0)
                {
                    GetUserInfo();
                }
                else if (Context.Items.Contains("DO"))
                {
                    CSAAWeb.WebControls.ListC.SetListIndex(_DO, (string)Context.Items["DO"]);
                }
            }
            //}
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Preenche GridView
        /// </summary>
        /// <typeparam name="T">Tipo de dados da listagem</typeparam>
        /// <param name="chkList">Cridview a ser preenchido</param>
        /// <param name="ListaDados">Lista com dados para preencher gridview</param>
        public static void Preencher <T>(this CheckBoxList chkList, List <T> ListaDados, string dataTextField, string dataValueFiled)
        {
            // Descarrega dropdown list
            chkList.DataSource = null;

            chkList.DataBind();

            // Carrega dropdown list
            chkList.DataSource     = ListaDados;
            chkList.DataTextField  = dataTextField;
            chkList.DataValueField = dataValueFiled;
            chkList.DataBind();
        }
        protected void bindInfo(DataTable dt, string st_id, string DEP_NAME, int i)
        {
            if (dt.Rows.Count != 0)
            {
                TableRow  tr  = new TableRow();
                TableCell td1 = new TableCell();//第一列为部门名称
                td1.Width = 85;
                Label lab = new Label();
                lab.Text = DEP_NAME + ":";
                Label lab1 = new Label();
                lab1.ID      = "dep" + i.ToString();
                lab1.Text    = st_id;
                lab1.Visible = false;
                td1.Controls.Add(lab);
                td1.Controls.Add(lab1);
                tr.Cells.Add(td1);

                CheckBoxList cki = new CheckBoxList();//第二列为领导的姓名
                cki.ID             = "cki" + i.ToString();
                cki.DataSource     = dt;
                cki.DataTextField  = "ST_NAME"; //领导的姓名
                cki.DataValueField = "ST_ID";   //部门的编号
                cki.DataBind();
                for (int k = 0; k < cki.Items.Count; k++)
                {
                    cki.Items[k].Attributes.Add("Onclick", "CheckBoxList_Click(this)"); //使用了javascript使其只能勾选一个
                }
                cki.RepeatColumns = 5;                                                  //获取显示的列数
                TableCell td2 = new TableCell();
                td2.Controls.Add(cki);
                tr.Cells.Add(td2);
                t.Controls.Add(tr);
            }
        }
Ejemplo n.º 5
0
//        public static int bindDropDownWithRowsCountEn(string ProcName, DropDownList ddl, string parm1, string parm2, string parm3)
//        {

//            DataSet ds = new DataSet();
//            if (parm1.Length > 0 && parm1 != "")
//            {
//                List<SqlParameter> parameters = new List<SqlParameter>();
//                parameters.Add(new SqlParameter("@Parm1", parm1));
//                if (parm2.Length > 0 && parm2 != "")
//                    parameters.Add(new SqlParameter("@Parm2", parm2));
//                if (parm3.Length > 0 && parm3 != "")
//                    parameters.Add(new SqlParameter("@Parm3", parm3));
//                ds = SqlHelper.ExecuteDataset(CommonConfig.Conn(), CommandType.StoredProcedure, ProcName, parameters.ToArray());
//            }
//            else
//            {
//                ds = SqlHelper.ExecuteDataset(CommonConfig.Conn(), CommandType.StoredProcedure, ProcName);
//            }
//            ddl.Items.Clear();
//            if (ds != null && ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
//            {

//                ddl.DataSource = ds;
//                ddl.DataTextField = "ValueText";
//                ddl.DataValueField = "ValueId";
//                ddl.DataBind();
//            }
//            ddl.Items.Insert(0, new ListItem("Select One", "0", true));
//            return ds.Tables[0].Rows.Count;
//        }

        public static void bindCheckbox(string ProcName, CheckBoxList ddl, string parm1, string parm2, string parm3)
        {
            DataSet ds = new DataSet();

            if (parm1.Length > 0 && parm1 != "")
            {
                List <SqlParameter> parameters = new List <SqlParameter>();
                parameters.Add(new SqlParameter("@Parm1", parm1));
                if (parm2.Length > 0 && parm2 != "")
                {
                    parameters.Add(new SqlParameter("@Parm2", parm2));
                }
                if (parm3.Length > 0 && parm3 != "")
                {
                    parameters.Add(new SqlParameter("@Parm3", parm3));
                }
                ds = SqlHelper.ExecuteDataset(CommonConfig.Conn(), CommandType.StoredProcedure, ProcName, parameters.ToArray());
            }
            else
            {
                ds = SqlHelper.ExecuteDataset(CommonConfig.Conn(), CommandType.StoredProcedure, ProcName);
            }
            ddl.Items.Clear();
            if (ds != null && ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
            {
                ddl.DataSource     = ds;
                ddl.DataTextField  = "ValueText";
                ddl.DataValueField = "ValueId";
                ddl.DataBind();
            }
        }
Ejemplo n.º 6
0
 public void BindCheckedList(CheckBoxList theListBox, DataTable theDT, string theTextField, string theValueField)
 {
     theListBox.DataSource     = theDT;
     theListBox.DataTextField  = theTextField;
     theListBox.DataValueField = theValueField;
     theListBox.DataBind();
 }
Ejemplo n.º 7
0
 /// <summary>
 /// 绑定CheckBoxList
 /// </summary>
 /// <param name="cbl"></param>
 /// <param name="id"></param>
 /// <param name="text"></param>
 /// <param name="dt"></param>
 public static void CheckBoxListBind(CheckBoxList cbl, string id, string text, DataTable dt)
 {
     cbl.DataSource     = dt;
     cbl.DataTextField  = text;
     cbl.DataValueField = id;
     cbl.DataBind();
 }
Ejemplo n.º 8
0
        public MultipleSelectControl(MultipleSelect item, RepeatDirection direction)
        {
            this.item = item;

            l                     = new Label();
            l.Text                = item.Title;
            l.CssClass            = "label";
            l.AssociatedControlID = item.Name;
            this.Controls.Add(l);

            list = new CheckBoxList();
            list.RepeatDirection = direction;
            list.ID             = item.Name;
            list.CssClass       = "alternatives";
            list.DataSource     = item.GetChildren();
            list.DataTextField  = "Title";
            list.DataValueField = "ID";
            list.DataBind();
            this.Controls.Add(list);

            if (item.Required)
            {
                cv = new CustomValidator {
                    Display = ValidatorDisplay.Dynamic, Text = "*"
                };
                cv.ErrorMessage    = item.Title + " is required";
                cv.ServerValidate += (s, a) => a.IsValid = !string.IsNullOrEmpty(AnswerText);
                cv.ValidationGroup = "Form";
                this.Controls.Add(cv);
            }
        }
Ejemplo n.º 9
0
        private Table ShrTable(string i)
        {
            string    sql   = "select st_ID,st_name from TBDS_STAFFINFO where st_depid='07' and ST_PD='0'";
            DataTable dt    = DBCallCommon.GetDTUsingSqlText(sql);
            Table     tctrl = new Table();

            if (dt.Rows.Count != 0)
            {
                TableRow  tr = new TableRow();
                TableCell td = new TableCell();

                CheckBoxList cki = new CheckBoxList();
                cki.ID             = "cki" + i;
                cki.DataSource     = dt;
                cki.DataTextField  = "ST_NAME"; //领导的姓名
                cki.DataValueField = "ST_ID";   //领导的编号
                cki.DataBind();
                for (int k = 0; k < cki.Items.Count; k++)
                {
                    cki.Items[k].Attributes.Add("Onclick", "CheckBoxList_Click(this)"); //使用了javascript使其只能勾选一个
                }
                cki.RepeatColumns = 5;                                                  //获取显示的列数
                td.Controls.Add(cki);
                tr.Cells.Add(td);
                tctrl.Controls.Add(tr);
            }
            return(tctrl);
        }
 public static void LlenaControl(CheckBoxList control, DataSet dataset, string datatext, string datavalue, string valuecompare, bool blanco, bool bloqueo)
 {
     control.DataSource     = dataset.Tables[0].DefaultView;
     control.DataTextField  = datatext;
     control.DataValueField = datavalue;
     control.DataBind();
     if (blanco)
     {
         control.Items.Add(new ListItem("", "0"));
         control.Items[control.Items.Count - 1].Selected = true;
     }
     for (int i = 0; i < dataset.Tables[1].Rows.Count; i++)
     {
         for (int pos = 0; pos < control.Items.Count; pos++)
         {
             if (control.Items[pos].Value == dataset.Tables[1].Rows[i][valuecompare].ToString())
             {
                 control.Items[pos].Selected = true;
             }
             if (bloqueo)
             {
                 control.Items[pos].Enabled = false;
             }
         }
     }
 }
Ejemplo n.º 11
0
 public static void BindCBL(CheckBoxList cblControl, DataTable dt, string DataTextField, string DataValueField)
 {
     cblControl.DataValueField = DataValueField;
     cblControl.DataTextField  = DataTextField;
     cblControl.DataSource     = dt;
     cblControl.DataBind();
 }
Ejemplo n.º 12
0
        /// <summary>
        /// Initialize the form
        /// </summary>
        /// <param name="e"></param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (_macroList.Items.Count < 1)
            {
                _macroList.DataValueField = "Alias";
                _macroList.DataTextField  = "Name";
                _macroList.DataSource     = Macro.GetAll();
                _macroList.DataBound     += new EventHandler(MacroList_DataBound);
            }
            if (!Page.IsPostBack)
            {
                if (MaxNumber != 0)
                {
                    _txtMaxNumber.Text = MaxNumber.ToString();
                }
                if (PreferedWidth != 0)
                {
                    _txtPreferedWidth.Text = PreferedWidth.ToString();
                }
                if (PreferedHeight != 0)
                {
                    _txtPreferedHeight.Text = PreferedHeight.ToString();
                }
            }

            _macroList.DataBind();
        }
Ejemplo n.º 13
0
 /// <summary>
 /// 用sql动态绑定CheckBoxList
 /// </summary>
 /// <param name="cbl">CheckBoxList控件</param>
 /// <param name="sql">查询语句</param>
 /// <param name="text">文本</param>
 /// <param name="value">值</param>
 public void bindCheckBoxList(CheckBoxList ckl, string sql, string text, string value)
 {
     ckl.DataSource     = DBCallCommon.GetDTUsingSqlText(sql);
     ckl.DataTextField  = text;
     ckl.DataValueField = value;
     ckl.DataBind();
 }
Ejemplo n.º 14
0
        protected void gvProcess_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                //鼠标移动到每项时颜色交替效果
                e.Row.Attributes.Add("onmouseover", "e=this.style.backgroundColor; this.style.backgroundColor='#c1ebff'");
                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=e");

                //设置悬浮鼠标指针形状为"小手"
                e.Row.Attributes["style"] = "Cursor:hand";

                CheckBoxList ckblOpration = e.Row.FindControl("ckblOperation") as CheckBoxList;
                if (ckblOpration != null)
                {
                    DataTable dt = RoleInfo.getOperationList();
                    ckblOpration.DataSource     = dt;
                    ckblOpration.DataTextField  = "OperationName";
                    ckblOpration.DataValueField = "OperationId";
                    ckblOpration.DataBind();
                }

                int roleid    = Convert.ToInt32(gvProcess.DataKeys[e.Row.RowIndex]["RoleId"].ToString());
                int processid = Convert.ToInt32(gvProcess.DataKeys[e.Row.RowIndex]["ProcessId"].ToString());
                InitOperation(processid, roleid, ckblOpration);
            }
        }
Ejemplo n.º 15
0
 /// <summary>
 /// Asigna una colección de objeto a un CheckList.
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="elem"></param>
 /// <param name="lst"></param>
 /// <param name="key"></param>
 /// <param name="val"></param>
 public static void DataBind <T>(CheckBoxList elem, IEnumerable <T> lst, Expression <Func <T, int> > key, Expression <Func <T, string> > val)
 {
     elem.DataSource     = lst;
     elem.DataTextField  = HelperLinq.GetExpresionName(val);
     elem.DataValueField = HelperLinq.GetExpresionName(key);
     elem.DataBind( );
 }
Ejemplo n.º 16
0
 public static void CargarChekBoxList <T>(ref CheckBoxList ChekBox, List <T> Lista, string Valor, string Texto)
 {
     ChekBox.DataSource     = Lista;
     ChekBox.DataTextField  = Texto;
     ChekBox.DataValueField = Valor;
     ChekBox.DataBind();
 }
Ejemplo n.º 17
0
 public void LlenaCheckBoxList(string SP, ref CheckBoxList CBL, string[] parametros, string[] valores, ref List <Comun> Etiquetas)
 {
     try
     {
         List <Comun> Lista   = new List <Comun>();
         CD_Comun     CDComun = new CD_Comun();
         CDComun.LlenaCombo(SP, ref Lista, parametros, valores);
         CBL.Items.Clear();
         if (Lista.Count > 0)
         {
             Etiquetas          = Lista;
             CBL.DataSource     = Lista;
             CBL.DataValueField = "IdStr";
             CBL.DataTextField  = "Descripcion";
             CBL.DataBind();
         }
         else
         {
             CBL.Items.Add("La opción no contiene datos");
         }
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Ejemplo n.º 18
0
 public static void fillServicios(CheckBoxList lbox)
 {
     lbox.DataSource     = CatalogCtrl.ServicioLst();
     lbox.DataTextField  = "nombre";
     lbox.DataValueField = "id";
     lbox.DataBind();
 }
Ejemplo n.º 19
0
 public static void fillClienteCopias(CheckBoxList lbox)
 {
     lbox.DataSource     = CatalogCtrl.ClienteCopiaLst();
     lbox.DataTextField  = "nombre";
     lbox.DataValueField = "id";
     lbox.DataBind();
 }
Ejemplo n.º 20
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="channelID"></param>
        /// <param name="cblStation"></param>
        /// <param name="isSelected"></param>
        static public void StationOfChannelBind(int channelID, CheckBoxList cblStation, bool isSelected)
        {
            //ListItem item = this.ddlChannel.SelectedItem;
            //if (item != null)
            //{
            //int id = int.Parse(item.Value);
            //WaterUserClass wu = GetWaterUser();
            //if (wu != null)
            //{
            //ChannelClass ch = wu.ChannelCollection.GetChannelByID(id);
            ChannelClass ch = ChannelFactory.CreateChannel(channelID);

            if (ch != null)
            {
                ListItemCollection stationList = GetStationListItemCollection(ch.StationCollection);
                cblStation.DataTextField  = "Text";
                cblStation.DataValueField = "Value";
                cblStation.DataSource     = stationList;
                cblStation.DataBind();

                foreach (ListItem stitem in cblStation.Items)
                {
                    stitem.Selected = isSelected;
                }
            }
            //}
            //}
        }
Ejemplo n.º 21
0
    protected void gvDoctores_RowEditing(object sender, GridViewEditEventArgs e)
    {
        try
        {
            gvDoctores.EditIndex = e.NewEditIndex; // cambiar a modo editar
            LlenargvDoctores();                    //recargar el gv
            DropDownList ddlSexo = (DropDownList)gvDoctores.Rows[e.NewEditIndex].FindControl("ddlSexoEIT");
            ddlSexo.DataSource     = new BusSexo().Obtener();
            ddlSexo.DataTextField  = "Nombre_Sexo";
            ddlSexo.DataValueField = "Id_Sexo";
            ddlSexo.DataBind();
            ddlSexo.SelectedValue = gvDoctores.DataKeys[e.NewEditIndex].Values["Id_Sexo_Doctor"].ToString();

            RadioButtonList rbinter = (RadioButtonList)gvDoctores.Rows[e.NewEditIndex].FindControl("rbInterEIT");
            rbinter.DataSource     = new BusIntervencion().Obtener();
            rbinter.DataTextField  = "Nombre_Intervencion";
            rbinter.DataValueField = "Id_Intervencion";
            rbinter.DataBind();
            rbinter.DataSource = gvDoctores.DataKeys[e.NewEditIndex].Values["Id_Intervencion_Doctor"].ToString();

            CheckBoxList chkTurno = (CheckBoxList)gvDoctores.Rows[e.NewEditIndex].FindControl("chkTurnoEIT");
            chkTurno.DataSource     = new BusTurno().Obtener();
            chkTurno.DataTextField  = "Nombre_Turno";
            chkTurno.DataValueField = "Id_Turno";
            chkTurno.DataBind();
            chkTurno.DataSource = gvDoctores.DataKeys[e.NewEditIndex].Values["Id_Turno_Doctor"].ToString();
        }
        catch (Exception ex)
        {
            MostrarMensaje(ex.Message);
        }
    }
Ejemplo n.º 22
0
        public CheckBoxList BindCheckBoxList(string TableName, string FieldName, string ValueID, string condition, CheckBoxList chk)
        {
            try
            {
                SqlCommand cmd = new SqlCommand("select " + FieldName + "," + ValueID + " from " + TableName + " where " + condition + "", conn);
                if (conn.State != ConnectionState.Open)
                {
                    conn.Open();
                }
                SqlDataReader dr = cmd.ExecuteReader();
                DataTable     dt = new DataTable();
                dt.Load(dr);
                conn.Close();
                if (dt.Rows.Count > 0)
                {
                    chk.Items.Clear();
                    chk.DataTextField  = FieldName;
                    chk.DataValueField = ValueID;
                    chk.DataSource     = dt;
                    chk.DataBind();

                    return(chk);
                }
                else
                {
                    chk.Items.Clear();
                    return(null);
                }
            }
            catch
            {
                return(null);
            }
        }
Ejemplo n.º 23
0
 /// <summary>
 /// 绑定DataTable:CheckBoxList复选框
 /// </summary>
 /// <param name="dt">DataTable</param>
 /// <param name="rbllist">控件名称</param>
 /// <param name="_Name">绑定字段名称</param>
 /// <param name="_ID">绑定字段主键</param>
 public static void BindCheckBoxList(DataTable dt, CheckBoxList checkList, string _Name, string _ID)
 {
     checkList.DataSource     = dt;
     checkList.DataTextField  = _Name;
     checkList.DataValueField = _ID;
     checkList.DataBind();
 }
 protected void rptSME_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         DataRowView  drv             = e.Item.DataItem as DataRowView;
         CheckBox     chkSubLevel     = (CheckBox)e.Item.FindControl("chkSubLevel");
         CheckBoxList chkSubjects     = (CheckBoxList)e.Item.FindControl("chkSubjects");
         HiddenField  hdnSublevelId   = (HiddenField)e.Item.FindControl("hdnSublevelId");
         Button       btnUpdateAssign = e.Item.NamingContainer.NamingContainer.FindControl("btnUpdateAssign") as Button;
         DataTable    dtResults       = (DataTable)ViewState["Results"];
         var          subjects        = from DataRow myRow in dtResults.Rows
                                        where (int)myRow["SubLevelId"] == int.Parse(hdnSublevelId.Value)
                                        select myRow;
         if (subjects.Any())
         {
             DataTable dt = subjects.CopyToDataTable();
             chkSubjects.DataTextField  = "SubjectName";
             chkSubjects.DataValueField = "SubjectId";
             chkSubjects.DataSource     = dt;
             chkSubjects.DataBind();
             btnUpdateAssign.Visible = true;
         }
         else
         {
             btnUpdateAssign.Visible = false;
         }
     }
 }
Ejemplo n.º 25
0
 public static void chkListLlenaValoresConDT(DataTable pDT, ref CheckBoxList pchkl, string pValue, string pTextField)
 {
     pchkl.DataSource     = pDT;
     pchkl.DataTextField  = pTextField;
     pchkl.DataValueField = pValue;
     pchkl.DataBind();
 }
Ejemplo n.º 26
0
 //绑定checkboxlist
 public static void BindCheckBoxList(CheckBoxList cb, DataSet ds, string DataText, string DataValue)
 {
     cb.DataSource     = ds;
     cb.DataTextField  = DataText;
     cb.DataValueField = DataValue;
     cb.DataBind();
 }
Ejemplo n.º 27
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="cbl"></param>
 /// <param name="id"></param>
 public void cbldata(CheckBoxList cbl, int id)
 {
     cbl.DataSource     = ModuleService.GetChild(id);
     cbl.DataTextField  = "modulename";
     cbl.DataValueField = "id";
     cbl.DataBind();
 }
Ejemplo n.º 28
0
 public static void BindCheckBoxList(CheckBoxList checkboxlist, IEnumerable enumerable, string dataTextField, string dataValueField)
 {
     checkboxlist.DataSource     = enumerable;
     checkboxlist.DataTextField  = dataTextField;
     checkboxlist.DataValueField = dataValueField;
     checkboxlist.DataBind();
 }
Ejemplo n.º 29
0
        private void Get_Receiver()
        {
            //收料员
            string    sql = "select ST_ID,ST_NAME from TBDS_STAFFINFO where ST_DEPID='10' and ST_PD='0'";
            DataTable dt1 = DBCallCommon.GetDTUsingSqlText(sql);

            if (dt1.Rows.Count != 0)
            {
                Table     t  = new Table();
                TableRow  tr = new TableRow();
                TableCell td = new TableCell();

                CheckBoxList cki = new CheckBoxList();
                cki.ID             = "cki1";
                cki.DataSource     = dt1;
                cki.DataTextField  = "ST_NAME"; //领导的姓名
                cki.DataValueField = "ST_ID";   //领导的编号
                cki.DataBind();
                for (int k = 0; k < cki.Items.Count; k++)
                {
                    cki.Items[k].Attributes.Add("Onclick", "CheckBoxList_Click(this)"); //使用了javascript使其只能勾选一个
                }
                cki.RepeatColumns = 5;                                                  //获取显示的列数

                td.Controls.Add(cki);
                tr.Cells.Add(td);
                t.Controls.Add(tr);
                pal_select1_inner.Controls.Add(t);
            }
        }
Ejemplo n.º 30
0
        protected void rptModule_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            try
            {
                if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
                {
                    Module       module       = (Module)e.Item.DataItem;
                    CheckBoxList chkList_Item = (CheckBoxList)e.Item.FindControl("chkList_Item");

                    if (chkList_Item != null && lstAllOperation != null)
                    {
                        chkList_Item.DataSource = lstAllOperation.Where(p => p.ModuleID == module.ID).OrderBy(p => p.OrderNum).ToList();

                        chkList_Item.DataTextField  = "Name";
                        chkList_Item.DataValueField = "ID";
                        chkList_Item.DataBind();
                        SetCheckListBoxSelected(chkList_Item);
                    }
                }
            }
            catch
            {
                throw new Exception("绑定module出错");
            }
        }
 } //Nạp danh sách nhân viên lên Gridview
 public void NapDSQuyen()
 {
     QuyenCollection quyenColl = new QuyenCollection();
     quyenColl = quyenBUS.TimDSQuyen();
     for (int i = 0; i < 6; i++)
     {
         CheckBoxList cblist = new CheckBoxList();
         cblist = QuyenTab.Tabs[i].FindControl("CheckBoxList"+(i+1).ToString()) as CheckBoxList;
         if (quyenColl.Index(i).ChiTietQuyen == null) 
             break;
         cblist.DataSource = quyenColl.Index(i).ChiTietQuyen;
         cblist.DataTextField = "TenCTQuyen";
         cblist.DataValueField = "MaCTQuyen";
         cblist.DataBind();
     }  
 }// nạp danh sách quyền cho TabControl
Ejemplo n.º 32
0
 public static void BindModalitiesDDL(string addText, CheckBoxList ddl)
 {
     RISDatabaseAccessLayer dataAccess = new RISDatabaseAccessLayer();
     SqlConnection connection = (SqlConnection)dataAccess.GetConnection();
     connection.Open();
     SqlCommand command = new SqlCommand("sp_get_modalities", connection);
     command.CommandType = CommandType.StoredProcedure;
     command.Parameters.AddWithValue("@addText", addText);
     SqlDataReader reader = command.ExecuteReader();
     ddl.DataSource = reader;
     ddl.DataMember = "Name";
     ddl.DataTextField = "Name";
     ddl.DataValueField = "ModalityId";
     ddl.DataBind();
     reader.Close();
     connection.Close();
 }
Ejemplo n.º 33
0
    //输出一个字段
    //li_tdnums_onerow:当前行已输出了几列
    //li_colnums_show:每行显示几列(标准情况下)
    //pi_isnewdoc 0:新文档  1:旧文档
    //ifhavarole:表单上是否有权限  0:lable输出 1:input输出
    //ifflowdoc:是否流程表单 0:非流程 1:流程
    //curtacheid:当前环节ID,用于判断字段是否在当前环节有权限
    public int GetFieldHtml(TableRow tRow, int li_tdnums_onerow, int li_colnums_show, string hy_fieldid, string pi_isnewdoc, string ifhavarole, string ifflowdoc, string curtacheid)
    {
        int li_return = li_tdnums_onerow;

        string ls_laborinput = "0";     //输出LABLE还是INPUT    0:LABLE    1:INPUT
        HyoaClass.Hyoa_global Hyoa_global = new HyoaClass.Hyoa_global();
        HyoaClass.Hyoa_flowfield Hyoa_flowfield = new HyoaClass.Hyoa_flowfield();
        DataTable dtfield = Hyoa_flowfield.GetSQLfieldBymudelidAndFieldidAndTableid(this.hy_mudelid.Text, hy_fieldid, this.hy_tableid.Text);

        int li_left = 30;
        int li_right = 70;
        if (dtfield.Rows.Count > 0)
        {
            string field_type = dtfield.Rows[0]["hy_fieldtype"].ToString();     //字段类型
            if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() != "5")   //如果设置了不显示左侧说明文字,则不加载左侧列
            {
                li_return += 1;
                //插入单元格(左侧)
                TableCell tCell = new TableCell();
                tRow.Cells.Add(tCell);
                tCell.Width = Unit.Percentage((li_left / li_colnums_show));
                tCell.Height = Unit.Pixel(30);
                tCell.CssClass = "Tdcellleft";
                tCell.HorizontalAlign = HorizontalAlign.Center;
                tCell.Controls.Add(new LiteralControl(dtfield.Rows[0]["hy_fieldname"].ToString()));
            }
            else
            {
                li_left = 50;
                li_right = 50;
            }
            //插入单元格(右侧)
            TableCell tCell2 = new TableCell();
            tRow.Cells.Add(tCell2);
            tCell2.Width = Unit.Percentage((li_right / li_colnums_show));
            tCell2.Height = Unit.Pixel(30);
            tCell2.CssClass = "Tdcellright";
            if (dtfield.Rows[0]["hy_align"].ToString() == "left")
            {
                tCell2.HorizontalAlign = HorizontalAlign.Left;
            }
            if (dtfield.Rows[0]["hy_align"].ToString() == "center")
            {
                tCell2.HorizontalAlign = HorizontalAlign.Center;
            }
            if (dtfield.Rows[0]["hy_align"].ToString() == "right")
            {
                tCell2.HorizontalAlign = HorizontalAlign.Right;
            }
            tCell2.ColumnSpan = int.Parse(dtfield.Rows[0]["hy_tdnums"].ToString());
            li_return += int.Parse(dtfield.Rows[0]["hy_tdnums"].ToString());

            //赋值(新文档取配置的默认值,旧文档取数据库表中的值)
            string field_docvalue = "";
            if (pi_isnewdoc == "0")     //新文档
            {
                if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() != "-1")
                {
                    if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "0")
                    {
                        field_docvalue = dtfield.Rows[0]["hy_defaultvalue"].ToString();     //手工配置
                    }
                    if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "1")
                    {
                        DataTable dt_getfieldvalue = Hyoa_global.GetDataTable(dtfield.Rows[0]["hy_defaultvalue"].ToString());
                        field_docvalue = dt_getfieldvalue.Rows[0][0].ToString();     //SQL语句
                    }
                    if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "2")
                    {
                        field_docvalue = Session[dtfield.Rows[0]["hy_defaultvalue"].ToString()].ToString();     //SESSION
                    }
                    if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "3")
                    {
                        if (dtfield.Rows[0]["hy_defaultvalue"].ToString() == "yyyy-mm-dd")
                            field_docvalue = System.DateTime.Now.ToString("yyyy-MM-dd");     //当前时间
                        else
                            field_docvalue = System.DateTime.Now.ToString("yyyy-MM-dd HH:MM:ss");     //当前时间
                    }
                    if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "4")
                    {
                        //自动生成
                        if (dtfield.Rows[0]["hy_fieldtype"].ToString() == "数值")
                        {
                            //得到目前最大的数值,然后+1,未找到则赋值为1
                            DataTable dt_autovalue = Hyoa_global.GetDataTable("select max(hyc_" + hy_fieldid + ") maxint from hyc_" + this.hy_tableid.Text);
                            if (dt_autovalue.Rows[0]["maxint"].ToString() == null || dt_autovalue.Rows[0]["maxint"].ToString() == "")
                                field_docvalue += "1";
                            else
                                field_docvalue += (System.Int32.Parse(dt_autovalue.Rows[0]["maxint"].ToString()) + 1).ToString();
                        }
                        else
                        {
                            field_docvalue += System.Guid.NewGuid().ToString();
                        }
                    }
                    if (dtfield.Rows[0]["hy_defaultvaluetype"].ToString() == "5")
                    {
                        field_docvalue += dtfield.Rows[0]["hy_defaultvalue"].ToString();
                    }
                }
            }
            else
            {
                if (field_type == "文本" || field_type == "多行文本" || field_type == "多行文本_TEXT" || field_type == "文本加按钮" || field_type == "多行文本加按钮" || field_type == "日期" || field_type == "数值" || field_type == "对话框列表" || field_type == "复选框" || field_type == "单选框" || field_type == "口令" || field_type == "编辑器")
                {
                    string ls_sql = "select hyc_" + hy_fieldid + " from hyc_" + this.hy_tableid.Text + " where DOCID='" + this.txtdocid.Value + "'";
                    DataTable dt_getdocvalue = Hyoa_global.GetDataTable(ls_sql);
                    if (dt_getdocvalue.Rows.Count > 0)
                    {
                        field_docvalue = dt_getdocvalue.Rows[0][0].ToString();
                        if (field_type == "日期")
                        {
                            if (field_docvalue.Length > 8)
                            {
                                if (field_docvalue.Substring(0, 8) == "1900-1-1")
                                {
                                    field_docvalue = "&nbsp;";
                                }
                                else
                                {
                                    if (dtfield.Rows[0]["hy_defaultvalue"].ToString() == "yyyy-mm-dd")
                                    {
                                        field_docvalue = System.DateTime.Parse(field_docvalue).ToString("yyyy-MM-dd");
                                    }
                                }
                            }
                        }
                    }
                }
                if (field_type == "说明文字")
                {
                    field_docvalue += dtfield.Rows[0]["hy_defaultvalue"].ToString();
                }
            }

            //判断是输出LABL还是INPUT
            if (pi_isnewdoc == "0")     //新文档
            {
                if (ifflowdoc == "0")   //非流程
                {
                    if (ifhavarole == "1")  //有权限
                    {
                        ls_laborinput = "1";
                    }
                }
                else
                {
                    if (ifhavarole == "1")  //有权限
                    {
                        //有流程(判断当前环节这个字段是否有权限)
                        HyoaClass.Hyoa_flowtachefield Hyoa_flowtachefield = new HyoaClass.Hyoa_flowtachefield();
                        ls_laborinput = Hyoa_flowtachefield.IfHaveRolebyflowidandtacheidandfieldid(hy_flowid.Text, curtacheid, hy_fieldid);
                        if (ls_laborinput == "0")
                        {
                            field_docvalue = "";
                        }
                    }
                    else
                    {
                        field_docvalue = "";
                    }
                }
            }
            else     //旧文档
            {
                if (ifflowdoc == "0")   //非流程
                {
                    if (ifhavarole == "1")  //有权限
                    {
                        ls_laborinput = "1";
                        //如果文档已经确认,则输出lable
                        string ls_sql = "select hy_ifconfirm from hyc_" + this.hy_tableid.Text + " where DOCID='" + this.txtdocid.Value + "'";
                        DataTable dt_getifconfirm = Hyoa_global.GetDataTable(ls_sql);
                        if (dt_getifconfirm.Rows.Count > 0)
                        {
                            if (dt_getifconfirm.Rows[0]["hy_ifconfirm"].ToString() == "1")
                                ls_laborinput = "0";
                        }
                    }
                }
                else
                {
                    if (ifhavarole == "1")  //有权限
                    {
                        //有流程(判断当前环节这个字段是否有权限)
                        HyoaClass.Hyoa_flowtachefield Hyoa_flowtachefield = new HyoaClass.Hyoa_flowtachefield();
                        ls_laborinput = Hyoa_flowtachefield.IfHaveRolebyflowidandtacheidandfieldid(hy_flowid.Text, curtacheid, hy_fieldid);
                        //如果流程结束了,则输出lable
                        if (hy_curtacheid.Text == "**")
                        {
                            ls_laborinput = "0";
                        }
                    }
                }
            }

            //如果是输出LABLE,值为空则赋为&nbsp;不为空时需要转换回车和空格
            if (ls_laborinput == "0")
            {
                if (field_docvalue == "")
                {
                    field_docvalue = "&nbsp;";
                }
                else
                {
                    if (field_type != "编辑器")
                    {
                        field_docvalue = RtfToText(field_docvalue);
                    }
                }
            }

            //单行文本
            if (field_type == "文本")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    TextBox txtTextBox = new TextBox();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是")
                    {
                        txtTextBox.ReadOnly = true;
                    }
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    if (dtfield.Rows[0]["hy_width"].ToString() != "")
                    {
                        txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onclick", dtfield.Rows[0]["hy_onclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_ondblclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("ondblclick", dtfield.Rows[0]["hy_ondblclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onchange"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onchange", dtfield.Rows[0]["hy_onchange"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeydown"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeydown", dtfield.Rows[0]["hy_onkeydown"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeyup"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeyup", dtfield.Rows[0]["hy_onkeyup"].ToString());
                    }
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //多行文本
            if (field_type == "多行文本")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    TextBox txtTextBox = new TextBox();
                    txtTextBox.TextMode = TextBoxMode.MultiLine;
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是")
                    {
                        txtTextBox.ReadOnly = true;
                    }
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    if (dtfield.Rows[0]["hy_width"].ToString() != "")
                    {
                        txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onclick", dtfield.Rows[0]["hy_onclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_ondblclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("ondblclick", dtfield.Rows[0]["hy_ondblclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onchange"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onchange", dtfield.Rows[0]["hy_onchange"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeydown"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeydown", dtfield.Rows[0]["hy_onkeydown"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeyup"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeyup", dtfield.Rows[0]["hy_onkeyup"].ToString());
                    }
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //多行文本_TEXT
            if (field_type == "多行文本_TEXT")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    TextBox txtTextBox = new TextBox();
                    txtTextBox.TextMode = TextBoxMode.MultiLine;
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是")
                    {
                        txtTextBox.ReadOnly = true;
                    }
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    if (dtfield.Rows[0]["hy_width"].ToString() != "")
                    {
                        txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onclick", dtfield.Rows[0]["hy_onclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_ondblclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("ondblclick", dtfield.Rows[0]["hy_ondblclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onchange"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onchange", dtfield.Rows[0]["hy_onchange"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeydown"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeydown", dtfield.Rows[0]["hy_onkeydown"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeyup"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeyup", dtfield.Rows[0]["hy_onkeyup"].ToString());
                    }
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //按钮
            if (field_type == "按钮")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = "&nbsp;";
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    field_docvalue = "<input type=button id='btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "' value='" + dtfield.Rows[0]["hy_fieldname"].ToString() + "' class=btn3 onclick=\"" + dtfield.Rows[0]["hy_onclick"].ToString() + "\" />";
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //一直显示的按钮
            if (field_type == "一直显示的按钮")
            {
                //-----开始输出字段------
                Label txtTextBox = new Label();
                txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                field_docvalue = "<input type=button id='btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "' value='" + dtfield.Rows[0]["hy_fieldname"].ToString() + "' class=btn3 onclick=\"" + dtfield.Rows[0]["hy_onclick"].ToString() + "\" />";
                txtTextBox.Text = field_docvalue;
                tCell2.Controls.Add(txtTextBox);
            }
            //日期
            if (field_type == "日期")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    TextBox txtTextBox = new TextBox();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是")
                    {
                        txtTextBox.ReadOnly = true;
                    }
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    if (dtfield.Rows[0]["hy_width"].ToString() != "")
                    {
                        txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onclick", dtfield.Rows[0]["hy_onclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_ondblclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("ondblclick", dtfield.Rows[0]["hy_ondblclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onchange"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onchange", dtfield.Rows[0]["hy_onchange"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeydown"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeydown", dtfield.Rows[0]["hy_onkeydown"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeyup"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeyup", dtfield.Rows[0]["hy_onkeyup"].ToString());
                    }
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //文本加按钮
            if (field_type == "文本加按钮")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    TextBox txtTextBox = new TextBox();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是")
                    {
                        txtTextBox.ReadOnly = true;
                    }
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    txtTextBox.Width = Unit.Parse("60%");
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                    Label txtTextBox2 = new Label();
                    txtTextBox2.ID = "span_" + dtfield.Rows[0]["hy_fieldid"].ToString();
                    field_docvalue = "<input type=button id='btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "' value=' 选 择 ' class=btn3 onclick=\"" + dtfield.Rows[0]["hy_onclick"].ToString() + "\" />";
                    txtTextBox2.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox2);
                }
            }
            //多行文本加按钮
            if (field_type == "多行文本加按钮")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    TextBox txtTextBox = new TextBox();
                    txtTextBox.TextMode = TextBoxMode.MultiLine;
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是")
                    {
                        txtTextBox.ReadOnly = true;
                    }
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    if (dtfield.Rows[0]["hy_width"].ToString() != "")
                    {
                        txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                    Label txtTextBox2 = new Label();
                    txtTextBox2.ID = "span_" + dtfield.Rows[0]["hy_fieldid"].ToString();
                    field_docvalue = "<input type=button id='btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "' value=' 选 择 ' class=btn3 onclick=\"" + dtfield.Rows[0]["hy_onclick"].ToString() + "\" />";
                    txtTextBox2.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox2);
                }
            }
            //意见加按钮
            if (field_type == "意见加按钮")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    TextBox txtTextBox = new TextBox();
                    txtTextBox.TextMode = TextBoxMode.MultiLine;
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是")
                    {
                        txtTextBox.ReadOnly = true;
                    }
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    if (dtfield.Rows[0]["hy_width"].ToString() != "")
                    {
                        txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    //txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                    Label txtTextBox2 = new Label();
                    txtTextBox2.ID = "span_" + dtfield.Rows[0]["hy_fieldid"].ToString();
                    field_docvalue = "<input type=button id='btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "' value=' 选 择 ' class=btn3 onclick=\"" + dtfield.Rows[0]["hy_onclick"].ToString() + "\" /><input type=button id='btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "_cz' value=' 重 置 ' class=btn3 onclick=\"document.getElementById('" + dtfield.Rows[0]["hy_fieldid"].ToString() + "').value='';\" />";
                    txtTextBox2.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox2);
                }
            }
            //数值
            if (field_type == "数值")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    TextBox txtTextBox = new TextBox();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是")
                    {
                        txtTextBox.ReadOnly = true;
                    }
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    if (dtfield.Rows[0]["hy_width"].ToString() != "")
                    {
                        txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onclick", dtfield.Rows[0]["hy_onclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_ondblclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("ondblclick", dtfield.Rows[0]["hy_ondblclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onchange"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onchange", dtfield.Rows[0]["hy_onchange"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeydown"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeydown", dtfield.Rows[0]["hy_onkeydown"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeyup"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeyup", dtfield.Rows[0]["hy_onkeyup"].ToString());
                    }
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //对话框列表(下拉框
            if (field_type == "对话框列表")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    DropDownList ddlDropDownList = new DropDownList();
                    ddlDropDownList.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        ddlDropDownList.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        ddlDropDownList.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onchange"].ToString() != "")
                    {
                        ddlDropDownList.Attributes.Add("onchange", dtfield.Rows[0]["hy_onchange"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_optiontype"].ToString() == "0")
                    {
                        //手工配置
                        if (dtfield.Rows[0]["hy_options"].ToString() != "")
                        {
                            string[] lv_options = dtfield.Rows[0]["hy_options"].ToString().Split('#');
                            for (int i = 0; i < lv_options.Length; i++)
                            {
                                ddlDropDownList.Items.Add(lv_options[i].ToString());
                            }
                        }
                    }
                    if (dtfield.Rows[0]["hy_optiontype"].ToString() == "1")
                    {
                        //SQL语句
                        if (dtfield.Rows[0]["hy_options"].ToString() != "")
                        {
                            //如果SQL语句中含有特殊标示,则需要替换
                            string ls_sql = dtfield.Rows[0]["hy_options"].ToString();
                            if (ls_sql.Contains("用户ID"))
                            {
                                ls_sql = ls_sql.Replace("用户ID", "'" + Session["hyuid"].ToString() + "'");
                            }
                            if (ls_sql.Contains("用户名"))
                            {
                                ls_sql = ls_sql.Replace("用户名", "'" + Session["hyuname"].ToString() + "'");
                            }
                            if (ls_sql.Contains("部门ID"))
                            {
                                ls_sql = ls_sql.Replace("部门ID", "'" + Session["hydeptid"].ToString() + "'");
                            }
                            if (ls_sql.Contains("部门名"))
                            {
                                ls_sql = ls_sql.Replace("部门名", "'" + Session["hydeptname"].ToString() + "'");
                            }
                            DataTable dt_options = Hyoa_global.GetDataTable(ls_sql);
                            ddlDropDownList.DataSource = dt_options;
                            ddlDropDownList.DataTextField = dt_options.Columns[0].ColumnName;
                            ddlDropDownList.DataValueField = dt_options.Columns[0].ColumnName;
                            ddlDropDownList.DataBind();
                        }
                    }
                    ddlDropDownList.Items.Insert(0, new ListItem("--请选择--", ""));
                    ddlDropDownList.SelectedValue = field_docvalue;
                    tCell2.Controls.Add(ddlDropDownList);
                }
            }
            //复选框(查询时直接显示文本框)
            if (field_type == "复选框")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    CheckBoxList txtTextBox = new CheckBoxList();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    if (dtfield.Rows[0]["hy_width"].ToString() != "")
                    {
                        txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onclick", dtfield.Rows[0]["hy_onclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_optiontype"].ToString() == "0")
                    {
                        //手工配置
                        if (dtfield.Rows[0]["hy_options"].ToString() != "")
                        {
                            string[] lv_options = dtfield.Rows[0]["hy_options"].ToString().Split('#');
                            for (int i = 0; i < lv_options.Length; i++)
                            {
                                txtTextBox.Items.Add(lv_options[i].ToString());
                            }
                        }
                    }
                    if (dtfield.Rows[0]["hy_optiontype"].ToString() == "1")
                    {
                        //SQL语句
                        //如果SQL语句中含有特殊标示,则需要替换
                        string ls_sql = dtfield.Rows[0]["hy_options"].ToString();
                        if (ls_sql.Contains("用户ID"))
                        {
                            ls_sql = ls_sql.Replace("用户ID", "'" + Session["hyuid"].ToString() + "'");
                        }
                        if (ls_sql.Contains("用户名"))
                        {
                            ls_sql = ls_sql.Replace("用户名", "'" + Session["hyuname"].ToString() + "'");
                        }
                        if (ls_sql.Contains("部门ID"))
                        {
                            ls_sql = ls_sql.Replace("部门ID", "'" + Session["hydeptid"].ToString() + "'");
                        }
                        if (ls_sql.Contains("部门名"))
                        {
                            ls_sql = ls_sql.Replace("部门名", "'" + Session["hydeptname"].ToString() + "'");
                        }
                        if (dtfield.Rows[0]["hy_options"].ToString() != "")
                        {
                            DataTable dt_options = Hyoa_global.GetDataTable(ls_sql);
                            txtTextBox.DataSource = dt_options;
                            txtTextBox.DataTextField = dt_options.Columns[0].ColumnName;
                            txtTextBox.DataValueField = dt_options.Columns[0].ColumnName;
                            txtTextBox.DataBind();
                        }
                    }
                    if (field_docvalue != "")
                    {
                        field_docvalue = "," + field_docvalue + ",";
                        foreach (ListItem li in txtTextBox.Items)
                        {
                            if (field_docvalue.Contains(li.Value))
                                li.Selected = true;
                        }
                    }
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //单选框(查询时直接显示文本框)
            if (field_type == "单选框")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    RadioButtonList txtTextBox = new RadioButtonList();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    if (dtfield.Rows[0]["hy_width"].ToString() != "")
                    {
                        txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onclick", dtfield.Rows[0]["hy_onclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_optiontype"].ToString() == "0")
                    {
                        //手工配置
                        if (dtfield.Rows[0]["hy_options"].ToString() != "")
                        {
                            string[] lv_options = dtfield.Rows[0]["hy_options"].ToString().Split('#');
                            for (int i = 0; i < lv_options.Length; i++)
                            {
                                txtTextBox.Items.Add(lv_options[i].ToString());
                            }
                        }
                    }
                    if (dtfield.Rows[0]["hy_optiontype"].ToString() == "1")
                    {
                        //SQL语句
                        //如果SQL语句中含有特殊标示,则需要替换
                        string ls_sql = dtfield.Rows[0]["hy_options"].ToString();
                        if (ls_sql.Contains("用户ID"))
                        {
                            ls_sql = ls_sql.Replace("用户ID", "'" + Session["hyuid"].ToString() + "'");
                        }
                        if (ls_sql.Contains("用户名"))
                        {
                            ls_sql = ls_sql.Replace("用户名", "'" + Session["hyuname"].ToString() + "'");
                        }
                        if (ls_sql.Contains("部门ID"))
                        {
                            ls_sql = ls_sql.Replace("部门ID", "'" + Session["hydeptid"].ToString() + "'");
                        }
                        if (ls_sql.Contains("部门名"))
                        {
                            ls_sql = ls_sql.Replace("部门名", "'" + Session["hydeptname"].ToString() + "'");
                        }
                        if (dtfield.Rows[0]["hy_options"].ToString() != "")
                        {
                            DataTable dt_options = Hyoa_global.GetDataTable(ls_sql);
                            txtTextBox.DataSource = dt_options;
                            txtTextBox.DataTextField = dt_options.Columns[0].ColumnName;
                            txtTextBox.DataValueField = dt_options.Columns[0].ColumnName;
                            txtTextBox.DataBind();
                        }
                    }
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //口令
            if (field_type == "口令")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = "&nbsp;";
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    TextBox txtTextBox = new TextBox();
                    txtTextBox.TextMode = TextBoxMode.Password;
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (dtfield.Rows[0]["hy_ifreadonly"].ToString() == "是")
                    {
                        txtTextBox.ReadOnly = true;
                    }
                    if (dtfield.Rows[0]["hy_class"].ToString() != "")
                    {
                        txtTextBox.CssClass = dtfield.Rows[0]["hy_class"].ToString();
                    }
                    if (dtfield.Rows[0]["hy_width"].ToString() != "")
                    {
                        txtTextBox.Width = Unit.Parse(dtfield.Rows[0]["hy_width"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_height"].ToString() != "")
                    {
                        txtTextBox.Height = Unit.Parse(dtfield.Rows[0]["hy_height"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onclick", dtfield.Rows[0]["hy_onclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_ondblclick"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("ondblclick", dtfield.Rows[0]["hy_ondblclick"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onchange"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onchange", dtfield.Rows[0]["hy_onchange"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeydown"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeydown", dtfield.Rows[0]["hy_onkeydown"].ToString());
                    }
                    if (dtfield.Rows[0]["hy_onkeyup"].ToString() != "")
                    {
                        txtTextBox.Attributes.Add("onkeyup", dtfield.Rows[0]["hy_onkeyup"].ToString());
                    }
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //附件组件
            if (field_type == "附件组件")
            {
                //读取附件内容
                HyoaClass.Hyoa_fileatt Hyoa_fileatt = new HyoaClass.Hyoa_fileatt();
                DataTable dt_fileatt = Hyoa_fileatt.GetfileattByFatheridandFatherfield(this.txtdocid.Value, hy_fieldid);
                field_docvalue = "";
                if (dt_fileatt.Rows.Count > 0)
                {
                    for (var ii = 0; ii < dt_fileatt.Rows.Count; ii++)
                    {
                        field_docvalue += (ii + 1).ToString() + "、<a href=\"" + dt_fileatt.Rows[ii]["hy_filepath"].ToString() + "\" target=_blank>" + dt_fileatt.Rows[ii]["hy_filename"].ToString() + "</a><br />";
                    }
                }
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    if (field_docvalue == "")
                    {
                        field_docvalue = "&nbsp;";
                    }
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    field_docvalue += "<input type=button id='uploadfile1' value='附件管理' class=btn3 onclick=\"window.open('ggdy/main_fileatt.aspx?fatherid=" + this.txtdocid.Value + "&fatherfield=" + hy_fieldid + "','filewindow','height=350,width=600,top=100,left=200,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no');\" />";
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //说明文字
            if (field_type == "说明文字")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //编辑器
            if (field_type == "编辑器")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    //隐藏文本框
                    TextBox txtTextBox = new TextBox();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    txtTextBox.Style.Value = "display:none";
                    tCell2.Controls.Add(txtTextBox);
                    //编辑器
                    Label txtTextBox2 = new Label();
                    txtTextBox2.ID = "eWebEditor" + dtfield.Rows[0]["hy_fieldid"].ToString();
                    field_docvalue = "<iframe ID=\"eWebEditor" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" src=\"system/eWebEditor/ewebeditor.htm?id=" + dtfield.Rows[0]["hy_fieldid"].ToString() + "&style=Portal\" frameborder=0 scrolling=no width=" + dtfield.Rows[0]["hy_width"].ToString() + " height=" + dtfield.Rows[0]["hy_height"].ToString() + "></iframe>";
                    txtTextBox2.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox2);
                }
            }
            //痕迹保留
            if (field_type == "痕迹保留")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    field_docvalue = "<input type=button id=\"btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" value='正  文' class=btn3 onclick=\"window.open('ntko/readoffice.aspx?newofficetype=1&fatherid=" + this.txtdocid.Value + "&tableid=" + this.hy_tableid.Text + "&tacheByhj=1&jsxd=1&rnd='+Math.random(),'hjblwindow','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');\" /> ";
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    field_docvalue = "<input type=button id=\"btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" value='正  文' class=btn3 onclick=\"window.open('ntko/editoffice.aspx?newofficetype=1&fatherid=" + this.txtdocid.Value + "&tableid=" + this.hy_tableid.Text + "&tacheByhj=1&jsxd=0&rnd='+Math.random(),'hjblwindow','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');\" /> ";
                    //如果是流程模块,则根据环节判断一下
                    if (ifflowdoc == "1")
                    {
                        //判断是否为第一环节
                        HyoaClass.Hyoa_flowwork Hyoa_flowwork = new HyoaClass.Hyoa_flowwork();
                        DataTable dtflowwork = Hyoa_flowwork.Getflowworkbyflowidtacheid(this.hy_flowid.Text, "*");
                        if (dtflowwork.Rows.Count > 0)
                        {
                            if (dtflowwork.Rows[0]["hy_nexttacheid"].ToString() == this.hy_curtacheid.Text)
                            {
                                field_docvalue = "<input type=button id=\"btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" value='正  文' class=btn3 onclick=\"window.open('ntko/editoffice.aspx?newofficetype=1&fatherid=" + this.txtdocid.Value + "&tableid=" + this.hy_tableid.Text + "&tacheByhj=1&jsxd=0&rnd='+Math.random(),'hjblwindow','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');\" /> ";
                            }
                            else
                            {
                                //判断是否为最后一个环节
                                dtflowwork.Clear();
                                dtflowwork = Hyoa_flowwork.Getflowworkbyflowidtacheid(this.hy_flowid.Text, this.hy_curtacheid.Text);
                                if (dtflowwork.Rows.Count > 0)
                                {
                                    if (dtflowwork.Rows[0]["hy_nexttacheid"].ToString() == "**")
                                    {
                                        field_docvalue = "<input type=button id=\"btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" value='正  文' class=btn3 onclick=\"window.open('ntko/editoffice.aspx?newofficetype=1&fatherid=" + this.txtdocid.Value + "&tableid=" + this.hy_tableid.Text + "&tacheByhj=0&jsxd=1&rnd='+Math.random(),'hjblwindow','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');\" /> ";
                                    }
                                    else
                                    {
                                        field_docvalue = "<input type=button id=\"btn_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" value='正  文' class=btn3 onclick=\"window.open('ntko/editoffice.aspx?newofficetype=1&fatherid=" + this.txtdocid.Value + "&tableid=" + this.hy_tableid.Text + "&tacheByhj=0&jsxd=0&rnd='+Math.random(),'hjblwindow','height=768,width=1024,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');\" /> ";
                                    }
                                }

                            }
                        }
                    }
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //IFRAME列表
            if (field_type == "IFRAME列表")
            {
                //-----开始输出字段------
                if (ls_laborinput == "0")   //输出LABLE
                {
                    field_docvalue = "<iframe id=\"ifr_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" name=\"ifr_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" src=\"" + dtfield.Rows[0]["hy_defaultvalue"].ToString() + "&motherid=" + this.txtdocid.Value + "&ishaverole=0\" frameborder=\"0\" scrolling=\"yes\" height=\"80px\" width=\"98%\"></iframe>";
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
                else
                {
                    field_docvalue = "<iframe id=\"ifr_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" name=\"ifr_" + dtfield.Rows[0]["hy_fieldid"].ToString() + "\" src=\"" + dtfield.Rows[0]["hy_defaultvalue"].ToString() + "&motherid=" + this.txtdocid.Value + "&ishaverole=1\" frameborder=\"0\" scrolling=\"yes\" height=\"80px\" width=\"98%\"></iframe>";
                    Label txtTextBox = new Label();
                    txtTextBox.ID = dtfield.Rows[0]["hy_fieldid"].ToString();
                    txtTextBox.Text = field_docvalue;
                    tCell2.Controls.Add(txtTextBox);
                }
            }
            //子表信息带链接

            //子表信息不带链接

        }
        return li_return;
    }
Ejemplo n.º 34
0
 public void llenaCheckList(CheckBoxList dw, String sentencia, String nombre, String valor, String id)
 {
     conectar();
     DataSet Ds = new DataSet();
     SqlDataAdapter Adapter = new SqlDataAdapter(sentencia, con);
     Adapter.Fill(Ds, nombre);
     dw.DataSource = Ds.Tables[0].DefaultView;
     dw.DataTextField = valor;
     dw.DataValueField = id; dw.DataBind();
     desconectar();
 }
    /// <summary>
    /// This method will be called whenever the selected faculty will be changed in the dropdown.
    /// This method will show the gridview where the Admin can map the faculties and subjects.
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void DDLFaculty_SelectedIndexChanged(object sender, EventArgs e)
    {
        //If the selected semester is EVEN
        if (RBLSemesterType.SelectedItem.Text.Equals("Even"))
        {
            //Select the list of Subject taught in even semester.
            sql = "SELECT * from Subject  where DepartmentID=" + int.Parse(Session["DepartmentID"].ToString()) + " and Semester in (2,4,6,8)";
        }

        //If the selected semester is ODD.
        else
        {
            //Select the list of Subject taught in Odd semester.
            sql = "SELECT * from Subject  where DepartmentID=" + int.Parse(Session["DepartmentID"].ToString()) + " and Semester in (1,3,5,7)";
        }
        c = new Connect(sql);
        GridView1.DataSource = c.ds;
        GridView1.DataBind();

        //Logic to add the checkbox list for each department.
        foreach (GridViewRow row in GridView1.Rows)
        {
            //Adds the checkboxes for each section if subject type is theory.
            if (row.Cells[3].Text.Equals("Theory"))
            {
                sql = "SELECT SectionName,SectionID from Section where DepartmentID=" + int.Parse(Session["DepartmentID"].ToString()) + "";
                c = new Connect(sql);
                CheckBoxList cl = new CheckBoxList();
                cl.DataSource = c.ds;
                cl.DataTextField = "SectionName";
                cl.DataValueField = "SectionID";
                cl.DataBind();
                cl.ID = "CBLSection";
                cl.RepeatDirection = RepeatDirection.Horizontal;
                row.Cells[5].Controls.Add(cl);
            }

            //Adds the checkboxes for each group if subject type is practical.
            else
            {
                sql = "SELECT GroupName,GroupID FROM Groups WHERE SectionID in (SELECT SectionID FROM Section WHERE DepartmentID=" + int.Parse(Session["DepartmentID"].ToString()) + ")";
                c = new Connect(sql);
                CheckBoxList cl = new CheckBoxList();
                cl.DataSource = c.ds;
                cl.DataTextField = "GroupName";
                cl.DataValueField = "GroupID";
                cl.DataBind();
                cl.ID = "CBLGroup";
                cl.RepeatDirection = RepeatDirection.Horizontal;
                row.Cells[5].Controls.Add(cl);
            }
        }

        //Logic to check the Subject which are already mapped.
        sql = "SELECT * from Teaches WHERE FacultyID=" + DDLFaculty.SelectedValue + "";
        c = new Connect(sql);
        foreach (GridViewRow row in GridView1.Rows)
        {
            for (int i = 0; i < c.ds.Tables[0].Rows.Count; i++)
            {
                sql = "SELECT SubjectID from Subject WHERE SubjectName='" + row.Cells[1].Text + "' AND DepartmentID=" + int.Parse(Session["DepartmentID"].ToString()) + "";
                c_subID = new Connect(sql);
                if (c.ds.Tables[0].Rows[i]["SubjectID"].ToString() == c_subID.ds.Tables[0].Rows[0]["SubjectID"].ToString())
                {
                    ((CheckBox)row.FindControl("CheckBox1")).Checked = true;
                    if (row.Cells[3].Text.Equals("Theory"))
                    {
                        CheckBoxList cbl = (CheckBoxList)row.FindControl("CBLSection");
                        foreach (ListItem li in cbl.Items)
                        {
                            if (li.Value.ToString() == c.ds.Tables[0].Rows[i]["SectionID"].ToString())
                                li.Selected = true;
                        }
                    }
                    else
                    {
                        CheckBoxList cbl = (CheckBoxList)row.FindControl("CBLGroup");
                        foreach (ListItem li in cbl.Items)
                        {
                            if (li.Value.ToString() == c.ds.Tables[0].Rows[i]["GroupID"].ToString())
                                li.Selected = true;
                        }
                    }
                }
            }
        }
        BtnSubmit.Visible = true;
    }
    /// <summary>
    /// This method will be called whenever this page is loaded.
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        //Checks if the user is logged in or not. If not then he will be redirected to Default page.
        if (Session["Role"] == null)
        {
            Response.Redirect("~/Default.aspx");
        }

        //Checks if the user is Admin or not . If not then he will be redirected to Default page.
        if (!Session["Role"].ToString().Equals("Admin"))
        {
            Response.Redirect("~/Default.aspx");
        }

        //If the user is Admin then this code executes.
        else
        {
            //Logic to add the checkbox list for each department.
            foreach (GridViewRow row in GridView1.Rows)
            {
                //Adds the checkboxes for each section if subject type is theory.
                if (row.Cells[3].Text.Equals("Theory"))
                {
                    sql = "SELECT SectionName,SectionID from Section where DepartmentID=" + int.Parse(Session["DepartmentID"].ToString()) + "";
                    c = new Connect(sql);
                    CheckBoxList cl = new CheckBoxList();
                    cl.DataSource = c.ds;
                    cl.DataTextField = "SectionName";
                    cl.DataValueField = "SectionID";
                    cl.DataBind();
                    cl.ID = "CBLSection";
                    cl.RepeatDirection = RepeatDirection.Horizontal;
                    row.Cells[5].Controls.Add(cl);
                }

                //Adds the checkboxes for each group if subject type is practical.
                else
                {
                    sql = "SELECT GroupName,GroupID FROM Groups WHERE SectionID in (SELECT SectionID FROM Section WHERE DepartmentID=" + int.Parse(Session["DepartmentID"].ToString()) + ")";
                    c = new Connect(sql);
                    CheckBoxList cl = new CheckBoxList();
                    cl.DataSource = c.ds;
                    cl.DataTextField = "GroupName";
                    cl.DataValueField = "GroupID";
                    cl.DataBind();
                    cl.ID = "CBLGroup";
                    cl.RepeatDirection = RepeatDirection.Horizontal;
                    row.Cells[5].Controls.Add(cl);
                }
            }
        }
    }
Ejemplo n.º 37
0
    protected void Page_Init(object sender, EventArgs e)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        string USER_ID = "";
        try
        {
            //Ajax.Utility.RegisterTypeForAjax(typeof(User));

            //if (!IsPostBack)
            //{
            //    FriendsButton.Attributes.Add("onmouseover", "this.src='image/MyFriendsHover.png'");
            //    FriendsButton.Attributes.Add("onmouseout", "this.src='image/MyFriends.png'");

            //}
            //else
            //{
            //    FriendsButton.Attributes.Remove("onmouseover");
            //    FriendsButton.Attributes.Remove("onmouseout");
            //    MessagesButton.Attributes.Remove("onmouseover");
            //    MessagesButton.Attributes.Remove("onmouseout");
            //}

            //FOR USER PREFERENCES
            Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
            MessageRadWindowManager.VisibleOnPageLoad = false;

            if (!IsPostBack)
            {
                try
                {

                    if (Session["User"] != null)
                    {
                    }
                    else
                    {
                        Button calendarLink = (Button)dat.FindControlRecursive(this, "CalendarLink");
                        calendarLink.Visible = false;
                        Response.Redirect("~/UserLogin.aspx");
                    }
                }
                catch (Exception ex)
                {
                    ErrorLabel.Text = ex.ToString();
                   Response.Redirect("~/UserLogin.aspx");
                }

                USER_ID = Session["User"].ToString();

                //DataSet dsCat = dat.GetData("SELECT * FROM Categories");
                //CategoriesCheckBoxes.DataSource = dsCat;
                //CategoriesCheckBoxes.DataTextField = "CategoryName";
                //CategoriesCheckBoxes.DataValueField = "ID";
                //CategoriesCheckBoxes.DataBind();

                DataSet dsProvider = dat.GetData("SELECT * FROM PhoneProviders");
                ProviderDropDown.DataSource = dsProvider;
                ProviderDropDown.DataTextField = "Provider";
                ProviderDropDown.DataValueField = "ID";
                ProviderDropDown.DataBind();

                Data d = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
                DataSet ds = d.GetData("SELECT * FROM Events E, Venues V, Event_Occurance EO, User_Calendar UC WHERE UC.EventID=E.ID AND E.ID=EO.EventID AND E.Venue=V.ID AND UC.UserID=" + USER_ID);
                DataSet dsUser = d.GetData("SELECT * FROM Users WHERE User_ID=" + USER_ID);
                DataSet dsUserPrefs = d.GetData("SELECT * FROM UserPreferences WHERE UserID=" + USER_ID);

                if (dsUser.Tables[0].Rows[0]["FirstName"] != null)
                    FirstNameTextBox.THE_TEXT = dsUser.Tables[0].Rows[0]["FirstName"].ToString();

                if (dsUser.Tables[0].Rows[0]["LastName"] != null)
                    LastNameTextBox.THE_TEXT = dsUser.Tables[0].Rows[0]["LastName"].ToString();

                if (dsUserPrefs.Tables.Count > 0)
                    if (dsUserPrefs.Tables[0].Rows.Count > 0)
                    {
                        //AgeTextBox.Text = dsUserPrefs.Tables[0].Rows[0]["Age"].ToString();
                        SexTextBox.Text = dsUserPrefs.Tables[0].Rows[0]["Sex"].ToString();

                        LocationTextBox.Text = dsUserPrefs.Tables[0].Rows[0]["Location"].ToString();

                        string eventsPosted = "0";
                        DataSet dsEvents = dat.GetData("SELECT COUNT(*) AS COUNT1 FROM Events WHERE UserName='******'");
                        if (dsEvents.Tables.Count > 0)
                            if (dsEvents.Tables[0].Rows.Count > 0)
                                eventsPosted = dsEvents.Tables[0].Rows[0]["COUNT1"].ToString();
                        EventsLabel.Text = eventsPosted;
                        AttendedLabel.Text = dsUserPrefs.Tables[0].Rows[0]["EventsAttended"].ToString();

                        if (dsUserPrefs.Tables[0].Rows[0]["CalendarPrivacyMode"].ToString() != null)
                        {
                            PublicPrivateCheckList.SelectedValue = dsUserPrefs.Tables[0].Rows[0]["CalendarPrivacyMode"].ToString();
                        }

                        //if (dsUserPrefs.Tables[0].Rows[0]["PollPreferences"].ToString() != null)
                        //{
                        //    PollRadioList.SelectedValue = dsUserPrefs.Tables[0].Rows[0]["PollPreferences"].ToString();
                        //}

                        if (dsUserPrefs.Tables[0].Rows[0]["CommentsPreferences"].ToString() != null)
                        {
                            CommentsRadioList.SelectedValue = dsUserPrefs.Tables[0].Rows[0]["CommentsPreferences"].ToString();
                        }
                        RadioButtonList CategoriesOnOffRadioList = (RadioButtonList)AdCategoryRadPanel.Items[0].Items[0].FindControl("CategoriesOnOffRadioList");
                        if (dsUserPrefs.Tables[0].Rows[0]["CategoriesOnOff"].ToString() != null)
                        {
                            if (bool.Parse(dsUserPrefs.Tables[0].Rows[0]["CategoriesOnOff"].ToString()))
                                CategoriesOnOffRadioList.SelectedValue = "1";
                            else
                                CategoriesOnOffRadioList.SelectedValue = "2";
                        }

                        if(dsUserPrefs.Tables[0].Rows[0]["RecommendationPrefs"].ToString() != null){
                            string recom = dsUserPrefs.Tables[0].Rows[0]["RecommendationPrefs"].ToString();
                            if (recom.Contains("1"))
                                RecommendationsCheckList.Items[0].Selected = true;
                            if (recom.Contains("2"))
                                RecommendationsCheckList.Items[1].Selected = true;
                            if (recom.Contains("3"))
                                RecommendationsCheckList.Items[2].Selected = true;
                        }

                        if (dsUserPrefs.Tables[0].Rows[0]["CommunicationPrefs"].ToString() != null)
                        {
                            CommunicationPrefsRadioList.SelectedValue =
                                dsUserPrefs.Tables[0].Rows[0]["CommunicationPrefs"].ToString();
                        }

                        if (dsUserPrefs.Tables[0].Rows[0]["Country"].ToString() != null)
                        {
                            if (dsUserPrefs.Tables[0].Rows[0]["Country"].ToString().Trim() != "")
                            {
                                if (dsUserPrefs.Tables[0].Rows[0]["Address"].ToString() != null)
                                {
                                    AddressTextBox.THE_TEXT = dsUserPrefs.Tables[0].Rows[0]["Address"].ToString();
                                }

                                if (dsUserPrefs.Tables[0].Rows[0]["City"].ToString() != null)
                                {
                                    BillCityTextBox.THE_TEXT = dsUserPrefs.Tables[0].Rows[0]["City"].ToString();
                                }

                                if (dsUserPrefs.Tables[0].Rows[0]["ZIP"].ToString() != null)
                                {
                                    ZipTextBox.THE_TEXT = dsUserPrefs.Tables[0].Rows[0]["ZIP"].ToString();
                                }

                                BillCountryDropDown.SelectedValue = dsUserPrefs.Tables[0].Rows[0]["Country"].ToString();

                                DataSet dsStates = dat.GetData("SELECT * FROM State WHERE country_id=" + dsUserPrefs.Tables[0].Rows[0]["Country"].ToString());

                                bool isText = false;
                                if (dsStates.Tables.Count > 0)
                                    if (dsStates.Tables[0].Rows.Count > 0)
                                    {
                                        BillStateDropDown.DataSource = dsStates;
                                        BillStateDropDown.DataTextField = "state_2_code";
                                        BillStateDropDown.DataValueField = "state_id";
                                        BillStateDropDown.DataBind();
                                        BillStateDropDown.Items.Insert(0, new ListItem("Select State..", "-1"));

                                        if (dsUserPrefs.Tables[0].Rows[0]["State"].ToString() != null)
                                        {
                                            ListItem a = BillStateDropDown.Items.FindByText(dsUserPrefs.Tables[0].Rows[0]["State"].ToString());
                                            if (a != null)
                                                BillStateDropDown.SelectedValue = a.Value;
                                        }

                                        BillStateDropPanel.Visible = true;
                                        BillStateTextPanel.Visible = false;
                                    }
                                    else
                                    {
                                        isText = true;
                                    }
                                else
                                    isText = true;

                                if (isText)
                                {
                                    if (dsUserPrefs.Tables[0].Rows[0]["State"].ToString() != null)
                                    {
                                        BillStateTextBox.THE_TEXT = dsUserPrefs.Tables[0].Rows[0]["State"].ToString();
                                    }
                                    BillStateTextPanel.Visible = true;
                                    BillStateDropPanel.Visible = false;
                                }
                            }
                        }
                        if (dsUserPrefs.Tables[0].Rows[0]["CatCountry"].ToString() != null)
                        {
                            if (dsUserPrefs.Tables[0].Rows[0]["CatCountry"].ToString().Trim() != "")
                            {
                                if (dsUserPrefs.Tables[0].Rows[0]["CatCity"].ToString() != null)
                                {
                                    CityTextBox.THE_TEXT = dsUserPrefs.Tables[0].Rows[0]["CatCity"].ToString();
                                }

                                if (dsUserPrefs.Tables[0].Rows[0]["CatZip"].ToString() != null)
                                {
                                    if (dsUserPrefs.Tables[0].Rows[0]["CatZip"].ToString().Trim() != "")
                                    {
                                        char[] delim = { ';' };
                                        string[] tokens = dsUserPrefs.Tables[0].Rows[0]["CatZip"].ToString().Split(delim);

                                        if(tokens.Length > 1)
                                            CatZipTextBox.THE_TEXT = tokens[1].Trim();
                                    }
                                }

                                if (dsUserPrefs.Tables[0].Rows[0]["Radius"].ToString() != null)
                                {
                                    RadiusDropDown.SelectedValue =
                                        dsUserPrefs.Tables[0].Rows[0]["Radius"].ToString();
                                }

                                CountryDropDown.SelectedValue = dsUserPrefs.Tables[0].Rows[0]["CatCountry"].ToString();

                                DataSet dsStates = dat.GetData("SELECT * FROM State WHERE country_id=" + dsUserPrefs.Tables[0].Rows[0]["CatCountry"].ToString());

                                bool isText = false;
                                if (dsStates.Tables.Count > 0)
                                    if (dsStates.Tables[0].Rows.Count > 0)
                                    {
                                        StateDropDown.DataSource = dsStates;
                                        StateDropDown.DataTextField = "state_2_code";
                                        StateDropDown.DataValueField = "state_id";
                                        StateDropDown.DataBind();

                                        if (dsUserPrefs.Tables[0].Rows[0]["CatState"] != null)
                                        {
                                            StateDropDown.SelectedValue = StateDropDown.Items.FindByText(dsUserPrefs.Tables[0].Rows[0]["CatState"].ToString()).Value;
                                        }

                                        StateDropDownPanel.Visible = true;
                                        StateTextBoxPanel.Visible = false;
                                    }
                                    else
                                    {
                                        isText = true;
                                    }
                                else
                                    isText = true;

                                if (isText)
                                {
                                    if (dsUserPrefs.Tables[0].Rows[0]["CatState"].ToString() != null)
                                    {
                                        StateTextBox.THE_TEXT = dsUserPrefs.Tables[0].Rows[0]["CatState"].ToString();
                                    }
                                    StateTextBoxPanel.Visible = true;
                                    StateDropDownPanel.Visible = false;
                                }
                            }
                        }
                        if (dsUserPrefs.Tables[0].Rows[0]["TextingPrefs"].ToString() != null)
                        {
                            if (dsUserPrefs.Tables[0].Rows[0]["TextingPrefs"].ToString().Contains("1"))
                                TextingCheckBoxList.Items[0].Selected = true;
                            if (dsUserPrefs.Tables[0].Rows[0]["TextingPrefs"].ToString().Contains("2"))
                                TextingCheckBoxList.Items[1].Selected = true;
                            if (dsUserPrefs.Tables[0].Rows[0]["TextingPrefs"].ToString().Contains("3"))
                                TextingCheckBoxList.Items[2].Selected = true;
                        }

                        if (dsUserPrefs.Tables[0].Rows[0]["EmailPrefs"].ToString() != null)
                        {
                            if (dsUserPrefs.Tables[0].Rows[0]["EmailPrefs"].ToString().Contains("1"))
                                EmailCheckList.Items[0].Selected = true;
                            if (dsUserPrefs.Tables[0].Rows[0]["EmailPrefs"].ToString().Contains("2"))
                                EmailCheckList.Items[1].Selected = true;
                            if (dsUserPrefs.Tables[0].Rows[0]["EmailPrefs"].ToString().Contains("3"))
                                EmailCheckList.Items[2].Selected = true;

                            if (dsUserPrefs.Tables[0].Rows[0]["EmailPrefs"].ToString().Contains(EmailUserCheckList1.Items[0].Value))
                                EmailUserCheckList1.Items[0].Selected = true;
                            if (dsUserPrefs.Tables[0].Rows[0]["EmailPrefs"].ToString().Contains(EmailUserCheckList1.Items[1].Value))
                                EmailUserCheckList1.Items[1].Selected = true;
                            if (dsUserPrefs.Tables[0].Rows[0]["EmailPrefs"].ToString().Contains(EmailUserCheckList1.Items[2].Value))
                                EmailUserCheckList1.Items[2].Selected = true;

                            if (dsUserPrefs.Tables[0].Rows[0]["EmailPrefs"].ToString().Contains(EmailUserCheckList2.Items[0].Value))
                                EmailUserCheckList2.Items[0].Selected = true;
                            if (dsUserPrefs.Tables[0].Rows[0]["EmailPrefs"].ToString().Contains(EmailUserCheckList2.Items[1].Value))
                                EmailUserCheckList2.Items[1].Selected = true;
                            if (dsUserPrefs.Tables[0].Rows[0]["EmailPrefs"].ToString().Contains(EmailUserCheckList2.Items[2].Value))
                                EmailUserCheckList2.Items[2].Selected = true;

                            if (dsUserPrefs.Tables[0].Rows[0]["EmailPrefs"].ToString().Contains("C"))
                                EmailCheckList3.Items[0].Selected = true;
                        }
                    }

                DataSet dsComments = d.GetData("SELECT * FROM User_Comments CU, Users U WHERE CU.CommenterID=U.User_ID AND CU.UserID=" + USER_ID.ToString());
                //Label UserNameLabel = (Label)Tab3.FindControl("UserNameLabel");

                //UserNameLabel.Text = dsUser.Tables[0].Rows[0]["UserName"].ToString();

                if (dsUser.Tables[0].Rows[0]["Email"].ToString() != null)
                {
                    EmailTextBox.Text = dsUser.Tables[0].Rows[0]["Email"].ToString();
                }

                if (dsUser.Tables[0].Rows[0]["PhoneNumber"].ToString() != null)
                {
                    PhoneTextBox.THE_TEXT = dsUser.Tables[0].Rows[0]["PhoneNumber"].ToString();
                }

                if (dsUser.Tables[0].Rows[0]["PhoneProvider"].ToString() != null)
                {
                    ProviderDropDown.SelectedValue = dsUser.Tables[0].Rows[0]["PhoneProvider"].ToString();
                }

                Image FriendImage = (Image)Tab3.FindControl("FriendImage");

                if (dsUser.Tables[0].Rows[0]["ProfilePicture"].ToString() != null)
                {
                    if (System.IO.File.Exists(Server.MapPath(".") + "/UserFiles/" + dsUser.Tables[0].Rows[0]["UserName"].ToString() + "/Profile/" + dsUser.Tables[0].Rows[0]["ProfilePicture"].ToString()))
                    {
                        System.Drawing.Image theimg = System.Drawing.Image.FromFile(Server.MapPath(".") + "/UserFiles/" + dsUser.Tables[0].Rows[0]["UserName"].ToString() +
                "/Profile/" + dsUser.Tables[0].Rows[0]["ProfilePicture"].ToString());

                        double width = double.Parse(theimg.Width.ToString());
                        double height = double.Parse(theimg.Height.ToString());

                        if (width > height)
                        {
                            if (width <= 150)
                            {

                            }
                            else
                            {
                                double dividor = double.Parse("150.00") / double.Parse(width.ToString());
                                width = double.Parse("150.00");
                                height = height * dividor;
                            }
                        }
                        else
                        {
                            if (width == height)
                            {
                                width = double.Parse("150.00");
                                height = double.Parse("150.00");
                            }
                            else
                            {
                                double dividor = double.Parse("150.00") / double.Parse(height.ToString());
                                height = double.Parse("150.00");
                                width = width * dividor;
                            }
                        }

                        FriendImage.Width = int.Parse((Math.Round(decimal.Parse(width.ToString()))).ToString());
                        FriendImage.Height = int.Parse((Math.Round(decimal.Parse(height.ToString()))).ToString());

                        FriendImage.ImageUrl = "~/UserFiles/" + dsUser.Tables[0].Rows[0]["UserName"].ToString() + "/Profile/" + dsUser.Tables[0].Rows[0]["ProfilePicture"].ToString();
                        Session["ProfilePicture"] = dsUser.Tables[0].Rows[0]["ProfilePicture"].ToString();
                    }
                    else
                    {
                        FriendImage.ImageUrl = "~/NewImages/NoAvatar150.jpg";
                    }
                }
                else
                    FriendImage.ImageUrl = "~/NewImages/NoAvatar150.jpg";
            }
            else
            {
                if (Session["User"] == null)
                {
                    ErrorLabel.Text = "something happen";
                    //Session.Abandon();
                    Response.Redirect("~/UserLogin.aspx");

                }
            }

            DataSet dsVenues = dat.GetData("SELECT * FROM UserVenues UV, Venues V WHERE V.ID=UV.VenueID AND UV.UserID=" + Session["User"].ToString());

            VenuesRadPanel.Items[0].Text = "<div style=\" background-color: #1b1b1b; cursor: pointer;" +
                "\"><label class=\"PreferencesTitle\" style=\"cursor: pointer !important;\">Favorite Venues</label><span " +
                "style=\"font-style: italic; font-family: Arial; font-size: 14px; color: #666666;\">" +
                " (Click to drop down the list. Un-check to remove a venue from the favorites list.)</span></div>";

            //"<div style=\"border-bottom: dotted 1px black; " +
            //    "padding-top: 10px;\"><label class=\"PreferencesTitle\">Favorite Venues</label><span " +
            //    "style=\"font-style: italic; font-family: Arial; font-size: 14px; color: #666666;\">" +
            //    "(You can add these from the <a href=\"VenueSearch.aspx\" class=\"AddLink\">Venues Page</a>. " +
            //    "Un-check to remove a venue from the favorites list.)</span></div>";

            CheckBoxList VenueCheckBoxes = new CheckBoxList();
            VenueCheckBoxes.Width = 560;
            VenueCheckBoxes.CssClass = "VenueCheckBoxes";
            VenueCheckBoxes.ID = "VenueCheckBoxes";
            VenueCheckBoxes.RepeatColumns = 4;
            VenueCheckBoxes.RepeatDirection = RepeatDirection.Horizontal;

            VenueCheckBoxes.DataSource = dsVenues;
            VenueCheckBoxes.DataTextField = "NAME";
            VenueCheckBoxes.DataValueField = "ID";
            VenueCheckBoxes.DataBind();

            for (int i = 0; i < VenueCheckBoxes.Items.Count; i++)
            {
                VenueCheckBoxes.Items[i].Selected = true;
            }

            if (VenueCheckBoxes.Items.Count == 0)
            {
                Label label = new Label();
                label.CssClass = "VenueCheckBoxes";
                label.Text = "You have no venues specified as your favorite. To add venues as your favorites search for them on the <a href=\"VenueSearch.aspx\" class=\"AddLink\">Venues Page</a>";
                VenuesRadPanel.Items[0].Items[0].Controls.Add(label);
            }
            else
            {
                VenuesRadPanel.Items[0].Items[0].Controls.Add(VenueCheckBoxes);
            }

            VenuesRadPanel.CollapseAllItems();
        }
        catch (Exception ex)
        {
            UserErrorLabel.Text = ex.ToString();
        }

        if (Request.QueryString["p"] != null)
        {
            RadTabStrip2.Tabs[2].Selected = true;
            RadTabStrip2.Tabs[2].CssClass = "MyTabsPreferencesSelected";
            RadTabStrip2.Tabs[0].CssClass = "MyTabsMessages";
            RadTabStrip2.Tabs[1].CssClass = "MyTabsFriends";
            TheMultipage.PageViews[2].Selected = true;
        }

        if (Request.QueryString["G"] != null)
        {
            RadTabStrip2.Tabs[3].Selected = true;
            RadTabStrip2.Tabs[3].CssClass = "MyTabsGroupsSelected";
            RadTabStrip2.Tabs[0].CssClass = "MyTabsMessages";
            RadTabStrip2.Tabs[1].CssClass = "MyTabsFriends";
            RadTabStrip2.Tabs[2].CssClass = "MyTabsPreferences";
            TheMultipage.PageViews[3].Selected = true;
        }
    }
Ejemplo n.º 38
0
    protected void Page_Init(object sender, EventArgs e)
    {
        HttpCookie cookie = Request.Cookies["BrowserDate"];
        string USER_ID = "";
        try
        {
            //Ajax.Utility.RegisterTypeForAjax(typeof(User));

            //if (!IsPostBack)
            //{
            //    FriendsButton.Attributes.Add("onmouseover", "this.src='image/MyFriendsHover.png'");
            //    FriendsButton.Attributes.Add("onmouseout", "this.src='image/MyFriends.png'");

            //}
            //else
            //{
            //    FriendsButton.Attributes.Remove("onmouseover");
            //    FriendsButton.Attributes.Remove("onmouseout");
            //    MessagesButton.Attributes.Remove("onmouseover");
            //    MessagesButton.Attributes.Remove("onmouseout");
            //}

            //FOR USER PREFERENCES
            Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
            MessageRadWindowManager.VisibleOnPageLoad = false;

            if (!IsPostBack)
            {
                try
                {

                    if (Session["User"] != null)
                    {
                    }
                    else
                    {
                        Button calendarLink = (Button)dat.FindControlRecursive(this, "CalendarLink");
                        calendarLink.Visible = false;
                        Response.Redirect("~/login");
                    }
                }
                catch (Exception ex)
                {
                    ErrorLabel.Text = ex.ToString();
                   Response.Redirect("~/login");
                }

                USER_ID = Session["User"].ToString();

                //DataSet dsCat = dat.GetData("SELECT * FROM Categories");
                //CategoriesCheckBoxes.DataSource = dsCat;
                //CategoriesCheckBoxes.DataTextField = "CategoryName";
                //CategoriesCheckBoxes.DataValueField = "ID";
                //CategoriesCheckBoxes.DataBind();

                DataSet dsProvider = dat.GetData("SELECT * FROM PhoneProviders");
                ProviderDropDown.DataSource = dsProvider;
                ProviderDropDown.DataTextField = "Provider";
                ProviderDropDown.DataValueField = "ID";
                ProviderDropDown.DataBind();

                Data d = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
                DataSet ds = d.GetData("SELECT * FROM Events E, Venues V, Event_Occurance EO, User_Calendar UC WHERE UC.EventID=E.ID AND E.ID=EO.EventID AND E.Venue=V.ID AND UC.UserID=" + USER_ID);
                DataSet dsUser = d.GetData("SELECT * FROM Users WHERE User_ID=" + USER_ID);
                DataSet dsUserPrefs = d.GetData("SELECT * FROM UserPreferences WHERE UserID=" + USER_ID);

                WeeklyCheckBox.Checked = bool.Parse(dsUser.Tables[0].Rows[0]["Weekly"].ToString());

                if (dsUser.Tables[0].Rows[0]["FirstName"] != null)
                    FirstNameTextBox.Text = dsUser.Tables[0].Rows[0]["FirstName"].ToString();

                if (dsUser.Tables[0].Rows[0]["LastName"] != null)
                    LastNameTextBox.Text = dsUser.Tables[0].Rows[0]["LastName"].ToString();

                if (dsUserPrefs.Tables.Count > 0)
                    if (dsUserPrefs.Tables[0].Rows.Count > 0)
                    {
                        //AgeTextBox.Text = dsUserPrefs.Tables[0].Rows[0]["Age"].ToString();
                        SexTextBox.Text = dsUserPrefs.Tables[0].Rows[0]["Sex"].ToString();

                        LocationTextBox.Text = dsUserPrefs.Tables[0].Rows[0]["Location"].ToString();

                        if (dsUserPrefs.Tables[0].Rows[0]["CalendarPrivacyMode"].ToString() != null)
                        {
                            PublicPrivateCheckList.SelectedValue = dsUserPrefs.Tables[0].Rows[0]["CalendarPrivacyMode"].ToString();
                        }

                        //if (dsUserPrefs.Tables[0].Rows[0]["PollPreferences"].ToString() != null)
                        //{
                        //    PollRadioList.SelectedValue = dsUserPrefs.Tables[0].Rows[0]["PollPreferences"].ToString();
                        //}

                        if (dsUserPrefs.Tables[0].Rows[0]["CommentsPreferences"].ToString() != null)
                        {
                            CommentsRadioList.SelectedValue = dsUserPrefs.Tables[0].Rows[0]["CommentsPreferences"].ToString();
                        }
                        //if (dsUserPrefs.Tables[0].Rows[0]["CategoriesOnOff"].ToString() != null)
                        //{
                        //    if (bool.Parse(dsUserPrefs.Tables[0].Rows[0]["CategoriesOnOff"].ToString()))
                        //        CategoriesOnOffRadioList.SelectedValue = "1";
                        //    else
                        //        CategoriesOnOffRadioList.SelectedValue = "2";
                        //}

                        if (dsUserPrefs.Tables[0].Rows[0]["RecommendationPrefs"].ToString() != null)
                        {
                            string recom = dsUserPrefs.Tables[0].Rows[0]["RecommendationPrefs"].ToString();
                            if (recom.Contains("1"))
                                RecommendationsCheckList.Items[0].Selected = true;
                            if (recom.Contains("2"))
                                RecommendationsCheckList.Items[1].Selected = true;
                            if (recom.Contains("3"))
                                RecommendationsCheckList.Items[2].Selected = true;
                        }

                        if (dsUserPrefs.Tables[0].Rows[0]["CommunicationPrefs"].ToString() != null)
                        {
                            CommunicationPrefsRadioList.SelectedValue =
                                dsUserPrefs.Tables[0].Rows[0]["CommunicationPrefs"].ToString();
                        }

                        //if (dsUserPrefs.Tables[0].Rows[0]["Country"].ToString() != null)
                        //{
                        //    if (dsUserPrefs.Tables[0].Rows[0]["Country"].ToString().Trim() != "")
                        //    {
                        //        if (dsUserPrefs.Tables[0].Rows[0]["Address"].ToString() != null)
                        //        {
                        //            AddressTextBox.Text = dsUserPrefs.Tables[0].Rows[0]["Address"].ToString();
                        //        }

                        //        if (dsUserPrefs.Tables[0].Rows[0]["City"].ToString() != null)
                        //        {
                        //            BillCityTextBox.Text = dsUserPrefs.Tables[0].Rows[0]["City"].ToString();
                        //        }

                        //        if (dsUserPrefs.Tables[0].Rows[0]["ZIP"].ToString() != null)
                        //        {
                        //            ZipTextBox.Text = dsUserPrefs.Tables[0].Rows[0]["ZIP"].ToString();
                        //        }
                        //        BillCountryDropDown.DataBind();
                        //        BillCountryDropDown.ClearSelection();
                        //        BillCountryDropDown.SelectedValue = dsUserPrefs.Tables[0].Rows[0]["Country"].ToString();

                        //        DataSet dsStates = dat.GetData("SELECT * FROM State WHERE country_id=" + dsUserPrefs.Tables[0].Rows[0]["Country"].ToString());

                        //        bool isText = false;
                        //        if (dsStates.Tables.Count > 0)
                        //            if (dsStates.Tables[0].Rows.Count > 0)
                        //            {
                        //                BillStateDropDown.DataSource = dsStates;
                        //                BillStateDropDown.DataTextField = "state_2_code";
                        //                BillStateDropDown.DataValueField = "state_id";
                        //                BillStateDropDown.DataBind();
                        //                BillStateDropDown.Items.Insert(0, new ListItem("Select State..", "-1"));

                        //                if (dsUserPrefs.Tables[0].Rows[0]["State"].ToString() != null)
                        //                {
                        //                    ListItem a = BillStateDropDown.Items.FindByText(dsUserPrefs.Tables[0].Rows[0]["State"].ToString());
                        //                    if (a != null)
                        //                        BillStateDropDown.SelectedValue = a.Value;
                        //                }

                        //                BillStateDropPanel.Visible = true;
                        //                BillStateTextPanel.Visible = false;
                        //            }
                        //            else
                        //            {
                        //                isText = true;
                        //            }
                        //        else
                        //            isText = true;

                        //        if (isText)
                        //        {
                        //            if (dsUserPrefs.Tables[0].Rows[0]["State"].ToString() != null)
                        //            {
                        //                BillStateTextBox.Text = dsUserPrefs.Tables[0].Rows[0]["State"].ToString();
                        //            }
                        //            BillStateTextPanel.Visible = true;
                        //            BillStateDropPanel.Visible = false;
                        //        }
                        //    }
                        //    else
                        //    {
                        //        BillCountryDropDown.DataBind();
                        //        BillCountryDropDown.SelectedValue = "223";
                        //    }
                        //}
                        //else
                        //{
                        //    BillCountryDropDown.DataBind();
                        //    BillCountryDropDown.SelectedValue = "223";
                        //}

                        if (dsUserPrefs.Tables[0].Rows[0]["CatCountry"].ToString() != null)
                        {
                            if (dsUserPrefs.Tables[0].Rows[0]["CatCountry"].ToString().Trim() != "")
                            {
                                if (dsUserPrefs.Tables[0].Rows[0]["CatCity"].ToString() != null)
                                {
                                    CityTextBox.Text = dsUserPrefs.Tables[0].Rows[0]["CatCity"].ToString();
                                }

                                CatZipTextBox.Text = dsUserPrefs.Tables[0].Rows[0]["CatZip"].ToString();

                                CountryDropDown.DataBind();
                                CountryDropDown.SelectedValue = dsUserPrefs.Tables[0].Rows[0]["CatCountry"].ToString();
                                ChangeState(CountryDropDown, new EventArgs());

                                DataSet dsStates = dat.GetData("SELECT * FROM State WHERE country_id=" + dsUserPrefs.Tables[0].Rows[0]["CatCountry"].ToString());

                                bool isText = false;
                                if (dsStates.Tables.Count > 0)
                                    if (dsStates.Tables[0].Rows.Count > 0)
                                    {
                                        StateDropDown.DataSource = dsStates;
                                        StateDropDown.DataTextField = "state_2_code";
                                        StateDropDown.DataValueField = "state_id";
                                        StateDropDown.DataBind();

                                        if (dsUserPrefs.Tables[0].Rows[0]["CatState"] != null)
                                        {
                                            StateDropDown.SelectedValue = StateDropDown.Items.FindByText(dsUserPrefs.Tables[0].Rows[0]["CatState"].ToString()).Value;
                                        }

                                        StateDropDownPanel.Visible = true;
                                        StateTextBoxPanel.Visible = false;
                                        RequiredFieldValidator2.Visible = false;
                                    }
                                    else
                                    {
                                        isText = true;
                                    }
                                else
                                    isText = true;

                                if (isText)
                                {
                                    RequiredFieldValidator2.Visible = true;
                                    if (dsUserPrefs.Tables[0].Rows[0]["CatState"].ToString() != null)
                                    {
                                        StateTextBox.Text = dsUserPrefs.Tables[0].Rows[0]["CatState"].ToString();
                                    }
                                    StateTextBoxPanel.Visible = true;
                                    StateDropDownPanel.Visible = false;
                                }
                                ChangeCity(new object(), new EventArgs());
                                if (CountryDropDown.SelectedValue == "223")
                                    MajorCityDrop.Items.FindByValue(dsUserPrefs.Tables[0].Rows[0]["MajorCity"].ToString()).Selected = true;
                            }
                        }
                        if (dsUserPrefs.Tables[0].Rows[0]["TextingPrefs"].ToString() != null)
                        {
                            if (dsUserPrefs.Tables[0].Rows[0]["TextingPrefs"].ToString().Contains("1"))
                                TextingCheckBoxList.Items[0].Selected = true;
                            //if (dsUserPrefs.Tables[0].Rows[0]["TextingPrefs"].ToString().Contains("2"))
                            //    TextingCheckBoxList.Items[1].Selected = true;
                            if (dsUserPrefs.Tables[0].Rows[0]["TextingPrefs"].ToString().Contains("3"))
                                TextingCheckBoxList.Items[2].Selected = true;
                        }

                        if (dsUserPrefs.Tables[0].Rows[0]["EmailPrefs"].ToString() != null)
                        {
                            if (dsUserPrefs.Tables[0].Rows[0]["EmailPrefs"].ToString().Contains("1"))
                                EmailCheckList.Items[0].Selected = true;
                            //if (dsUserPrefs.Tables[0].Rows[0]["EmailPrefs"].ToString().Contains("2"))
                            //    EmailCheckList.Items[1].Selected = true;

                            if (dsUserPrefs.Tables[0].Rows[0]["EmailPrefs"].ToString().Contains(EmailUserCheckList1.Items[0].Value))
                                EmailUserCheckList1.Items[0].Selected = true;
                            if (dsUserPrefs.Tables[0].Rows[0]["EmailPrefs"].ToString().Contains(EmailUserCheckList1.Items[1].Value))
                                EmailUserCheckList1.Items[1].Selected = true;
                            if (dsUserPrefs.Tables[0].Rows[0]["EmailPrefs"].ToString().Contains(EmailUserCheckList1.Items[2].Value))
                                EmailUserCheckList1.Items[2].Selected = true;
                            if (dsUserPrefs.Tables[0].Rows[0]["EmailPrefs"].ToString().Contains(EmailUserCheckList1.Items[3].Value))
                                EmailUserCheckList1.Items[3].Selected = true;

                            if (dsUserPrefs.Tables[0].Rows[0]["EmailPrefs"].ToString().Contains(EmailUserCheckList2.Items[0].Value))
                                EmailUserCheckList2.Items[0].Selected = true;
                            if (dsUserPrefs.Tables[0].Rows[0]["EmailPrefs"].ToString().Contains(EmailUserCheckList2.Items[1].Value))
                                EmailUserCheckList2.Items[1].Selected = true;
                            //if (dsUserPrefs.Tables[0].Rows[0]["EmailPrefs"].ToString().Contains(EmailUserCheckList2.Items[2].Value))
                            //    EmailUserCheckList2.Items[2].Selected = true;
                        }
                    }

                DataSet dsComments = d.GetData("SELECT * FROM User_Comments CU, Users U WHERE CU.CommenterID=U.User_ID AND CU.UserID=" + USER_ID.ToString());
                //Label UserNameLabel = (Label)Tab3.FindControl("UserNameLabel");

                //UserNameLabel.Text = dsUser.Tables[0].Rows[0]["UserName"].ToString();

                if (dsUser.Tables[0].Rows[0]["Email"].ToString() != null)
                {
                    EmailTextBox.Text = dsUser.Tables[0].Rows[0]["Email"].ToString();
                }

                if (dsUser.Tables[0].Rows[0]["PhoneNumber"].ToString() != null)
                {
                    PhoneTextBox.Text = dsUser.Tables[0].Rows[0]["PhoneNumber"].ToString();
                }

                if (dsUser.Tables[0].Rows[0]["PhoneProvider"].ToString() != null)
                {
                    ProviderDropDown.SelectedValue = dsUser.Tables[0].Rows[0]["PhoneProvider"].ToString();
                }

                Image FriendImage = (Image)Tab3.FindControl("FriendImage");

                if (dsUser.Tables[0].Rows[0]["ProfilePicture"].ToString() != null)
                {
                    if (System.IO.File.Exists(Server.MapPath(".") + "/UserFiles/" + dsUser.Tables[0].Rows[0]["UserName"].ToString() + "/Profile/" + dsUser.Tables[0].Rows[0]["ProfilePicture"].ToString()))
                    {
                        System.Drawing.Image theimg = System.Drawing.Image.FromFile(Server.MapPath(".") + "/UserFiles/" + dsUser.Tables[0].Rows[0]["UserName"].ToString() +
                "/Profile/" + dsUser.Tables[0].Rows[0]["ProfilePicture"].ToString());

                        double width = double.Parse(theimg.Width.ToString());
                        double height = double.Parse(theimg.Height.ToString());

                        if (width > height)
                        {
                            if (width <= 150)
                            {

                            }
                            else
                            {
                                double dividor = double.Parse("150.00") / double.Parse(width.ToString());
                                width = double.Parse("150.00");
                                height = height * dividor;
                            }
                        }
                        else
                        {
                            if (width == height)
                            {
                                width = double.Parse("150.00");
                                height = double.Parse("150.00");
                            }
                            else
                            {
                                double dividor = double.Parse("150.00") / double.Parse(height.ToString());
                                height = double.Parse("150.00");
                                width = width * dividor;
                            }
                        }

                        FriendImage.Width = int.Parse((Math.Round(decimal.Parse(width.ToString()))).ToString());
                        FriendImage.Height = int.Parse((Math.Round(decimal.Parse(height.ToString()))).ToString());

                        FriendImage.ImageUrl = "~/UserFiles/" + dsUser.Tables[0].Rows[0]["UserName"].ToString() + "/Profile/" + dsUser.Tables[0].Rows[0]["ProfilePicture"].ToString();
                        Session["ProfilePicture"] = dsUser.Tables[0].Rows[0]["ProfilePicture"].ToString();
                    }
                    else
                    {
                        FriendImage.ImageUrl = "~/NewImages/NoAvatar150.jpg";
                    }
                }
                else
                    FriendImage.ImageUrl = "~/NewImages/NoAvatar150.jpg";
            }
            else
            {
                if (Session["User"] == null)
                {
                    ErrorLabel.Text = "something happen";
                    //Session.Abandon();
                    Response.Redirect("~/login");

                }
            }

            DataSet dsVenues = dat.GetData("SELECT * FROM UserVenues UV, Venues V WHERE V.ID=UV.VenueID AND UV.UserID=" + Session["User"].ToString());

            CheckBoxList VenueCheckBoxes = new CheckBoxList();
            VenueCheckBoxes.Width = 530;
            VenueCheckBoxes.CssClass = "VenueCheckBoxes";
            VenueCheckBoxes.ID = "VenueCheckBoxes";
            VenueCheckBoxes.RepeatColumns = 4;
            VenueCheckBoxes.RepeatDirection = RepeatDirection.Horizontal;

            VenueCheckBoxes.DataSource = dsVenues;
            VenueCheckBoxes.DataTextField = "NAME";
            VenueCheckBoxes.DataValueField = "ID";
            VenueCheckBoxes.DataBind();

            Literal lit = new Literal();
            lit.Text = "<div class=\"Pad2\">";
            VenuesChecksPanel.Controls.Add(lit);
            for (int i = 0; i < VenueCheckBoxes.Items.Count; i++)
            {
                VenueCheckBoxes.Items[i].Selected = true;
            }

            if (VenueCheckBoxes.Items.Count == 0)
            {
                Label label = new Label();
                label.CssClass = "VenueCheckBoxes";
                label.Text = "You have no venues specified as your favorite. To add venues as your favorites search for them on the <a href=\"venue-search\" class=\"NavyLink12\">Venues Page</a>";
                VenuesChecksPanel.Controls.Add(label);
            }
            else
            {
                VenuesChecksPanel.Controls.Add(VenueCheckBoxes);
            }
            lit = new Literal();
            lit.Text = "</div>";

            VenuesChecksPanel.Controls.Add(lit);
        }
        catch (Exception ex)
        {
            UserErrorLabel.Text = ex.ToString();
        }

        if (Request.QueryString["p"] != null)
        {
            RadTabStrip2.Tabs[2].Selected = true;
            RadTabStrip2.Tabs[2].CssClass = "MyTabsPreferencesSelected";
            RadTabStrip2.Tabs[0].CssClass = "MyTabsMessages";
            RadTabStrip2.Tabs[1].CssClass = "MyTabsFriends";
            TheMultipage.PageViews[2].Selected = true;
        }

        if (Request.QueryString["G"] != null)
        {
            RadTabStrip2.Tabs[3].Selected = true;
            RadTabStrip2.Tabs[3].CssClass = "MyTabsGroupsSelected";
            RadTabStrip2.Tabs[0].CssClass = "MyTabsMessages";
            RadTabStrip2.Tabs[1].CssClass = "MyTabsFriends";
            RadTabStrip2.Tabs[2].CssClass = "MyTabsPreferences";
            TheMultipage.PageViews[3].Selected = true;
        }
    }
 protected void Cargar(CheckBoxList checkBoxList, String idPeriodoPago)
 {
     condicionNomina _condicionNomina = new condicionNomina(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString());
     checkBoxList.DataSource = _condicionNomina.obtenerPeriodosDescuentoSubTranportePorPeriodoPago(idPeriodoPago);
     checkBoxList.DataTextField = "descripcion";
     checkBoxList.DataValueField = "codigo";
     checkBoxList.DataBind();
 }
Ejemplo n.º 40
0
    protected void ddlCoScholasticArea_SelectedIndexChanged(object sender, EventArgs e)
    {
        DataSet dsIndicators = new DataSet();
        dsIndicators = objCCE.GetCoScholasticIndicators(Convert.ToInt32(ddlCoScholasticArea.SelectedValue));
        foreach (GridViewRow gvr in gdvCoScholastic.Rows)
        {
            CheckBoxList chkIndicators = new CheckBoxList();
            chkIndicators = (CheckBoxList)gvr.Cells[3].FindControl("chkIndicators");

            for (int i = 0; i < dsIndicators.Tables[0].Rows.Count; i++)
            {
                chkIndicators.DataSource = dsIndicators.Tables[0];
                chkIndicators.DataValueField = "IndicatorId";
                chkIndicators.DataTextField = "Indicator";
                chkIndicators.DataBind();
            }

        }
    }
Ejemplo n.º 41
0
    /*Sub Header***********************************************************
    Function Name: BindCompanyStatusDropdown
    Functionality: This function is used to bind the company statuses with the predefined array

    Input: dropdownlist and the strInitialText
    Output:
    Note:
    *********************************************************************/
    public static void BindCompanyCheckBoxList(CheckBoxList ddList, string strInitialText)
    {
        BLL.CompanyManager oCompanyManager = new BLL.CompanyManager();

        ddList.DataSource = oCompanyManager.GetCompanyAllCompanies();
        ddList.DataTextField = "strCompanyName";
        ddList.DataValueField = "intCompanyId";
        ddList.DataBind();

        ListItem lstInitialItem;
        if (strInitialText.Trim() != "")
        {
            lstInitialItem = new ListItem(strInitialText, "0");
            ddList.Items.Insert(0, lstInitialItem);
        }
        lstInitialItem = null;
        oCompanyManager = null;
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        HtmlMeta hm = new HtmlMeta();
        HtmlHead head = (HtmlHead)Page.Header;
        hm.Name = "ROBOTS";
        hm.Content = "NOINDEX, FOLLOW";
        head.Controls.AddAt(0, hm);

        HttpCookie cookie = Request.Cookies["BrowserDate"];
        if (cookie == null)
        {
            cookie = new HttpCookie("BrowserDate");
            cookie.Value = DateTime.Now.ToString();
            cookie.Expires = DateTime.Now.AddDays(22);
            Response.Cookies.Add(cookie);
        }
        Data dat = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
        MessageRadWindowManager.VisibleOnPageLoad = false;
        if (!IsPostBack)
        {

            string cookieName = FormsAuthentication.FormsCookieName;
            HttpCookie authCookie = Context.Request.Cookies[cookieName];

            FormsAuthenticationTicket authTicket = null;
            try
            {
                string group = "";
                if (authCookie != null)
                {
                    authTicket = FormsAuthentication.Decrypt(authCookie.Value);
                    group = authTicket.UserData.ToString();
                }

                if (group.Contains("User"))
                {
                    Session["User"] = authTicket.Name;
                    Session["UserName"] = dat.GetData("SELECT UserName FROM USERS WHERE User_ID=" + Session["User"].ToString()).Tables[0].Rows[0]["UserName"].ToString();
                }
                else
                {
                    Button calendarLink = (Button)dat.FindControlRecursive(this, "CalendarLink");
                    calendarLink.Visible = false;
                    Response.Redirect("~/UserLogin.aspx");
                }
            }
            catch (Exception ex)
            {
                Response.Redirect("~/UserLogin.aspx");
            }

            string USER_ID = Session["User"].ToString();

            //DataSet dsCat = dat.GetData("SELECT * FROM Categories");
            //CategoriesCheckBoxes.DataSource = dsCat;
            //CategoriesCheckBoxes.DataTextField = "CategoryName";
            //CategoriesCheckBoxes.DataValueField = "ID";
            //CategoriesCheckBoxes.DataBind();

            CategoryTree.DataBind();
            RadTreeView1.DataBind();
            RadTreeView2.DataBind();
            RadTreeView3.DataBind();

            DataSet dsCategories = dat.GetData("SELECT * FROM UserCategories WHERE UserID=" + USER_ID);
            if (dsCategories.Tables.Count > 0)
                for (int i = 0; i < dsCategories.Tables[0].Rows.Count; i++)
                {
                    Telerik.Web.UI.RadTreeNode node = (Telerik.Web.UI.RadTreeNode)CategoryTree.Nodes.FindNodeByValue(dsCategories.Tables[0].Rows[i]["CategoryID"].ToString());
                    if (node != null)
                    {
                        node.Checked = true;
                        //node.Enabled = false;
                    }
                    else
                    {

                        node = (Telerik.Web.UI.RadTreeNode)RadTreeView1.Nodes.FindNodeByValue(dsCategories.Tables[0].Rows[i]["CategoryID"].ToString());
                        if (node != null)
                        {
                            node.Checked = true;
                            //node.Enabled = false;
                        }
                        else
                        {

                            node = (Telerik.Web.UI.RadTreeNode)RadTreeView2.Nodes.FindNodeByValue(dsCategories.Tables[0].Rows[i]["CategoryID"].ToString());
                            if (node != null)
                            {
                                node.Checked = true;
                                //node.Enabled = false;
                            }
                            else
                            {
                                node = (Telerik.Web.UI.RadTreeNode)RadTreeView3.Nodes.FindNodeByValue(dsCategories.Tables[0].Rows[i]["CategoryID"].ToString());
                                if (node != null)
                                {
                                    node.Checked = true;
                                    //node.Enabled = false;
                                }

                            }

                        }
                    }
                    //CategoriesCheckBoxes.Items.FindByValue(dsCategories.Tables[0].Rows[i]["CategoryID"].ToString()).Selected = true;
                    //CategoriesCheckBoxes.Items.FindByValue(dsCategories.Tables[0].Rows[i]["CategoryID"].ToString()).Enabled = false;
                }

            DataSet dsProvider = dat.GetData("SELECT * FROM PhoneProviders");
            ProviderDropDown.DataSource = dsProvider;
            ProviderDropDown.DataTextField = "Provider";
            ProviderDropDown.DataValueField = "ID";
            ProviderDropDown.DataBind();

            Data d = new Data(DateTime.Parse(cookie.Value.ToString().Replace("%20", " ").Replace("%3A", ":")));
            DataSet ds = d.GetData("SELECT * FROM Events E, Venues V, Event_Occurance EO, User_Calendar UC WHERE UC.EventID=E.ID AND E.ID=EO.EventID AND E.Venue=V.ID AND UC.UserID=" + USER_ID);
            DataSet dsUser = d.GetData("SELECT * FROM Users WHERE User_ID=" + USER_ID);
            DataSet dsUserPrefs = d.GetData("SELECT * FROM UserPreferences WHERE UserID=" + USER_ID);

            if (dsUserPrefs.Tables.Count > 0)
                if (dsUserPrefs.Tables[0].Rows.Count > 0)
                {
                    AgeTextBox.Text = dsUserPrefs.Tables[0].Rows[0]["Age"].ToString();
                    SexTextBox.Text = dsUserPrefs.Tables[0].Rows[0]["Sex"].ToString();

                    LocationTextBox.Text = dsUserPrefs.Tables[0].Rows[0]["Location"].ToString();

                    string eventsPosted = "0";
                    DataSet dsEvents = dat.GetData("SELECT COUNT(*) AS COUNT1 FROM Events WHERE UserName='******'");
                    if (dsEvents.Tables.Count > 0)
                        if (dsEvents.Tables[0].Rows.Count > 0)
                            eventsPosted = dsEvents.Tables[0].Rows[0]["COUNT1"].ToString();
                    EventsLabel.Text = eventsPosted;
                    AttendedLabel.Text = dsUserPrefs.Tables[0].Rows[0]["EventsAttended"].ToString();

                    if (dsUserPrefs.Tables[0].Rows[0]["CalendarPrivacyMode"].ToString() != null)
                    {
                        PublicPrivateCheckList.SelectedValue = dsUserPrefs.Tables[0].Rows[0]["CalendarPrivacyMode"].ToString();
                    }

                    if (dsUserPrefs.Tables[0].Rows[0]["PollPreferences"].ToString() != null)
                    {
                        PollRadioList.SelectedValue = dsUserPrefs.Tables[0].Rows[0]["PollPreferences"].ToString();
                    }

                    if (dsUserPrefs.Tables[0].Rows[0]["CommentsPreferences"].ToString() != null)
                    {
                        CommentsRadioList.SelectedValue = dsUserPrefs.Tables[0].Rows[0]["CommentsPreferences"].ToString();
                    }

                    if (dsUserPrefs.Tables[0].Rows[0]["CategoriesOnOff"].ToString() != null)
                    {
                        if(bool.Parse(dsUserPrefs.Tables[0].Rows[0]["CategoriesOnOff"].ToString()))
                            CategoriesOnOffRadioList.SelectedValue = "1";
                        else
                            CategoriesOnOffRadioList.SelectedValue = "2";
                    }

                    if (dsUserPrefs.Tables[0].Rows[0]["CommunicationPrefs"].ToString() != null)
                    {
                        CommunicationPrefsRadioList.SelectedValue = dsUserPrefs.Tables[0].Rows[0]["CommunicationPrefs"].ToString();
                    }

                    if (dsUserPrefs.Tables[0].Rows[0]["Country"].ToString() != null)
                    {
                        if (dsUserPrefs.Tables[0].Rows[0]["Country"].ToString().Trim() != "")
                        {
                            if (dsUserPrefs.Tables[0].Rows[0]["Address"].ToString() != null)
                            {
                                AddressTextBox.THE_TEXT = dsUserPrefs.Tables[0].Rows[0]["Address"].ToString();
                            }

                            if (dsUserPrefs.Tables[0].Rows[0]["City"].ToString() != null)
                            {
                                BillCityTextBox.THE_TEXT = dsUserPrefs.Tables[0].Rows[0]["City"].ToString();
                            }

                            if (dsUserPrefs.Tables[0].Rows[0]["ZIP"].ToString() != null)
                            {
                                ZipTextBox.THE_TEXT = dsUserPrefs.Tables[0].Rows[0]["ZIP"].ToString();
                            }

                            BillCountryDropDown.SelectedValue = dsUserPrefs.Tables[0].Rows[0]["Country"].ToString();

                            DataSet dsStates = dat.GetData("SELECT * FROM State WHERE country_id=" + dsUserPrefs.Tables[0].Rows[0]["Country"].ToString());

                            bool isText = false;
                            if (dsStates.Tables.Count > 0)
                                if (dsStates.Tables[0].Rows.Count > 0)
                                {
                                    BillStateDropDown.DataSource = dsStates;
                                    BillStateDropDown.DataTextField = "state_2_code";
                                    BillStateDropDown.DataValueField = "state_id";
                                    BillStateDropDown.DataBind();
                                    BillStateDropDown.Items.Insert(0, new ListItem("Select State..", "-1"));

                                    if (dsUserPrefs.Tables[0].Rows[0]["State"].ToString() != null)
                                    {
                                        ListItem a = BillStateDropDown.Items.FindByText(dsUserPrefs.Tables[0].Rows[0]["State"].ToString());
                                        if (a != null)
                                            BillStateDropDown.SelectedValue = a.Value;
                                    }

                                    BillStateDropPanel.Visible = true;
                                    BillStateTextPanel.Visible = false;
                                }
                                else
                                {
                                    isText = true;
                                }
                            else
                                isText = true;

                            if (isText)
                            {
                                if (dsUserPrefs.Tables[0].Rows[0]["State"].ToString() != null)
                                {
                                    BillStateTextBox.THE_TEXT = dsUserPrefs.Tables[0].Rows[0]["State"].ToString();
                                }
                                BillStateTextPanel.Visible = true;
                                BillStateDropPanel.Visible = false;
                            }
                        }
                    }
                    if (dsUserPrefs.Tables[0].Rows[0]["CatCountry"].ToString() != null)
                    {
                        if (dsUserPrefs.Tables[0].Rows[0]["CatCountry"].ToString().Trim() != "")
                        {
                            if (dsUserPrefs.Tables[0].Rows[0]["CatCity"].ToString() != null)
                            {
                                CityTextBox.THE_TEXT = dsUserPrefs.Tables[0].Rows[0]["CatCity"].ToString();
                            }

                            CountryDropDown.SelectedValue = dsUserPrefs.Tables[0].Rows[0]["CatCountry"].ToString();

                            DataSet dsStates = dat.GetData("SELECT * FROM State WHERE country_id=" + dsUserPrefs.Tables[0].Rows[0]["CatCountry"].ToString());

                            bool isText = false;
                            if (dsStates.Tables.Count > 0)
                                if (dsStates.Tables[0].Rows.Count > 0)
                                {
                                    StateDropDown.DataSource = dsStates;
                                    StateDropDown.DataTextField = "state_2_code";
                                    StateDropDown.DataValueField = "state_id";
                                    StateDropDown.DataBind();

                                    if (dsUserPrefs.Tables[0].Rows[0]["CatState"] != null)
                                    {
                                        StateDropDown.SelectedValue = StateDropDown.Items.FindByText(dsUserPrefs.Tables[0].Rows[0]["CatState"].ToString()).Value;
                                    }

                                    StateDropDownPanel.Visible = true;
                                    StateTextBoxPanel.Visible = false;
                                }
                                else
                                {
                                    isText = true;
                                }
                            else
                                isText = true;

                            if (isText)
                            {
                                if (dsUserPrefs.Tables[0].Rows[0]["CatState"].ToString() != null)
                                {
                                    StateTextBox.THE_TEXT = dsUserPrefs.Tables[0].Rows[0]["CatState"].ToString();
                                }
                                StateTextBoxPanel.Visible = true;
                                StateDropDownPanel.Visible = false;
                            }
                        }
                    }
                    if (dsUserPrefs.Tables[0].Rows[0]["TextingPrefs"].ToString() != null)
                    {
                        if (dsUserPrefs.Tables[0].Rows[0]["TextingPrefs"].ToString().Contains("1"))
                            TextingCheckBoxList.Items[0].Selected = true;
                        if (dsUserPrefs.Tables[0].Rows[0]["TextingPrefs"].ToString().Contains("2"))
                            TextingCheckBoxList.Items[1].Selected = true;
                        if (dsUserPrefs.Tables[0].Rows[0]["TextingPrefs"].ToString().Contains("3"))
                            TextingCheckBoxList.Items[2].Selected = true;
                    }

                    if (dsUserPrefs.Tables[0].Rows[0]["EmailPrefs"].ToString() != null)
                    {
                        if (dsUserPrefs.Tables[0].Rows[0]["EmailPrefs"].ToString().Contains("1"))
                            EmailCheckList.Items[0].Selected = true;
                        if (dsUserPrefs.Tables[0].Rows[0]["EmailPrefs"].ToString().Contains("2"))
                            EmailCheckList.Items[1].Selected = true;
                        if (dsUserPrefs.Tables[0].Rows[0]["EmailPrefs"].ToString().Contains("3"))
                            EmailCheckList.Items[2].Selected = true;
                    }
                }

            DataSet dsComments = d.GetData("SELECT * FROM User_Comments CU, Users U WHERE CU.CommenterID=U.User_ID AND CU.UserID=" + USER_ID.ToString());
            UserNameLabel.Text = dsUser.Tables[0].Rows[0]["UserName"].ToString();

            if (dsUser.Tables[0].Rows[0]["Email"].ToString() != null)
            {
                EmailTextBox.Text = dsUser.Tables[0].Rows[0]["Email"].ToString();
            }

            if (dsUser.Tables[0].Rows[0]["PhoneNumber"].ToString() != null)
            {
                PhoneTextBox.THE_TEXT = dsUser.Tables[0].Rows[0]["PhoneNumber"].ToString();
            }

            if (dsUser.Tables[0].Rows[0]["PhoneProvider"].ToString() != null)
            {
                ProviderDropDown.SelectedValue = dsUser.Tables[0].Rows[0]["PhoneProvider"].ToString();
            }

            if (dsUser.Tables[0].Rows[0]["ProfilePicture"].ToString() != null)
            {
                if (System.IO.File.Exists(Server.MapPath(".") + "/UserFiles/" + dsUser.Tables[0].Rows[0]["UserName"].ToString() + "/Profile/" + dsUser.Tables[0].Rows[0]["ProfilePicture"].ToString()))
                {
                    FriendImage.ImageUrl = Server.MapPath(".") + "/UserFiles/" + dsUser.Tables[0].Rows[0]["UserName"].ToString() + "/Profile/" + dsUser.Tables[0].Rows[0]["ProfilePicture"].ToString();
                    Session["ProfilePicture"] = dsUser.Tables[0].Rows[0]["ProfilePicture"].ToString();
                }
                else
                {
                    FriendImage.ImageUrl = "NewImages/NoAvatar150.jpg";
                }
            }
            else
                FriendImage.ImageUrl = "NewImages/NoAvatar150.jpg";
        }
        else
        {
            if (Session["User"] == null)
            {
                Session.Abandon();
                Response.Redirect("~/UserLogin.aspx");

            }
        }

        DataSet dsVenues = dat.GetData("SELECT * FROM UserVenues UV, Venues V WHERE V.ID=UV.VenueID AND UV.UserID=" + Session["User"].ToString());

        VenuesRadPanel.Items[0].Text = "<div style=\"border-bottom: dotted 1px black; background-color: #1b1b1b; "+
            "\"><label class=\"PreferencesTitle\">Favorite Venues</label><span " +
            "style=\"font-style: italic; font-family: Arial; font-size: 14px; color: #666666;\">"+
            " (Click to drop down the list. Un-check to remove a venue from the favorites list.)</span></div>";

        //"<div style=\"border-bottom: dotted 1px black; " +
        //    "padding-top: 10px;\"><label class=\"PreferencesTitle\">Favorite Venues</label><span " +
        //    "style=\"font-style: italic; font-family: Arial; font-size: 14px; color: #666666;\">" +
        //    "(You can add these from the <a href=\"VenueSearch.aspx\" class=\"AddLink\">Venues Page</a>. " +
        //    "Un-check to remove a venue from the favorites list.)</span></div>";

        CheckBoxList VenueCheckBoxes = new CheckBoxList();
        VenueCheckBoxes.Width = 600;
        VenueCheckBoxes.CssClass = "VenueCheckBoxes";
        VenueCheckBoxes.ID = "VenueCheckBoxes";
        VenueCheckBoxes.RepeatColumns = 4;
        VenueCheckBoxes.RepeatDirection = RepeatDirection.Horizontal;

        VenueCheckBoxes.DataSource = dsVenues;
        VenueCheckBoxes.DataTextField = "NAME";
        VenueCheckBoxes.DataValueField = "ID";
        VenueCheckBoxes.DataBind();

        for (int i = 0; i < VenueCheckBoxes.Items.Count; i++)
        {
            VenueCheckBoxes.Items[i].Selected = true;
        }

        if (VenueCheckBoxes.Items.Count == 0)
        {
            Label label = new Label();
            label.CssClass = "Paddings20 VenueCheckBoxes";
            label.Text = "You have no venues specifieds as your favorite. To add venues as your favorites search for them on the <a href=\"VenueSearch.aspx\" class=\"AddLink\">Venues Page</a>";
            VenuesRadPanel.Items[0].Items[0].Controls.Add(label);
        }
        else
        {
            VenuesRadPanel.Items[0].Items[0].Controls.Add(VenueCheckBoxes);
        }

        VenuesRadPanel.CollapseAllItems();
    }
    private void BindAllFTList()
    {
        MessageContent.InnerHtml = "";
        _hotelfacilitiesEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _hotelfacilitiesEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _hotelfacilitiesEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _hotelfacilitiesEntity.LogMessages.IpAddress = UserSession.Current.UserIP;

        _hotelfacilitiesEntity.HotelFacilitiesDBEntity = new List<HotelFacilitiesDBEntity>();
        HotelFacilitiesDBEntity hotelFacilitiesDBEntity = new HotelFacilitiesDBEntity();
        _hotelfacilitiesEntity.HotelFacilitiesDBEntity.Add(hotelFacilitiesDBEntity);

        DataSet dsResult = HotelFacilitiesBP.ServiceAllFTSelect(_hotelfacilitiesEntity).QueryResult;

        string strTypeSeq = "";
        DataSet dsDDP = GetDataItem();
        Panel pl = new Panel();
        CheckBoxList chk1 = new CheckBoxList();

        for (int i = 0; i < dsResult.Tables[0].Rows.Count; i++)
        {
            if (!strTypeSeq.Equals(dsResult.Tables[0].Rows[i]["TYPESEQ"].ToString()))
            {
                if (!String.IsNullOrEmpty(strTypeSeq))
                {
                    chk1.DataTextField = "FACILITIESNM";
                    chk1.DataValueField = "FACILITIESCODE";
                    chk1.DataSource = dsDDP;
                    chk1.DataBind();
                    pl.Controls.Add(chk1);
                    dvChkList.Controls.Add(pl);
                }

                pl = new Panel();
                pl.GroupingText = dsResult.Tables[0].Rows[i]["TYPENAME"].ToString();
                pl.CssClass = "";
                pl.Style.Add("width", "100%");

                chk1 = new CheckBoxList();
                chk1.RepeatDirection = RepeatDirection.Vertical;
                chk1.RepeatColumns = 8;
                chk1.RepeatLayout = RepeatLayout.Table;
                chk1.CellSpacing = 10;

                dsDDP.Tables[0].Rows.Clear();
                strTypeSeq = dsResult.Tables[0].Rows[i]["TYPESEQ"].ToString();
            }

            DataRow dr = dsDDP.Tables[0].NewRow();
            dr["FACILITIESNM"] = dsResult.Tables[0].Rows[i]["FACILITIESNM"].ToString();
            dr["FACILITIESCODE"] = dsResult.Tables[0].Rows[i]["FACILITIESCODE"].ToString();
            dsDDP.Tables[0].Rows.Add(dr);
        }

        chk1.DataTextField = "FACILITIESNM";
        chk1.DataValueField = "FACILITIESCODE";
        chk1.DataSource = dsDDP;
        chk1.DataBind();
        pl.Controls.Add(chk1);
        dvChkList.Controls.Add(pl);
    }