protected void DataBinds()
        {
            LabMS.BLL.Lab Lab = new LabMS.BLL.Lab();
            List<LabMS.Model.Lab> ParentLab = new List<LabMS.Model.Lab>();
            ParentLab = Lab.GetModelList("Lab_ParentID is null");
            List<LabMS.Model.Lab> SonLab = new List<LabMS.Model.Lab>();
            SonLab = Lab.GetModelList("Lab_ParentID is not null");

            for (int i = 0; i < ParentLab.Count; i++)
            {
                ddl_Lab.Items.Add(new ListItem(ParentLab[i].Lab_Name, ParentLab[i].ID.ToString()));
                for (int j = 0; j < SonLab.Count; j++)
                {
                    if (SonLab[j].Lab_ParentID == ParentLab[i].ID)
                    {
                        ddl_Lab.Items.Add(new ListItem("--|" + SonLab[j].Lab_Name, SonLab[j].ID.ToString()));
                    }
                }
            }

            ddl_Lab.Items.Insert(0, new ListItem("--��ѡ��--", "0"));

            YearBind();

            Gv_DataBinds();
        }
Exemple #2
0
        /// <summary>
        /// �������б����а�
        /// </summary>
        protected void DataBinds()
        {
            LabMS.BLL.Lab Lab = new LabMS.BLL.Lab();
            List<LabMS.Model.Lab> lsLab = new List<LabMS.Model.Lab>();

            lsLab = Lab.GetModelList("");
            if (lsLab.Count != 0)
            {

                ddl_Lab.DataSource = lsLab;
                ddl_Lab.DataTextField = "Lab_Name";
                ddl_Lab.DataValueField = "ID";
                ddl_Lab.DataBind();
                ddl_Lab.Items.Insert(0, new ListItem("--��ѡ��--", "0"));
            }

            LabMS.BLL.DictionaryClass DicClass = new LabMS.BLL.DictionaryClass();
            LabMS.BLL.Dictionary Dic = new LabMS.BLL.Dictionary();

            LabMS.Model.DictionaryClass Ds = new LabMS.Model.DictionaryClass();
            List<LabMS.Model.Dictionary> lsDic = new List<LabMS.Model.Dictionary>();
            if (DicClass.GetModelList("Code='Project_Category'").Count != 0)
            {
                Ds = DicClass.GetModelList("Code='Project_Category'")[0];
                lsDic = Dic.GetModelList("DClass='" + Ds.Code + "'");
                ddl_LabType.DataSource = lsDic;
                ddl_LabType.DataTextField = "Name";
                ddl_LabType.DataValueField = "Code";
                ddl_LabType.DataBind();
                ddl_LabType.Items.Insert(0, new ListItem("--��ѡ��--", "0"));
            }
        }
        public void bindDDL(LabMS.Model.OpentProject mopproject)
        {
            LabMS.BLL.Lab blab = new LabMS.BLL.Lab();
            List<LabMS.Model.Lab> mLab = new List<LabMS.Model.Lab>();
            mLab = blab.GetModelList(" Lab_ParentID is null ");
            ddlLabName.DataSource = mLab;
            ddlLabName.DataTextField = "Lab_Name";
            ddlLabName.DataValueField = "Lab_Code";
            ddlLabName.DataBind();
            ddlLabName.SelectedValue = mopproject.Project_Lab;

            ExtendBLL.Dictionary eDictionary = new ExtendBLL.Dictionary();
            List<Model.Dictionary> listCClass = new List<LabMS.Model.Dictionary>();

            listCClass = eDictionary.GetItemListByDClass("shiyanleibie");
            ddlProjectCategory.DataSource = listCClass;
            ddlProjectCategory.DataTextField = "Name";
            ddlProjectCategory.DataValueField = "Code";
            ddlProjectCategory.DataBind();
            ddlProjectCategory.SelectedValue = mopproject.Project_Category;

            listCClass = eDictionary.GetItemListByDClass("shiyanleixing");
            ddlProjectType.DataSource = listCClass;
            ddlProjectType.DataTextField = "Name";
            ddlProjectType.DataValueField = "Code";
            ddlProjectType.DataBind();
            ddlProjectType.SelectedValue = mopproject.Project_Type;

            listCClass = eDictionary.GetItemListByDClass("shiyanyaoqiu");
            ddlProjectRequire.DataSource = listCClass;
            ddlProjectRequire.DataTextField = "Name";
            ddlProjectRequire.DataValueField = "Code";
            ddlProjectRequire.DataBind();
            ddlProjectRequire.SelectedValue = mopproject.Project_Require;

            listCClass = eDictionary.GetItemListByDClass("shiyanzheleibie");
            ddlProjectPartnerType.DataSource = listCClass;
            ddlProjectPartnerType.DataTextField = "Name";
            ddlProjectPartnerType.DataValueField = "Code";
            ddlProjectPartnerType.DataBind();
            ddlProjectPartnerType.SelectedValue = mopproject.Project_PartnerType;

            listCClass = eDictionary.GetItemListByDClass("shiyanxiangmulaiyuan");
            ddlProjectComFrom.DataSource = listCClass;
            ddlProjectComFrom.DataTextField = "Name";
            ddlProjectComFrom.DataValueField = "Code";
            ddlProjectComFrom.DataBind();
            ddlProjectComFrom.SelectedValue = mopproject.OP_ProSource;

            LabMS.Model.SysSetting msys = new LabMS.Model.SysSetting();
            ExtendBLL.SysSetting extendsys = new ExtendBLL.SysSetting();
            msys = extendsys.GetCurrentSetting();
            List<string> listYear = Common.GradeHelper.GetCurrentGrade((int)msys.CurrentYear, (int)msys.CurrentSemester, false);
            ddlOPGrade.DataSource = listYear;
            ddlOPGrade.DataBind();
            ddlOPGrade.Items.Insert(0, new ListItem("", "0"));
            ddlOPGrade.SelectedValue = mopproject.OP_Grade;

            ddlOPFunds.SelectedValue = mopproject.OP_Funds;
        }
Exemple #4
0
        public void bind(string strWhere)
        {
            List<ExtendModule.InstrumentAndConsumables> listinstrument = new
                List<ExtendModule.InstrumentAndConsumables>();
            ExtendBLL.InstrumentAndConsumables beconsum = new ExtendBLL.InstrumentAndConsumables();
            listinstrument = beconsum.GetExtendModelList(" Type = 'lowvalue' " + strWhere + " order by ID desc ");

            LabMS.BLL.Lab blab = new LabMS.BLL.Lab();
            List<LabMS.Model.Lab> mLab = new List<LabMS.Model.Lab>();
            ExtendBLL.Dictionary eDictionary = new ExtendBLL.Dictionary();
            List<Model.Dictionary> listCClass = new List<LabMS.Model.Dictionary>();
            listCClass = eDictionary.GetItemListByDClass("haocaileibie");
            foreach (ExtendModule.InstrumentAndConsumables i in listinstrument)
            {
                mLab = blab.GetModelList(" Lab_Code='" + i.StockLocation + "'");
                if (mLab.Count > 0)
                {
                    i.StockLocation = mLab[0].Lab_Name;
                }
                listCClass = eDictionary.GetModelList(" Code='" + i.Source + "' ");
                if (listCClass.Count > 0)
                {
                    i.Source = listCClass[0].Name;
                }
                listCClass = eDictionary.GetModelList(" Code='" + i.Arrow + "' ");
                if (listCClass.Count > 0)
                {
                    i.Arrow = listCClass[0].Name;
                }
            }

            gvInstrument.DataSource = listinstrument;
            gvInstrument.DataBind();
        }
        //绑定所属实验室
        protected void LabDropdowlist()
        {
            LabMS.BLL.Lab lab = new LabMS.BLL.Lab();
            List<LabMS.Model.Lab> ParLab = new List<LabMS.Model.Lab>();
            List<LabMS.Model.Lab> SonLab = new List<LabMS.Model.Lab>();
            List<LabMS.Model.Lab> LabTemp = new List<LabMS.Model.Lab>();

            ParLab = lab.GetModelList("Lab_ParentID is null");
            SonLab = lab.GetModelList("Lab_ParentID is not null");
            LabTemp = lab.GetModelList("Lab_ParentID is null");

            int count = ParLab.Count, count1 = SonLab.Count;
            for (int i = 0; i < count; i++)
            {
                int ID = ParLab[i].ID;
                int m = 0;
                for (int j = 0; j < count1; j++)
                {
                    LabMS.Model.Lab labModel = new LabMS.Model.Lab();
                    int ParentID = int.Parse(SonLab[j].Lab_ParentID.ToString());

                    if (ParentID == ID)
                    {
                        labModel.ID = SonLab[j].ID;
                        labModel.Lab_Name = "|-" + SonLab[j].Lab_Name;
                        LabTemp.Insert(i + m + 1, labModel);
                        m++;
                    }
                }
            }
            LabDDL.DataSource = LabTemp;
            LabDDL.DataBind();
            ListItem item = new ListItem("无", "0");
            LabDDL.Items.Insert(0, item);
        }
Exemple #6
0
 //��ʵ�������� �����б��
 protected void LabDropdownlist()
 {
     LabMS.BLL.Lab lab = new LabMS.BLL.Lab();
     List<LabMS.Model.Lab> lablist = new List<LabMS.Model.Lab>();
     lablist = lab.GetModelList(" Lab_ParentID is null order by [ID] DESC");
     LabNameDDL.DataSource = lablist;
     LabNameDDL.DataBind();
 }
        //绑定实验室名称 下拉列表框
        protected void LabDropdownlist()
        {
            LabMS.BLL.Lab lab = new LabMS.BLL.Lab();
            DataSet ds = new DataSet();

            ds = lab.GetAllList();
            LabNameDDL.DataSource = ds;
            LabNameDDL.DataBind();
        }
Exemple #8
0
        //������ʵ���� �����б��
        protected void LabDropdownlist()
        {
            LabMS.BLL.Lab lab = new LabMS.BLL.Lab();
            DataSet ds = new DataSet();

            ds = lab.GetList("Lab_ParentID is null");
            LabDDL.DataSource = ds;
            LabDDL.DataBind();
        }
Exemple #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!UserType.Equals("mana")) { modify.Style.Add("display", "none"); }

            if (!Page.IsPostBack)
            {
                #region Get id

                int id;

                if (string.IsNullOrEmpty(Request.QueryString["id"]))
                {
                    throw new Exception("�Բ����������ʵ�ҳ�治����");
                }

                try
                {
                    id = int.Parse(Request.QueryString["id"]);
                }
                catch
                {
                    throw new Exception("�Բ����������ʵ�ҳ�治����");
                }

                #endregion

                LabMS.Model.Announcement noticeInfo;
                ExtendBLL.Announcement notice = new ExtendBLL.Announcement();

                noticeInfo = notice.GetModel(id);

                if (noticeInfo == null)
                {
                    throw new Exception("�Բ����������ʵ�ҳ�治����");
                }

                NoticeTitle.Text = noticeInfo.AnnouncementTitle;
                NoticeAttachment.Text = string.IsNullOrEmpty(noticeInfo.AttachmentPath) ?
                    "<label style='color: #ff0000;'>���޸���</label>" : "<a target='_blank' href='" + noticeInfo.AttachmentPath + "' >������ظ���</a>";
                NoticeContent.Text = Server.HtmlDecode(noticeInfo.AnnouncementContent);
                NoticeExpireTime.Text = noticeInfo.ExpireTime.Value.ToString("yyyy��MM��dd��");
                NoticeImportance.Text = (noticeInfo.Importance.HasValue && (noticeInfo.Importance.Value == 1)) ? "<label style='color: #ff0000;'>��Ҫ</label>" : "һ��";
                NoticePubTime.Text = noticeInfo.PublishTime.Value.ToString("yyyy��MM��dd�� HH:mm");

                LabMS.BLL.UserTable staff = new LabMS.BLL.UserTable();
                LabMS.Model.UserTable staffInfo = staff.GetModel(noticeInfo.PublisherID.Value);

                // NoticeRole.Text = "����"; //TBD
                NoticePublisherName.Text = (staffInfo == null) ? "<del>��ɾ���û�</del>" : staffInfo.UserName;

                LabMS.BLL.Lab lab = new LabMS.BLL.Lab();
                LabMS.Model.Lab labInfo = lab.GetModel(noticeInfo.LabID.Value);

                NoticeLab.Text = (labInfo == null) ? "ȫ��" : labInfo.Lab_Name;
            }
        }
Exemple #10
0
 protected void ddlbind()
 {
     LabMS.BLL.Lab blab = new LabMS.BLL.Lab();
     List<LabMS.Model.Lab> mLab = new List<LabMS.Model.Lab>();
     mLab = blab.GetModelList(" Lab_ParentID is null ");
     ddlLab.DataSource = mLab;
     ddlLab.DataTextField = "Lab_Name";
     ddlLab.DataValueField = "Lab_Code";
     ddlLab.DataBind();
 }
        /// <summary>
        /// ��GridView��
        /// </summary>
        protected void DataBinds()
        {
            LabMS.BLL.Lab Lab = new LabMS.BLL.Lab();
            List<LabMS.Model.Lab> ParentLab = new List<LabMS.Model.Lab>();
            ParentLab = Lab.GetModelList("Lab_ParentID is null");
            List<LabMS.Model.Lab> SonLab = new List<LabMS.Model.Lab>();
            SonLab = Lab.GetModelList("Lab_ParentID is not null");

            for (int i = 0; i < ParentLab.Count; i++)
            {
                ddl_Lab.Items.Add(new ListItem(ParentLab[i].Lab_Name, ParentLab[i].ID.ToString()));
                for (int j = 0; j < SonLab.Count; j++)
                {
                    if (SonLab[j].Lab_ParentID == ParentLab[i].ID)
                    {
                        ddl_Lab.Items.Add(new ListItem("--|" + SonLab[j].Lab_Name, SonLab[j].ID.ToString()));
                    }
                }
            }
            ddl_Lab.Items.Insert(0, new ListItem("--����ʵ����--", "0"));

            LabMS.BLL.DictionaryClass DicClass = new LabMS.BLL.DictionaryClass();
            LabMS.Model.DictionaryClass Ds = new LabMS.Model.DictionaryClass();
            LabMS.BLL.Dictionary Dic = new LabMS.BLL.Dictionary();
            List<LabMS.Model.Dictionary> lsDic = new List<LabMS.Model.Dictionary>();

            if (DicClass.GetModelList("Code='App_ConstructionType'").Count != 0)
            {
                Ds = DicClass.GetModelList("Code='App_ConstructionType'")[0];
                lsDic = Dic.GetModelList("DClass='" + Ds.Code + "'");
                if (lsDic.Count != 0)
                {

                    cbl_BuildType.DataSource = lsDic;
                    cbl_BuildType.DataTextField = "Name";
                    cbl_BuildType.DataValueField = "Code";
                    cbl_BuildType.DataBind();
                }
            }

            if (DicClass.GetModelList("Code='App_State'").Count != 0)
            {
                Ds = DicClass.GetModelList("Code='App_State'")[0];
                lsDic = Dic.GetModelList("DClass='" + Ds.Code + "'");
                if (lsDic.Count != 0)
                {
                    ddl_State.DataSource = lsDic;
                    ddl_State.DataTextField = "Name";
                    ddl_State.DataValueField = "Code";
                    ddl_State.DataBind();
                    ddl_State.Items.Insert(0, new ListItem("--����״̬--", "0"));
                }
            }
        }
 public void bindddl()
 {
     LabMS.BLL.Lab blab = new LabMS.BLL.Lab();
     List<LabMS.Model.Lab> mLab = new List<LabMS.Model.Lab>();
     mLab = blab.GetModelList(" Lab_ParentID is null ");
     ddlWarehouse.DataSource = mLab;
     ddlWarehouse.DataTextField = "Lab_Name";
     ddlWarehouse.DataValueField = "Lab_Code";
     ddlWarehouse.DataBind();
     ddlWarehouse.Items.Insert(0, new ListItem("", "null"));
 }
Exemple #13
0
        //������ʵ����
        protected void LabDropdowlist()
        {
            LabMS.BLL.Lab lab = new LabMS.BLL.Lab();
            List<LabMS.Model.Lab> ParLab = new List<LabMS.Model.Lab>();

            ParLab = lab.GetModelList("Lab_ParentID is null");
            LabNameDDL.DataSource = ParLab;
            LabNameDDL.DataBind();
            ListItem item = new ListItem("--����ʵ����--", "0");
            LabNameDDL.Items.Insert(0, item);
        }
 protected void dllbind()
 {
     tbReportTime.Text = DateTime.Now.ToShortDateString();
     LabMS.BLL.Lab blab = new LabMS.BLL.Lab();
     List<LabMS.Model.Lab> mLab = new List<LabMS.Model.Lab>();
     mLab = blab.GetModelList(" Lab_ParentID is null ");
     ddlLab.DataSource = mLab;
     ddlLab.DataTextField = "Lab_Name";
     ddlLab.DataValueField = "Lab_Code";
     ddlLab.DataBind();
 }
        protected void DataBinds()
        {
            App_ProjectCode.Text = GetUniqueString();
            LabMS.BLL.DictionaryClass DClass = new LabMS.BLL.DictionaryClass();
            LabMS.BLL.Dictionary Dic = new LabMS.BLL.Dictionary();
            LabMS.Model.DictionaryClass Ds1 = new LabMS.Model.DictionaryClass();
            List<LabMS.Model.Dictionary> lsLabType = new List<LabMS.Model.Dictionary>();
            List<LabMS.Model.Dictionary> lsConType =new List<LabMS.Model.Dictionary>();
            List<LabMS.Model.Dictionary> lsLabState = new List<LabMS.Model.Dictionary>();

            Ds1 = DClass.GetModelList("Code = 'App_LabType'")[0];
            lsLabType = Dic.GetModelList(" DClass = '"+Ds1.Code+"'");

            Ds1=DClass.GetModelList("Code='App_ConstructionType'")[0];
            lsConType = Dic.GetModelList(" DClass='" + Ds1.Code + "'");

            App_LabType.DataSource = lsLabType;
            App_LabType.DataTextField = "Name";
            App_LabType.DataValueField = "Code";
            App_LabType.DataBind();
            App_LabType.Items.Insert(0, new ListItem("--��ѡ��һ��ѡ��--", "0"));

            App_ConstructionType.DataSource = lsConType;
            App_ConstructionType.DataTextField = "Name";
            App_ConstructionType.DataValueField = "Code";
            App_ConstructionType.DataBind();
            App_ConstructionType.Items.Insert(0, (new ListItem("ѡ��һ��ѡ��", "0")));

            LabMS.BLL.Lab Lab = new LabMS.BLL.Lab();
            List<LabMS.Model.Lab> ParentLab = new List<LabMS.Model.Lab>();
            ParentLab = Lab.GetModelList("Lab_ParentID is null");
            List<LabMS.Model.Lab> SonLab = new List<LabMS.Model.Lab>();
            SonLab = Lab.GetModelList("Lab_ParentID is not null");

            for (int i = 0; i < ParentLab.Count; i++)
            {
                App_LabName.Items.Add(new ListItem(ParentLab[i].Lab_Name, ParentLab[i].ID.ToString()));
                for (int j = 0; j < SonLab.Count; j++)
                {
                    if (SonLab[j].Lab_ParentID == ParentLab[i].ID)
                    {
                        App_LabName.Items.Add(new ListItem("--|" + SonLab[j].Lab_Name, SonLab[j].ID.ToString()));
                    }
                }
            }
            App_LabName.Items.Insert(0, new ListItem("--��ѡ��--", "0"));
        }
        public void bind(string strWhere)
        {
            lbErr.Visible = false;
            List<Model.RecipientsApp> listrescipientsappmodule = new List<Model.RecipientsApp>();
            ExtendBLL.RecipientsApp berescipients = new ExtendBLL.RecipientsApp();
            listrescipientsappmodule = berescipients.GetModelList(strWhere);

            LabMS.BLL.Lab blab = new LabMS.BLL.Lab();
            List<LabMS.Model.Lab> mLab = new List<LabMS.Model.Lab>();

            try
            {
                foreach (Model.RecipientsApp rapp in listrescipientsappmodule)
                {
                    mLab = blab.GetModelList("Lab_Code = '" + rapp.EncodedWarehouse + "'");
                    if (mLab.Count > 0)
                    {
                        rapp.EncodedWarehouse = mLab[0].Lab_Name;
                    }
                    else
                    {
                        rapp.EncodedWarehouse = "无";
                    }
                    mLab = blab.GetModelList("Lab_Code = '" + rapp.Laboratory + "'");
                    if (mLab.Count > 0)
                    {
                        rapp.Laboratory = mLab[0].Lab_Name;
                    }
                    else
                    {
                        rapp.Laboratory = "无";
                    }
                    rapp.Type = LabMS.Common.Global.GetEquipmentByCode(rapp.Type);
                    rapp.State = LabMS.Common.Status.GetOpenProjectStatus(rapp.State);
                }
            }
            catch(Exception ex)
            {
                lbErr.Text = ex.Message;
                lbErr.Visible = true;
                return;
            }

            GridViewrapp.DataSource = listrescipientsappmodule;
            GridViewrapp.DataBind();
        }
        protected void DataBinds()
        {
            LabMS.BLL.Lab Lab = new LabMS.BLL.Lab();
            List<LabMS.Model.Lab> ParentLab = new List<LabMS.Model.Lab>();
            ParentLab = Lab.GetModelList("Lab_ParentID is null");
            List<LabMS.Model.Lab> SonLab = new List<LabMS.Model.Lab>();
            SonLab = Lab.GetModelList("Lab_ParentID is not null");

            for (int i = 0; i < ParentLab.Count; i++)
            {
                ddl_Lab.Items.Add(new ListItem(ParentLab[i].Lab_Name, ParentLab[i].ID.ToString()));
                for (int j = 0; j < SonLab.Count; j++)
                {
                    if (SonLab[j].Lab_ParentID == ParentLab[i].ID)
                    {
                        ddl_Lab.Items.Add(new ListItem("--|" + SonLab[j].Lab_Name, SonLab[j].ID.ToString()));
                    }
                }
            }
            ddl_Lab.Items.Insert(0, new ListItem("--��ѡ��--", "0"));

            LabMS.BLL.DictionaryClass DicClass = new LabMS.BLL.DictionaryClass();
            LabMS.BLL.Dictionary Dic = new LabMS.BLL.Dictionary();
            LabMS.Model.DictionaryClass ds = new LabMS.Model.DictionaryClass();
            List<LabMS.Model.Dictionary> ls = new List<LabMS.Model.Dictionary>();
            if (DicClass.GetModelList("Code='Conflict'").Count != 0)
            {
                ds = DicClass.GetModelList("Code='Conflict'")[0];
                ls = Dic.GetModelList("DClass='" + ds.Code + "'");
                if (ls.Count != 0)
                {
                    rbl_Conflict.DataSource = ls;
                    rbl_Conflict.DataTextField = "Name";
                    rbl_Conflict.DataValueField = "Code";
                    rbl_Conflict.DataBind();
                }

            }

            YearDDL_DataBind();
            Gv_DataBinds();
        }
Exemple #18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            strPagePrivilege.Add("TJZY");
            strPageUserType.Add("mana");
            strPageUserType.Add("teacher");

            if (!Page.IsPostBack)
            {
                LabMS.BLL.Lab blab = new LabMS.BLL.Lab();
                List<LabMS.Model.Lab> mLab = new List<LabMS.Model.Lab>();
                mLab = blab.GetModelList(" Lab_ParentID is null ");
                ResourceLab.DataSource = mLab;
                ResourceLab.DataTextField = "Lab_Name";
                ResourceLab.DataValueField = "ID";
                ResourceLab.DataBind();

                ResourceLab.Items.Add(new ListItem("ȫ��", "-1"));
                ResourceLab.Items[ResourceLab.Items.Count - 1].Selected = true;
            }
        }
Exemple #19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            strPagePrivilege.Add("FBTZ");
            strPageUserType.Add("mana");

            if (!Page.IsPostBack)
            {
                LabMS.BLL.Lab lab = new LabMS.BLL.Lab();
                DataSet dsLab = lab.GetList(" Lab_ParentID is null ");

                LabList.DataTextField = "Lab_Name";
                LabList.DataValueField = "ID";

                LabList.DataSource = dsLab.Tables[0].DefaultView;
                LabList.DataBind();

                LabList.Items.Add(new ListItem("ȫ��", "-1"));
                LabList.Items[LabList.Items.Count - 1].Selected = true;
            }
        }
Exemple #20
0
 //�ж�ʵ�����Ƿ��Ѵ���
 protected bool IsCode(string code)
 {
     LabMS.BLL.Lab lab = new LabMS.BLL.Lab();
     List<LabMS.Model.Lab> list = new List<LabMS.Model.Lab>();
     if (ViewState["SubID"] != null)
     {
         list = lab.GetModelList("Lab_Code='" + code + "' and [ID]<>" + int.Parse(ViewState["SubID"].ToString()));
     }
     else
     {
         list = lab.GetModelList("Lab_Code='" + code + "'");
     }
     if (list.Count == 0)
     {
         return false;
     }
     else
     {
         return true;
     }
 }
Exemple #21
0
        //�ж�ʵ�����Ƿ��Ѵ���
        protected bool IsCode(string code)
        {
            LabMS.BLL.Lab lab = new LabMS.BLL.Lab();
            List<LabMS.Model.Lab> list = new List<LabMS.Model.Lab>();

            if (IDHF.Value != "0")
            {
                list = lab.GetModelList("Lab_Code='" + code + "' and [ID]<>" + int.Parse(IDHF.Value));
            }
            else
            {
                list = lab.GetModelList("Lab_Code='" + code + "'");
            }
            if (list.Count == 0)
            {
                return false;
            }
            else
            {
                return true;
            }
        }
        public void bind(string strWhere)
        {
            List<ExtendModule.InstrumentAndConsumables> listevaluables = new
               List<InstrumentAndConsumables>();
            ExtendBLL.InstrumentAndConsumables bevaluables = new ExtendBLL.InstrumentAndConsumables();
            listevaluables = bevaluables.GetExtendModelList(" Type = 'guizhongyiqi' " + strWhere + " order by ID desc ");

            LabMS.BLL.Lab blab = new LabMS.BLL.Lab();
            List<LabMS.Model.Lab> mLab = new List<LabMS.Model.Lab>();
            ExtendBLL.Dictionary eDictionary = new ExtendBLL.Dictionary();
            List<Model.Dictionary> listCClass = new List<LabMS.Model.Dictionary>();
            listCClass = eDictionary.GetItemListByDClass("haocaileibie");
            foreach (ExtendModule.InstrumentAndConsumables i in listevaluables)
            {
                mLab = blab.GetModelList(" Lab_Code='" + i.StockLocation + "'");
                if (mLab.Count > 0)
                {
                    i.StockLocation = mLab[0].Lab_Name;
                }
                listCClass = eDictionary.GetModelList(" DClass='shebeilaiyuan' and Code='" + i.Source + "' ");
                if (listCClass.Count > 0)
                {
                    i.Source = listCClass[0].Name;
                }
                listCClass = eDictionary.GetModelList(" DClass='shiyongfangxiang' and Code='" + i.Arrow + "' ");
                if (listCClass.Count > 0)
                {
                    i.Arrow = listCClass[0].Name;
                }
                listCClass = eDictionary.GetModelList(" DClass='shebeizhuangtai' and Code='" + i.PresentSituation + "' ");
                if (listCClass.Count > 0)
                {
                    i.PresentSituation = listCClass[0].Name;
                }
            }

            GridViewValuables.DataSource = listevaluables;
            GridViewValuables.DataBind();
        }
Exemple #23
0
        public void bindDDL(LabMS.Model.RecipientsApp mRecipientsApp)
        {
            LabMS.BLL.Lab blab = new LabMS.BLL.Lab();
            List<LabMS.Model.Lab> mLab = new List<LabMS.Model.Lab>();
            mLab = blab.GetModelList(" Lab_ParentID is null ");
            ddlLabs.DataSource = mLab;
            ddlLabs.DataTextField = "Lab_Name";
            ddlLabs.DataValueField = "Lab_Code";
            ddlLabs.DataBind();
            ddlLabs.SelectedValue = mRecipientsApp.EncodedWarehouse;

            ExtendBLL.Dictionary eDictionary = new ExtendBLL.Dictionary();
            List<Model.Dictionary> listCClass = new List<LabMS.Model.Dictionary>();

            listCClass = eDictionary.GetItemListByDClass("shiyongfangxiang");
            ddlArrow.DataSource = listCClass;
            ddlArrow.DataTextField = "Name";
            ddlArrow.DataValueField = "Code";
            ddlArrow.DataBind();
            ddlArrow.SelectedValue = mRecipientsApp.Arrow;

            ddlEType.SelectedValue = mRecipientsApp.Type;
        }
        protected void ControlDataBinds()
        {
            LabMS.BLL.Lab Lab = new LabMS.BLL.Lab();
            List<LabMS.Model.Lab> ParentLab = new List<LabMS.Model.Lab>();
            ParentLab = Lab.GetModelList("Lab_ParentID is null");
            List<LabMS.Model.Lab> SonLab = new List<LabMS.Model.Lab>();
            SonLab = Lab.GetModelList("Lab_ParentID is not null");

            for (int i = 0; i < ParentLab.Count; i++)
            {
                ddl_Lab.Items.Add(new ListItem(ParentLab[i].Lab_Name, ParentLab[i].ID.ToString()));
                for (int j = 0; j < SonLab.Count; j++)
                {
                    if (SonLab[j].Lab_ParentID == ParentLab[i].ID)
                    {
                        ddl_Lab.Items.Add(new ListItem("--|" + SonLab[j].Lab_Name, SonLab[j].ID.ToString()));
                    }
                }
            }
            ddl_Lab.Items.Insert(0, new ListItem("--��ѡ��--", "0"));

            LabMS.BLL.Dictionary Dic = new LabMS.BLL.Dictionary();
            List<LabMS.Model.Dictionary> ls = new List<LabMS.Model.Dictionary>();
            ls = Dic.GetModelList("DClass='App_ConstructionType'");
            cbl_ConType.DataSource = ls;
            cbl_ConType.DataTextField = "Name";
            cbl_ConType.DataValueField = "Code";
            cbl_ConType.DataBind();

            List<LabMS.Model.Dictionary> ls2 = new List<LabMS.Model.Dictionary>();
            ls2 = Dic.GetModelList("DClass='App_State'");
            ddl_State.DataSource = ls2;
            ddl_State.DataTextField = "Name";
            ddl_State.DataValueField = "Code";
            ddl_State.DataBind();
            ddl_State.Items.Insert(0, new ListItem("--��ѡ��--", "0"));
        }
        void bind()
        {
            LabMS.BLL.Lab blab = new LabMS.BLL.Lab();
            List<LabMS.Model.Lab> mLab = new List<LabMS.Model.Lab>();
            mLab = blab.GetModelList(" Lab_ParentID is null ");
            ddlLabs.DataSource = mLab;
            ddlLabs.DataTextField = "Lab_Name";
            ddlLabs.DataValueField = "Lab_Code";
            ddlLabs.DataBind();

            ExtendBLL.Dictionary eDictionary = new ExtendBLL.Dictionary();
            List<Model.Dictionary> listCClass = new List<LabMS.Model.Dictionary>();

            listCClass = eDictionary.GetItemListByDClass("shiyongfangxiang");
            ddlArrow.DataSource = listCClass;
            ddlArrow.DataTextField = "Name";
            ddlArrow.DataValueField = "Code";
            ddlArrow.DataBind();
        }
Exemple #26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            strPagePrivilege.Add("QBZY");

            if (!UserType.Equals("mana")) { modify.Style.Add("display", "none"); }

            if (!Page.IsPostBack)
            {
                try
                {
                    #region Get id

                    int id;

                    if (string.IsNullOrEmpty(Request.QueryString["id"]))
                    {
                        throw new Exception("�Բ����������ʵ�ҳ�治����");
                    }

                    try
                    {
                        id = int.Parse(Request.QueryString["id"]);
                    }
                    catch
                    {
                        throw new Exception("�Բ����������ʵ�ҳ�治����");
                    }

                    #endregion

                    LabMS.Model.Resource resourceInfo;
                    ExtendBLL.Resource resource = new ExtendBLL.Resource();

                    resourceInfo = resource.GetModel(id);

                    if (resourceInfo == null)
                    {
                        throw new Exception("�Բ����������ʵ�ҳ�治����");
                    }

                    LabMS.BLL.Lab lab = new LabMS.BLL.Lab();
                    LabMS.Model.Lab labInfo = lab.GetModel(resourceInfo.LabID.Value);

                    ResourceLab.Text = (labInfo == null) ? "ȫ��" : labInfo.Lab_Name;

                    if (resourceInfo.RecorderType == 0) // ����Ա
                    {
                        BLL.UserTable staff = new LabMS.BLL.UserTable();
                        LabMS.Model.UserTable staffInfo = staff.GetModel(resourceInfo.ResourceRecorder.HasValue ? resourceInfo.ResourceRecorder.Value : 0);

                        ResourceRecorder.Text = (staffInfo == null) ? "<del>��ɾ���û�</del>" : staffInfo.UserName + " ����Ա";
                    }
                    else if (resourceInfo.RecorderType == 1)
                    {
                        LabMS.BLL.Teacher teacher = new LabMS.BLL.Teacher();
                        LabMS.Model.Teacher teacherInfo = teacher.GetModel(resourceInfo.ResourceRecorder.HasValue ? resourceInfo.ResourceRecorder.Value : 0);
                        ResourceRecorder.Text = (teacherInfo == null) ? "<del>��ɾ���û�</del>" : teacherInfo.Teacher_Name + " ��ʦ";
                    }

                    // ResourceType.Text = resourceInfo.ResourceType.HasValue ? resourceInfo.ResourceType.Value.ToString() : ""; // TBD

                    ResourceTitle.Text = resourceInfo.ResourceTitle;
                    ResourceContent.Text = Server.HtmlDecode(resourceInfo.ResourceContent);
                    ResourceVisitTime.Text = (resourceInfo.ResourceVisitTime.Value + 1).ToString();
                    ResourceRecordTime.Text = resourceInfo.ResourceRecordTime.Value.ToString("yyyy��MM��dd�� HH:mm");

                    if (!string.IsNullOrEmpty(resourceInfo.ResourceAttachmentPath))
                    {
                        ResourceAttachment.Text = "<a target='_blank' href='" + resourceInfo.ResourceAttachmentPath + "' >������ظ���</a>";
                    }
                    else
                    {
                        ResourceAttachment.Text = "<label style='color: #ff0000;'>���޸���</label>";
                    }

                    #region Tags

                    DataSet dsTags = resource.GetTags(resourceInfo);

                    System.Text.StringBuilder sb = new System.Text.StringBuilder();

                    for (int i = dsTags.Tables[0].Rows.Count - 1; i > -1; i--)
                    {
                        sb.Append(dsTags.Tables[0].Rows[i]["TagName"]);

                        if (i != 0) { sb.Append(","); }
                    }

                    ResourceTags.Text = sb.ToString();

                    #endregion

                    resourceInfo.ResourceVisitTime += 1;
                    resource.Update(resourceInfo);

                }
                catch (Exception ex)
                {
                }
            }
        }
        void IniPage(string strYear, string strSemester)
        {
            List<LabMS.Model.Lab> listlab = new List<LabMS.Model.Lab>();
            LabMS.BLL.Lab blab = new LabMS.BLL.Lab();
            try
            {
                listlab = blab.GetModelList("");
            }
            catch (Exception ex)
            {
                lbErr.Visible = true;
                lbErr.Text = ex.Message;
                return;
            }

            List<LabMS.Model.OpentProject> listopproject = new List<LabMS.Model.OpentProject>();
            LabMS.BLL.OpentProject bopproject = new LabMS.BLL.OpentProject();
            List<LabMS.Model.Teacher> listmteacher = new List<LabMS.Model.Teacher>();
            LabMS.BLL.Teacher bteacher = new LabMS.BLL.Teacher();
            List<LabMS.Model.ProjectAppointment> listprojectapp = new List<LabMS.Model.ProjectAppointment>();
            ExtendBLL.ProjectAppointment bprojectapp = new ExtendBLL.ProjectAppointment();

            string strtotalTable = "<table cellpadding='5' cellspacing='0' border='1' style='width: 100%; border-collapse: collapse;' class='infoTable'>";
            strtotalTable += "<thead>";
            strtotalTable += "<tr class='header'>";
            strtotalTable += "<th scope='col'>";
            strtotalTable += "实验室";
            strtotalTable += "</th>";
            strtotalTable += "<th scope='col'>";
            strtotalTable += "开放项目";
            strtotalTable += "</th>";
            strtotalTable += "</tr>";
            strtotalTable += "</thead>";

            strtotalTable += "<tbody>";

            foreach (LabMS.Model.Lab l in listlab)
            {
                strtotalTable += "<tr>";
                strtotalTable += "<td>";
                strtotalTable += l.Lab_Name;
                strtotalTable += "</td>";
                strtotalTable += "<td>";
                try
                {
                    listopproject = bopproject.GetModelList(" SYear=" + strYear + " and Semester = " + strSemester
                                                                            + "  and Project_Lab='" + l.Lab_Code + "' order by ID");
                }
                catch (Exception ex)
                {
                    lbErr.Visible = true;
                    lbErr.Text = ex.Message;
                    return;
                }

                if (listopproject.Count > 0)
                {
                    strtotalTable += "<table cellpadding='0' cellspacing='0' border='1' style='width: 100%; border-collapse: collapse;' class='infoTable'>";
                    strtotalTable += "<thead>";
                    strtotalTable += "<tr class='header'>";
                    strtotalTable += "<td scope='col'>";
                    strtotalTable += "实验项目";
                    strtotalTable += "</td>";
                    strtotalTable += "<td scope='col'>";
                    strtotalTable += "时间(周次)";
                    strtotalTable += "</td>";
                    strtotalTable += "<td scope='col'>";
                    strtotalTable += "指导老师";
                    strtotalTable += "</td>";
                    strtotalTable += "<td scope='col'>";
                    strtotalTable += "学生数";
                    strtotalTable += "</td>";
                    strtotalTable += "</tr>";
                    strtotalTable += "</thead>";
                    strtotalTable += "<tbody>";
                    foreach (LabMS.Model.OpentProject o in listopproject)
                    {
                        strtotalTable += "<tr>";
                        strtotalTable += "<td>";
                        strtotalTable += o.OP_ProjectName;
                        strtotalTable += "</td>";
                        strtotalTable += "<td>";
                        strtotalTable += o.Project_StartWeek.Value.ToString() + "--" + o.Project_EndWeek.Value.ToString();
                        strtotalTable += "</td>";
                        strtotalTable += "<td>";
                        try
                        {
                            listmteacher = bteacher.GetModelList(" Teacher_Code= '" + o.OP_Teacher + "'");
                        }
                        catch (Exception ex)
                        {
                            lbErr.Visible = true;
                            lbErr.Text = ex.Message;
                            return;
                        }

                        if (listmteacher.Count > 0)
                        {
                            o.OP_Teacher = listmteacher[0].Teacher_Name;
                        }
                        strtotalTable += o.OP_Teacher;
                        strtotalTable += "</td>";
                        strtotalTable += "<td>";
                        try
                        {
                            listprojectapp = bprojectapp.GetModelList(" OP_ProjectCode ='" + o.OP_ProjectCode + "'");
                        }
                        catch (Exception ex)
                        {
                            lbErr.Visible = true;
                            lbErr.Text = ex.Message;
                            return;
                        }

                        o.OP_OpenType = listprojectapp.Count.ToString();
                        strtotalTable += o.OP_OpenType;
                        strtotalTable += "</td>";
                        strtotalTable += "</tr>";
                    }
                    strtotalTable += "</tbody>";
                    strtotalTable += "</table>";
                }
                else
                {
                    strtotalTable += "无";
                }
                strtotalTable += "</td>";
                strtotalTable += "</tr>";
            }

            strtotalTable += "</tbody>";

            strtotalTable += "</table>";
            lbSituation.Text = strtotalTable;
        }
Exemple #28
0
        protected void DataBinds()
        {
            #region DataBinds
            int ID = Convert.ToInt32(Request.QueryString["ID"].ToString());
            LabMS.BLL.Project Project = new LabMS.BLL.Project();
            LabMS.Model.Project model = new LabMS.Model.Project();
            model = Project.GetModel(ID);
            //�����ݿ�ʼ

            LabMS.BLL.DictionaryClass DicClass = new LabMS.BLL.DictionaryClass();
            LabMS.Model.DictionaryClass ds = new LabMS.Model.DictionaryClass();
            LabMS.BLL.Dictionary Dic = new LabMS.BLL.Dictionary();
            List<LabMS.Model.Dictionary> ls = new List<LabMS.Model.Dictionary>();

            //ʵ����Ŀ��� Category
            if (DicClass.GetModelList("Code='Project_Category'").Count != 0)
            {
                ds = DicClass.GetModelList("Code='Project_Category'")[0];
                ls = Dic.GetModelList("DClass='" + ds.Code + "'");
                ddl_Category.DataSource = ls;
                ddl_Category.DataTextField = "Name";
                ddl_Category.DataValueField = "Code";
                ddl_Category.DataBind();
                if (!string.IsNullOrEmpty(model.Project_Category))
                {
                    ddl_Category.Items.FindByValue(model.Project_Category).Selected = true;
                }

            }
            // ʵ������Ŀ Lab

            LabMS.BLL.Lab Lab = new LabMS.BLL.Lab();
            List<LabMS.Model.Lab> ParentLab = new List<LabMS.Model.Lab>();
            ParentLab = Lab.GetModelList("Lab_ParentID is null");
            List<LabMS.Model.Lab> SonLab = new List<LabMS.Model.Lab>();
            SonLab = Lab.GetModelList("Lab_ParentID is not null");

            for (int i = 0; i < ParentLab.Count; i++)
            {
                ddl_Lab.Items.Add(new ListItem(ParentLab[i].Lab_Name, ParentLab[i].ID.ToString()));
                for (int j = 0; j < SonLab.Count; j++)
                {
                    if (SonLab[j].Lab_ParentID == ParentLab[i].ID)
                    {
                        ddl_Lab.Items.Add(new ListItem("--|" + SonLab[j].Lab_Name, SonLab[j].ID.ToString()));
                    }
                }
            }

            if (model.Project_Lab != null)
            {
                ddl_Lab.Items.FindByValue(model.Project_Lab.ToString()).Selected = true;
            }

            if (DicClass.GetModelList("Code='Project_AwardLevel'").Count != 0)
            {
                ds = DicClass.GetModelList("Code='Project_AwardLevel'")[0];
                ls = Dic.GetModelList("DClass='" + ds.Code + "'");
                ddl_AwardLevel.DataSource = ls;
                ddl_AwardLevel.DataTextField = "Name";
                ddl_AwardLevel.DataValueField = "Code";
                ddl_AwardLevel.DataBind();
                if (!string.IsNullOrEmpty(model.Project_AwardLevel))
                {
                    ddl_AwardLevel.Items.FindByValue(model.Project_AwardLevel).Selected = true;
                }
            }

            //ʵ��������

            if (DicClass.GetModelList("Code='Project_PartnerType'").Count != 0)
            {
                ds = DicClass.GetModelList("Code='Project_PartnerType'")[0];
                ls = Dic.GetModelList("DClass='" + ds.Code + "'");
                ddl_ParterType.DataSource = ls;
                ddl_ParterType.DataTextField = "Name";
                ddl_ParterType.DataValueField = "Code";
                ddl_ParterType.DataBind();
                if (!string.IsNullOrEmpty(model.Project_PartnerType))
                {
                    ddl_ParterType.Items.FindByValue(model.Project_PartnerType).Selected = true;
                }
            }

            if (DicClass.GetModelList("Code='Project_Type'").Count != 0)
            {
                ds = DicClass.GetModelList("Code='Project_Type'")[0];
                ls = Dic.GetModelList("DClass='" + ds.Code + "'");
                ddl_Type.DataSource = ls;
                ddl_Type.DataTextField = "Name";
                ddl_Type.DataValueField = "Code";
                ddl_Type.DataBind();
                if (!string.IsNullOrEmpty(model.Project_Type))
                {
                    ddl_Type.Items.FindByValue(model.Project_Type).Selected = true;
                }
            }

            if (DicClass.GetModelList("Code='Project_Request'").Count != 0)
            {
                ds = DicClass.GetModelList("Code='Project_Request'")[0];
                ls = Dic.GetModelList("DClass='" + ds.Code + "'");
                ddl_Request.DataSource = ls;
                ddl_Request.DataTextField = "Name";
                ddl_Request.DataValueField = "Code";
                ddl_Request.DataBind();
                if (!string.IsNullOrEmpty(model.Project_Request))
                {
                    ddl_Request.Items.FindByValue(model.Project_Request).Selected = true;
                }
            }

            if (DicClass.GetModelList("Code='Project_Change'").Count != 0)
            {
                ds = DicClass.GetModelList("Code='Project_Change'")[0];
                ls = Dic.GetModelList("DClass='" + ds.Code + "'");
                ddl_Change.DataSource = ls;
                ddl_Change.DataTextField = "Name";
                ddl_Change.DataValueField = "Code";
                ddl_Change.DataBind();
                if (!string.IsNullOrEmpty(model.Project_Change))
                {
                    ddl_Change.Items.FindByValue(model.Project_Change).Selected = true;
                }
            }

            if (DicClass.GetModelList("Code='Project_CourseMode'").Count != 0)
            {
                ds = DicClass.GetModelList("Code='Project_CourseMode'")[0];
                ls = Dic.GetModelList("DClass='" + ds.Code + "'");
                cbl_CourseMode.DataSource = ls;
                cbl_CourseMode.DataTextField = "Name";
                cbl_CourseMode.DataValueField = "Code";
                cbl_CourseMode.DataBind();
                string[] cm = model.Project_CourseMode.Split('|');
                foreach (string c in cm)
                {
                    if (!string.IsNullOrEmpty(c.Trim()))
                    {
                        cbl_CourseMode.Items.FindByValue(c.Trim()).Selected = true;
                    }
                }
            }

            // ����רҵ
            LabMS.BLL.Professional Pro = new LabMS.BLL.Professional();
            List<LabMS.Model.Professional> lsPro = new List<LabMS.Model.Professional>();
            lsPro = Pro.GetModelList("");
            if (lsPro.Count != 0)
            {
                ddl_Profess.DataSource = lsPro;
                ddl_Profess.DataTextField = "Pro_Name";
                ddl_Profess.DataValueField = "ID";
                ddl_Profess.DataBind();
                if (model.Project_Professional != null)
                {
                    ddl_Profess.Items.FindByValue(model.Project_Professional.ToString()).Selected = true;
                }
            }

            tb_ClassHourse.Text = model.Project_ClassHourse.ToString();
            tb_Code.Text = model.Project_Code;
            if (model.Project_EndTime != null)
            {
                tb_EndTime.Text = model.Project_EndTime.Value.ToShortDateString();
            }
            tb_EndWeek.Text = model.Project_EndWeek.ToString();
            tb_ExpHouse.Text = model.Project_ExpHouse.ToString();
            tb_Name.Text = model.Project_Name;
            tb_PatnerNum.Text = model.Project_PartnerNum.ToString();
            if (model.Project_StartTime != null)
            {
                tb_StartTime.Text = model.Project_StartTime.Value.ToShortDateString();
            }
            tb_StartWeek.Text = model.Project_StartWeek.ToString();
            tb_Content.Text = model.Project_Content;
            //tb_Subject.Text = model.Project_Subject;

            if (model.Project_Subject != "")
            {
                ls = Dic.GetModelList("Code='" + model.Project_Subject+"'");
                if (ls.Count > 0)
                {
                    tb_Subject.Text = ls[0].Name;
                    tb_SubjectCode.Text = ls[0].Code;
                }
            }
            tb_PerConsume.Text = model.Project_PerConsume.ToString();
            tb_Cunsume.Text = model.Project_Consume.ToString();

            #endregion
        }
Exemple #29
0
        /// <summary>
        /// 处理DS
        /// </summary>
        /// <param name="ds"></param>
        /// <returns></returns>
        protected DataSet HandleData(DataSet ds)
        {
            ds.Tables[0].Columns.Add("LabName");
            ds.Tables[0].Columns.Add("RecorderName");
            ds.Tables[0].Columns.Add("AttatchmentPath");

            LabMS.Model.Lab labInfo;
            LabMS.BLL.Lab lab = new LabMS.BLL.Lab();

            for (int i = ds.Tables[0].Rows.Count - 1; i > -1; i--)
            {
                int labID = int.Parse(ds.Tables[0].Rows[i]["LabID"].ToString());
                labInfo = lab.GetModel(labID);

                ds.Tables[0].Rows[i]["LabName"] = (labInfo != null) ? labInfo.Lab_Name : "全部";

                if (ds.Tables[0].Rows[i]["ResourceRecorderType"].ToString() == "0") // 管理员
                {
                    BLL.UserTable ut = new LabMS.BLL.UserTable();
                    LabMS.Model.UserTable utInfo = ut.GetModel(int.Parse(ds.Tables[0].Rows[i]["ResourceRecorder"].ToString()));

                    ds.Tables[0].Rows[i]["RecorderName"] = (utInfo == null) ? "<del>已删除管理员</del>" : utInfo.UserName + " 管理员";
                }
                else
                {
                    BLL.Teacher teacher = new LabMS.BLL.Teacher();
                    LabMS.Model.Teacher teacherInfo = teacher.GetModel(int.Parse(ds.Tables[0].Rows[i]["ResourceRecorder"].ToString()));

                    ds.Tables[0].Rows[i]["RecorderName"] = (teacherInfo == null) ? "<del>已删除老师</del>" : teacherInfo.Teacher_Name + " 老师";
                }

                ds.Tables[0].Rows[i]["AttatchmentPath"] = ds.Tables[0].Rows[i]["ResourceAttachmentPath"];
            }

            return ds;
        }
        void bind(string strwhere)
        {
            LabMS.Model.SysSetting msys = new LabMS.Model.SysSetting();
            ExtendBLL.SysSetting extendsys = new ExtendBLL.SysSetting();
            msys = extendsys.GetCurrentSetting();

            List<LabMS.Model.OpentProject> listmopproject = new List<LabMS.Model.OpentProject>();
            LabMS.BLL.OpentProject bopproject = new LabMS.BLL.OpentProject();

            if (strwhere.Equals(""))
            {
                strwhere += " 1=1 ";
            }

            strwhere += " and  SYear = " + msys.CurrentYear + " and Semester = " + msys.CurrentSemester;

            if (UserType == "teacher")
            {
                strwhere += " and  OP_Teacher = '" + UserCode + "'";
            }

            listmopproject = bopproject.GetModelList(strwhere + " order by ID desc ");

            foreach (LabMS.Model.OpentProject op in listmopproject)
            {
                List<LabMS.Model.Teacher> listmteacher = new List<LabMS.Model.Teacher>();
                LabMS.BLL.Teacher bteacher = new LabMS.BLL.Teacher();
                listmteacher = bteacher.GetModelList(" Teacher_Code= '" + op.OP_Teacher + "'");
                if (listmteacher.Count > 0)
                {
                    op.OP_Teacher = listmteacher[0].Teacher_Name;
                }

                LabMS.BLL.Lab blab = new LabMS.BLL.Lab();
                List<LabMS.Model.Lab> mLab = new List<LabMS.Model.Lab>();
                mLab = blab.GetModelList(" Lab_Code='"+ op.Project_Lab +"'");
                if (mLab.Count > 0)
                {
                    op.Project_Lab = mLab[0].Lab_Name;
                }
                ExtendBLL.Dictionary eDictionary = new ExtendBLL.Dictionary();
                List<Model.Dictionary> listCClass = new List<LabMS.Model.Dictionary>();
                listCClass = eDictionary.GetModelList("DClass = 'shiyanyaoqiu' and Code = '"+op.Project_Require+"'");
                if (listCClass.Count > 0)
                {
                    op.Project_Require = listCClass[0].Name;
                }
                op.OP_Phone = op.Project_StartWeek.ToString()+"--"+op.Project_EndWeek.ToString();
                List<LabMS.Model.ProjectAppointment>listprojectapp = new List<LabMS.Model.ProjectAppointment>();
                ExtendBLL.ProjectAppointment bprojectapp = new ExtendBLL.ProjectAppointment();
                listprojectapp = bprojectapp.GetModelList(" OP_ProjectCode ='"+op.OP_ProjectCode+"'");
                op.OP_OpenType = listprojectapp.Count.ToString();
                listCClass = eDictionary.GetModelList("DClass = 'shiyanleixing' and Code = '" + op.Project_Type + "'");
                if (listCClass.Count > 0)
                {
                    op.Project_Type = listCClass[0].Name;
                }
                if (op.OP_Audit == "0")
                {

                }
                op.OP_Audit = LabMS.Common.Status.GetOpenProjectStatus(op.OP_Audit);

            }

            gv_OpenProjectList.DataSource = listmopproject;
            gv_OpenProjectList.DataBind();
        }