当前位置: 首页>>代码示例>>C#>>正文


C# LabMS类代码示例

本文整理汇总了C#中LabMS的典型用法代码示例。如果您正苦于以下问题:C# LabMS类的具体用法?C# LabMS怎么用?C# LabMS使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


LabMS类属于命名空间,在下文中一共展示了LabMS类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Add

        /// <summary>
        /// ����һ������
        /// </summary>
        public int Add(LabMS.Model.ProfessionalPlan model)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("insert into ProfessionalPlan(");
            strSql.Append("Pro_Year,Pro_SubmitTime,Pro_Professional,Pro_Curriculum,Pro_Content)");
            strSql.Append(" values (");
            strSql.Append("@Pro_Year,@Pro_SubmitTime,@Pro_Professional,@Pro_Curriculum,@Pro_Content)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
                    new SqlParameter("@Pro_Year", SqlDbType.Int,4),
                    new SqlParameter("@Pro_SubmitTime", SqlDbType.DateTime),
                    new SqlParameter("@Pro_Professional", SqlDbType.Int,4),
                    new SqlParameter("@Pro_Curriculum", SqlDbType.Int,4),
                    new SqlParameter("@Pro_Content", SqlDbType.Text)};
            parameters[0].Value = model.Pro_Year;
            parameters[1].Value = model.Pro_SubmitTime;
            parameters[2].Value = model.Pro_Professional;
            parameters[3].Value = model.Pro_Curriculum;
            parameters[4].Value = model.Pro_Content;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(),parameters);
            if (obj == null)
            {
                return 1;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
开发者ID:dalinhuang,项目名称:labms,代码行数:33,代码来源:ProfessionalPlan.cs

示例2: Insert

        public void Insert(LabMS.Model.VoteJson voteJson)
        {
            LabMS.Model.Vote voteInfo = new LabMS.Model.Vote();

            voteInfo.VoteTitle = voteJson.Title;
            voteInfo.VoteStartTime = DateTime.Now;

            voteInfo.VoteLimit = voteJson.Limit;

            voteInfo.key = base.Add(voteInfo); // Insert vote

            foreach (LabMS.Model.VoteItemJson item in voteJson.Items)
            {
                LabMS.Model.VoteItem voteItemInfo = new LabMS.Model.VoteItem();
                LabMS.BLL.VoteItem voteItem = new LabMS.BLL.VoteItem();
                voteItemInfo.VoteID = voteInfo.key;
                voteItemInfo.VoteItemContent = item.Title;

                voteItemInfo.key = voteItem.Add(voteItemInfo); // Insert Item

                foreach (LabMS.Model.VoteAnswerJson answer in item.Answers)
                {
                    LabMS.Model.VoteAnswer voteAnswerInfo = new LabMS.Model.VoteAnswer();
                    LabMS.BLL.VoteAnswer voteAnswer = new LabMS.BLL.VoteAnswer();

                    voteAnswerInfo.VoteItemID = voteItemInfo.key;
                    voteAnswerInfo.VoteAnswerContent = answer.Name;

                    voteAnswer.Add(voteAnswerInfo); // Insert answer
                }
            }
        }
开发者ID:dalinhuang,项目名称:labms,代码行数:32,代码来源:Vote.cs

示例3: Insert

        public void Insert(List<LabMS.Model.ResearchProject> models, LabMS.Model.ResearchImportType type)
        {
            if (models.Count < 1) { return; }

            if (type == LabMS.Model.ResearchImportType.Add)
            {
                foreach (LabMS.Model.ResearchProject model in models)
                {
                    base.Add(model);
                }
            }
            else if (type == LabMS.Model.ResearchImportType.RecoverAdd)
            {
                foreach (LabMS.Model.ResearchProject model in models)
                {
                    RecoverAdd(model);
                }
            }
            else
            {
                DeleteAll();

                foreach (LabMS.Model.ResearchProject model in models)
                {
                    base.Add(model);
                }
            }
        }
开发者ID:dalinhuang,项目名称:labms,代码行数:28,代码来源:ResearchProject.cs

示例4: Add

        /// <summary>
        /// ����һ������
        /// </summary>
        public int Add(LabMS.Model.VoteRecordDetail model)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("insert into VoteRecordDetail(");
            strSql.Append("VoteRecordID,VoteItemID,VoteAnswerID)");
            strSql.Append(" values (");
            strSql.Append("@VoteRecordID,@VoteItemID,@VoteAnswerID)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
                    new SqlParameter("@VoteRecordID", SqlDbType.Int,4),
                    new SqlParameter("@VoteItemID", SqlDbType.Int,4),
                    new SqlParameter("@VoteAnswerID", SqlDbType.Int,4)};
            parameters[0].Value = model.VoteRecordID;
            parameters[1].Value = model.VoteItemID;
            parameters[2].Value = model.VoteAnswerID;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(),parameters);
            if (obj == null)
            {
                return 1;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
开发者ID:dalinhuang,项目名称:labms,代码行数:29,代码来源:VoteRecordDetail.cs

示例5: Add

        /// <summary>
        /// ����һ������
        /// </summary>
        public int Add(LabMS.Model.Responsibility model)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("insert into Responsibility(");
            strSql.Append("Resp_Lab,Resp_Name,Resp_Content,Intro,Summary)");
            strSql.Append(" values (");
            strSql.Append("@Resp_Lab,@Resp_Name,@Resp_Content,@Intro,@Summary)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
                    new SqlParameter("@Resp_Lab", SqlDbType.Int,4),
                    new SqlParameter("@Resp_Name", SqlDbType.VarChar,50),
                    new SqlParameter("@Resp_Content", SqlDbType.VarChar,200),
                    new SqlParameter("@Intro", SqlDbType.VarChar,100),
                    new SqlParameter("@Summary", SqlDbType.VarChar,200)};
            parameters[0].Value = model.Resp_Lab;
            parameters[1].Value = model.Resp_Name;
            parameters[2].Value = model.Resp_Content;
            parameters[3].Value = model.Intro;
            parameters[4].Value = model.Summary;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(),parameters);
            if (obj == null)
            {
                return 1;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
开发者ID:dalinhuang,项目名称:labms,代码行数:33,代码来源:Responsibility.cs

示例6: Add

        /// <summary>
        /// ����һ������
        /// </summary>
        public int Add(LabMS.Model.CourseTiming model)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("insert into CourseTiming(");
            strSql.Append("Nub,STime,ETime,����)");
            strSql.Append(" values (");
            strSql.Append("@Nub,@STime,@ETime,@����)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
                    new SqlParameter("@Nub", SqlDbType.Int,4),
                    new SqlParameter("@STime", SqlDbType.DateTime),
                    new SqlParameter("@ETime", SqlDbType.DateTime),
                    new SqlParameter("@����", SqlDbType.Int,4)};
            parameters[0].Value = model.Nub;
            parameters[1].Value = model.STime;
            parameters[2].Value = model.ETime;
            parameters[3].Value = model.����;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(),parameters);
            if (obj == null)
            {
                return 1;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
开发者ID:dalinhuang,项目名称:labms,代码行数:31,代码来源:CourseTiming.cs

示例7: ValidateVote

        /// <summary>
        /// ��֤����
        /// </summary>
        /// <param name="json"></param>
        private void ValidateVote(LabMS.Model.VoteRecordJson json)
        {
            ExtendBLL.Vote vote = new ExtendBLL.Vote();
            LabMS.Model.Vote voteInfo = vote.GetModel(json.VoteID);

            if (voteInfo == null)
            {
                throw new Exception("���������Ѿ�ʧЧ");
            }

            bool exists = false;

            switch (voteInfo.VoteLimit)
            {
                case 0:
                    break;
                case 1: // ÿIPһ��
                    exists = Exist(" [IP]='" + json.IP + "' and [VoteID]=" + json.VoteID);
                    if (exists)
                    {
                        throw new Exception("�Բ���ÿ��IPֻ�ܲ���һ������!");
                    }
                    break;
                case 2:
                    exists = Exist(" [UserID]=" + json.UserID + " and [VoteID]=" + json.VoteID + " and [UserType] = " + json.UserType);
                    if (exists)
                    {
                        throw new Exception("�Բ������Ѿ��������������������!");
                    }
                    break;
                default:
                    break;
            }
        }
开发者ID:dalinhuang,项目名称:labms,代码行数:38,代码来源:VoteRecord.cs

示例8: Add

        /// <summary>
        /// ����һ������
        /// </summary>
        public int Add(LabMS.Model.PostReply model)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("insert into PostReply(");
            strSql.Append("PostReplyContent,PosterID,PostReplyTime,ReplierID,ReplierType)");
            strSql.Append(" values (");
            strSql.Append("@PostReplyContent,@PosterID,@PostReplyTime,@ReplierID,@ReplierType)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
                    new SqlParameter("@PostReplyContent", SqlDbType.Text),
                    new SqlParameter("@PosterID", SqlDbType.Int,4),
                    new SqlParameter("@PostReplyTime", SqlDbType.DateTime),
                    new SqlParameter("@ReplierID", SqlDbType.Int,4),
                    new SqlParameter("@ReplierType", SqlDbType.Int,4)};
            parameters[0].Value = model.PostReplyContent;
            parameters[1].Value = model.PosterID;
            parameters[2].Value = model.PostReplyTime;
            parameters[3].Value = model.ReplierID;
            parameters[4].Value = model.ReplierType;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(),parameters);
            if (obj == null)
            {
                return 1;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
开发者ID:dalinhuang,项目名称:labms,代码行数:33,代码来源:PostReply.cs

示例9: Add

        /// <summary>
        /// ����һ������
        /// </summary>
        public int Add(LabMS.Model.ValuablesAnnualBenefitEvaluation model)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("insert into ValuablesAnnualBenefitEvaluation(");
            strSql.Append("Numbers,Comment,Years,Score,Operator,OperatDate,Effective,Fixed,IndependentlyNub,GuidanceNub,ExperimentNub,InternationalAwards,MinisterialAwards,ColonelAward,CorePublications,OutSchool,InSchool,MakeUse,OriginalFunctional,IncreaseFunctional)");
            strSql.Append(" values (");
            strSql.Append("@Numbers,@Comment,@Years,@Score,@Operator,@OperatDate,@Effective,@Fixed,@IndependentlyNub,@GuidanceNub,@ExperimentNub,@InternationalAwards,@MinisterialAwards,@ColonelAward,@CorePublications,@OutSchool,@InSchool,@MakeUse,@OriginalFunctional,@IncreaseFunctional)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
                    new SqlParameter("@Numbers", SqlDbType.VarChar,50),
                    new SqlParameter("@Comment", SqlDbType.VarChar,100),
                    new SqlParameter("@Years", SqlDbType.VarChar,20),
                    new SqlParameter("@Score", SqlDbType.VarChar,20),
                    new SqlParameter("@Operator", SqlDbType.VarChar,30),
                    new SqlParameter("@OperatDate", SqlDbType.DateTime),
                    new SqlParameter("@Effective", SqlDbType.Int,4),
                    new SqlParameter("@Fixed", SqlDbType.Int,4),
                    new SqlParameter("@IndependentlyNub", SqlDbType.Int,4),
                    new SqlParameter("@GuidanceNub", SqlDbType.Int,4),
                    new SqlParameter("@ExperimentNub", SqlDbType.Int,4),
                    new SqlParameter("@InternationalAwards", SqlDbType.Int,4),
                    new SqlParameter("@MinisterialAwards", SqlDbType.Int,4),
                    new SqlParameter("@ColonelAward", SqlDbType.Int,4),
                    new SqlParameter("@CorePublications", SqlDbType.Int,4),
                    new SqlParameter("@OutSchool", SqlDbType.Int,4),
                    new SqlParameter("@InSchool", SqlDbType.Int,4),
                    new SqlParameter("@MakeUse", SqlDbType.Int,4),
                    new SqlParameter("@OriginalFunctional", SqlDbType.Int,4),
                    new SqlParameter("@IncreaseFunctional", SqlDbType.Int,4)};
            parameters[0].Value = model.Numbers;
            parameters[1].Value = model.Comment;
            parameters[2].Value = model.Years;
            parameters[3].Value = model.Score;
            parameters[4].Value = model.Operator;
            parameters[5].Value = model.OperatDate;
            parameters[6].Value = model.Effective;
            parameters[7].Value = model.Fixed;
            parameters[8].Value = model.IndependentlyNub;
            parameters[9].Value = model.GuidanceNub;
            parameters[10].Value = model.ExperimentNub;
            parameters[11].Value = model.InternationalAwards;
            parameters[12].Value = model.MinisterialAwards;
            parameters[13].Value = model.ColonelAward;
            parameters[14].Value = model.CorePublications;
            parameters[15].Value = model.OutSchool;
            parameters[16].Value = model.InSchool;
            parameters[17].Value = model.MakeUse;
            parameters[18].Value = model.OriginalFunctional;
            parameters[19].Value = model.IncreaseFunctional;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(),parameters);
            if (obj == null)
            {
                return 1;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
开发者ID:dalinhuang,项目名称:labms,代码行数:63,代码来源:ValuablesAnnualBenefitEvaluation.cs

示例10: Add

        /// <summary>
        /// ����һ������
        /// </summary>
        public int Add(LabMS.Model.Evaluation model)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("insert into Evaluation(");
            strSql.Append("Comment,Result,Remark,LabID,Date,StandarID,EvTime)");
            strSql.Append(" values (");
            strSql.Append("@Comment,@Result,@Remark,@LabID,@Date,@StandarID,@EvTime)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
                    new SqlParameter("@Comment", SqlDbType.Text),
                    new SqlParameter("@Result", SqlDbType.Int,4),
                    new SqlParameter("@Remark", SqlDbType.Text),
                    new SqlParameter("@LabID", SqlDbType.Int,4),
                    new SqlParameter("@Date", SqlDbType.DateTime),
                    new SqlParameter("@StandarID", SqlDbType.Int,4),
                    new SqlParameter("@EvTime", SqlDbType.Int,4)};
            parameters[0].Value = model.Comment;
            parameters[1].Value = model.Result;
            parameters[2].Value = model.Remark;
            parameters[3].Value = model.LabID;
            parameters[4].Value = model.Date;
            parameters[5].Value = model.StandarID;
            parameters[6].Value = model.EvTime;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(),parameters);
            if (obj == null)
            {
                return 1;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
开发者ID:dalinhuang,项目名称:labms,代码行数:37,代码来源:Evaluation.cs

示例11: Add

        /// <summary>
        /// ����һ������
        /// </summary>
        public int Add(LabMS.Model.AttachmentItem model)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("insert into AttachmentItem(");
            strSql.Append("Item_Address,Attach_ID,Item_Name,Item_Type)");
            strSql.Append(" values (");
            strSql.Append("@Item_Address,@Attach_ID,@Item_Name,@Item_Type)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
                    new SqlParameter("@Item_Address", SqlDbType.VarChar,150),
                    new SqlParameter("@Attach_ID", SqlDbType.Int,4),
                    new SqlParameter("@Item_Name", SqlDbType.VarChar,100),
                    new SqlParameter("@Item_Type", SqlDbType.VarChar,50)};
            parameters[0].Value = model.Item_Address;
            parameters[1].Value = model.Attach_ID;
            parameters[2].Value = model.Item_Name;
            parameters[3].Value = model.Item_Type;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(),parameters);
            if (obj == null)
            {
                return 1;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
开发者ID:dalinhuang,项目名称:labms,代码行数:31,代码来源:AttachmentItem.cs

示例12: Add

        /// <summary>
        /// ����һ������
        /// </summary>
        public int Add(LabMS.Model.EvaluationTitle model)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("insert into EvaluationTitle(");
            strSql.Append("Title_Code,Title_Name,Title_Author,Title_SubmitDate,Title_ModifyDate,Title_Category,LabID)");
            strSql.Append(" values (");
            strSql.Append("@Title_Code,@Title_Name,@Title_Author,@Title_SubmitDate,@Title_ModifyDate,@Title_Category,@LabID)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
                    new SqlParameter("@Title_Code", SqlDbType.VarChar,50),
                    new SqlParameter("@Title_Name", SqlDbType.VarChar,100),
                    new SqlParameter("@Title_Author", SqlDbType.VarChar,20),
                    new SqlParameter("@Title_SubmitDate", SqlDbType.DateTime),
                    new SqlParameter("@Title_ModifyDate", SqlDbType.DateTime),
                    new SqlParameter("@Title_Category", SqlDbType.Int,4),
                    new SqlParameter("@LabID", SqlDbType.Int,4)};
            parameters[0].Value = model.Title_Code;
            parameters[1].Value = model.Title_Name;
            parameters[2].Value = model.Title_Author;
            parameters[3].Value = model.Title_SubmitDate;
            parameters[4].Value = model.Title_ModifyDate;
            parameters[5].Value = model.Title_Category;
            parameters[6].Value = model.LabID;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(),parameters);
            if (obj == null)
            {
                return 1;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
开发者ID:dalinhuang,项目名称:labms,代码行数:37,代码来源:EvaluationTitle.cs

示例13: Bind

        public void Bind(LabMS.Model.InstrumentAndConsumables mvaluables)
        {
            EquipPhoto.ImageUrl = "~/Equipment/PicShow.aspx?ID=" + mvaluables.ID;
            tbInstrumentNum.Text = mvaluables.Numbers;
            tbKindNum.Text = mvaluables.ClassNumber;
            tbInstrumentName.Text = mvaluables.Name;
            tbStandards.Text = mvaluables.Standards;
            tbModel.Text = mvaluables.Model;
            tbCountryCode.Text = mvaluables.CountryCode;
            tbAmount.Text = mvaluables.Quantity.ToString();
            tbUnitPrice.Text = mvaluables.UnitPrice;
            tbFactoryCode.Text = mvaluables.FactoryCode;
            tbDocuments.Text = mvaluables.Documents;
            tbMeasurement.Text = mvaluables.Measurement;
            try
            {
                tbProductionDate.Text = mvaluables.ProductionDate.Value.ToShortDateString();
                tbPurchaseDate.Text = mvaluables.PurchaseDate.Value.ToShortDateString();
                tbOpeningTime.Text = mvaluables.OpeningTime.Value.ToShortDateString();
                tbCreatedDate.Text = mvaluables.CreatedDate.Value.ToShortDateString();
            }
            catch { }

            tbResponesoblePerson.Text = mvaluables.ResponesoblePerson;
            tbContactPhone.Text = mvaluables.ContactPhone;
            tbCharges.Text = mvaluables.Charges;
            tbZipCode.Text = mvaluables.ZipCode;
            tbMailingAddress.Text =  mvaluables.MailingAddress;
            tbPurpose.Text = mvaluables.Purpose;
        }
开发者ID:dalinhuang,项目名称:labms,代码行数:30,代码来源:valuablesedit.aspx.cs

示例14: Add

        /// <summary>
        /// ����һ������
        /// </summary>
        public int Add(LabMS.Model.CourseDesign model)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("insert into CourseDesign(");
            strSql.Append("ScoreID,Design_Name,Design_Credit,Design_EndTime,Design_Summary)");
            strSql.Append(" values (");
            strSql.Append("@ScoreID,@Design_Name,@Design_Credit,@Design_EndTime,@Design_Summary)");
            strSql.Append(";select @@IDENTITY");
            SqlParameter[] parameters = {
                    new SqlParameter("@ScoreID", SqlDbType.Int,4),
                    new SqlParameter("@Design_Name", SqlDbType.VarChar,30),
                    new SqlParameter("@Design_Credit", SqlDbType.Int,4),
                    new SqlParameter("@Design_EndTime", SqlDbType.DateTime),
                    new SqlParameter("@Design_Summary", SqlDbType.Text)};
            parameters[0].Value = model.ScoreID;
            parameters[1].Value = model.Design_Name;
            parameters[2].Value = model.Design_Credit;
            parameters[3].Value = model.Design_EndTime;
            parameters[4].Value = model.Design_Summary;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(),parameters);
            if (obj == null)
            {
                return 1;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
开发者ID:dalinhuang,项目名称:labms,代码行数:33,代码来源:CourseDesign.cs

示例15: AddGet

        /// <summary>
        /// ������ǩ������ID�����ǩ�Ѿ����ڣ��򷵻�ԭ��ǩID
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int AddGet(LabMS.Model.Tag model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("if exists(select null from [Tag] where [TagName] = @TagName) ");
            strSql.Append("select [key] from [Tag] where [TagName] = @TagName ");
            strSql.Append("else begin ");
            strSql.Append("insert into Tag(");
            strSql.Append("TagName)");
            strSql.Append(" values (");
            strSql.Append("@TagName)");
            strSql.Append(";select @@IDENTITY");
            strSql.Append(" end");
            SqlParameter[] parameters = {
                new SqlParameter("@TagName", SqlDbType.VarChar,50)};
            parameters[0].Value = model.TagName;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);
            if (obj == null)
            {
                return 1;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
开发者ID:dalinhuang,项目名称:labms,代码行数:31,代码来源:Tag.cs


注:本文中的LabMS类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。