Exemplo n.º 1
0
 /// <summary>
 /// ��������б�
 /// </summary>
 public List<LearnSite.Model.Room> DataTableToList(DataTable dt)
 {
     List<LearnSite.Model.Room> modelList = new List<LearnSite.Model.Room>();
     int rowsCount = dt.Rows.Count;
     if (rowsCount > 0)
     {
         LearnSite.Model.Room model;
         for (int n = 0; n < rowsCount; n++)
         {
             model = new LearnSite.Model.Room();
             if(dt.Rows[n]["Rid"].ToString()!="")
             {
                 model.Rid=int.Parse(dt.Rows[n]["Rid"].ToString());
             }
             if(dt.Rows[n]["Rhid"].ToString()!="")
             {
                 model.Rhid=int.Parse(dt.Rows[n]["Rhid"].ToString());
             }
             if(dt.Rows[n]["Rgrade"].ToString()!="")
             {
                 model.Rgrade=int.Parse(dt.Rows[n]["Rgrade"].ToString());
             }
             if(dt.Rows[n]["Rclass"].ToString()!="")
             {
                 model.Rclass=int.Parse(dt.Rows[n]["Rclass"].ToString());
             }
             if(dt.Rows[n]["Rset"].ToString()!="")
             {
                 if((dt.Rows[n]["Rset"].ToString()=="1")||(dt.Rows[n]["Rset"].ToString().ToLower()=="true"))
                 {
                 model.Rset=true;
                 }
                 else
                 {
                     model.Rset=false;
                 }
             }
             model.Rpwd=dt.Rows[n]["Rpwd"].ToString();
             modelList.Add(model);
         }
     }
     return modelList;
 }
Exemplo n.º 2
0
    private void showLock()
    {
        int Rgrade = Int32.Parse(DDLgrade.SelectedValue);
        int Rclass = Int32.Parse(DDLclass.SelectedValue);

        LearnSite.BLL.Room   rm     = new LearnSite.BLL.Room();
        LearnSite.Model.Room rmodel = new LearnSite.Model.Room();
        rmodel                     = rm.GetModel(Rgrade, Rclass);
        CheckBoxip.Checked         = rmodel.Rlock;
        CheckBoxOpen.Checked       = rmodel.Ropen;
        CheckBoxRgauge.Checked     = rmodel.Rgauge;
        CheckBoxPwd.Checked        = rmodel.Rpwdsee;
        CheckBoxShare.Checked      = rmodel.Rshare;
        CheckBoxGroupShare.Checked = rmodel.Rgroupshare;
        CheckBoxScratch.Checked    = rmodel.Rscratch;
        string reat = rmodel.Rseat.Value.ToString();

        TBpwd.Text = rmodel.Rpwd;
        if (LearnSite.Common.XmlHelp.LoginMode() == 0) //如果是0,个人模式,1为班级模式
        {
            TBpwd.Text = "个人模式";
        }
    }
Exemplo n.º 3
0
    private void profileSet()
    {
        int Sgrade = Int32.Parse(DDLgrade.SelectedValue.ToString());
        int Sclass = Int32.Parse(DDLclass.SelectedValue.ToString());

        LearnSite.BLL.Room   rbll   = new LearnSite.BLL.Room();
        LearnSite.Model.Room rmodel = new LearnSite.Model.Room();
        rmodel          = rbll.GetModel(Sgrade, Sclass);
        Ckclass.Checked = rmodel.Rclassedit;
        Ckphoto.Checked = rmodel.Rphotoedit;
        Cksex.Checked   = rmodel.Rsexedit;
        Ckname.Checked  = rmodel.Rnameedit;
        Ckreg.Checked   = rmodel.Rreg;
        string gmax = rbll.GetRgroupMax(Sgrade, Sclass).ToString();

        for (int i = 0; i < DDLgroupMax.Items.Count; i++)
        {
            if (DDLgroupMax.Items[i].Value == gmax)
            {
                DDLgroupMax.SelectedValue = rbll.GetRgroupMax(Sgrade, Sclass).ToString();
                break;
            }
        }
    }
Exemplo n.º 4
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(LearnSite.Model.Room model)
 {
     dal.Update(model);
 }
Exemplo n.º 5
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(LearnSite.Model.Room model)
 {
     return(dal.Add(model));
 }
Exemplo n.º 6
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <LearnSite.Model.Room> DataTableToList(DataTable dt)
        {
            List <LearnSite.Model.Room> modelList = new List <LearnSite.Model.Room>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                LearnSite.Model.Room model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new LearnSite.Model.Room();
                    if (dt.Rows[n]["Rid"].ToString() != "")
                    {
                        model.Rid = int.Parse(dt.Rows[n]["Rid"].ToString());
                    }
                    if (dt.Rows[n]["Rhid"].ToString() != "")
                    {
                        model.Rhid = int.Parse(dt.Rows[n]["Rhid"].ToString());
                    }
                    if (dt.Rows[n]["Rgrade"].ToString() != "")
                    {
                        model.Rgrade = int.Parse(dt.Rows[n]["Rgrade"].ToString());
                    }
                    if (dt.Rows[n]["Rclass"].ToString() != "")
                    {
                        model.Rclass = int.Parse(dt.Rows[n]["Rclass"].ToString());
                    }
                    if (dt.Rows[n]["Rset"].ToString() != "")
                    {
                        if ((dt.Rows[n]["Rset"].ToString() == "1") || (dt.Rows[n]["Rset"].ToString().ToLower() == "true"))
                        {
                            model.Rset = true;
                        }
                        else
                        {
                            model.Rset = false;
                        }
                    }
                    model.Rpwd = dt.Rows[n]["Rpwd"].ToString();
                    if (dt.Rows[n]["Rlock"].ToString() != "")
                    {
                        if ((dt.Rows[n]["Rlock"].ToString() == "1") || (dt.Rows[n]["Rlock"].ToString().ToLower() == "true"))
                        {
                            model.Rlock = true;
                        }
                        else
                        {
                            model.Rlock = false;
                        }
                    }
                    model.Rip = dt.Rows[n]["Rip"].ToString();
                    if (dt.Rows[n]["Rgauge"] != null && dt.Rows[n]["Rgauge"].ToString() != "")
                    {
                        if ((dt.Rows[n]["Rgauge"].ToString() == "1") || (dt.Rows[n]["Rgauge"].ToString().ToLower() == "true"))
                        {
                            model.Rgauge = true;
                        }
                        else
                        {
                            model.Rgauge = false;
                        }
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }