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


C# BathDBDataContext.ExecuteCommand方法代码示例

本文整理汇总了C#中YouSoftBathGeneralClass.BathDBDataContext.ExecuteCommand方法的典型用法代码示例。如果您正苦于以下问题:C# BathDBDataContext.ExecuteCommand方法的具体用法?C# BathDBDataContext.ExecuteCommand怎么用?C# BathDBDataContext.ExecuteCommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在YouSoftBathGeneralClass.BathDBDataContext的用法示例。


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

示例1: toolReArrange_Click

        //全部重排
        private void toolReArrange_Click(object sender, EventArgs e)
        {
            var dc = new BathDBDataContext(m_con_str);
            dc.ExecuteCommand("truncate table techindex");
            dc.SubmitChanges();

            var job_ids = dc.Job.Where(x => x.name.Contains("技师")).Select(x => x.id);
            foreach (var job_id in job_ids)
            {
                var techs = dc.Employee.Where(x => x.jobId == job_id);

                techs = techs.Where(x => x.techStatus == null || x.techStatus == "空闲" || x.techStatus == "待钟");

                var techs_male = techs.Where(x=>x.gender=="男");
                var techIndex = new TechIndex();
                techIndex.dutyid = job_id;
                techIndex.gender = "男";
                techIndex.ids = string.Join("%", techs_male.OrderBy(x => x.id).Select(x => x.id + "=T").ToArray());
                dc.TechIndex.InsertOnSubmit(techIndex);

                var techs_female = techs.Where(x => x.gender == "女");
                techIndex = new TechIndex();
                techIndex.dutyid = job_id;
                techIndex.gender = "女";
                techIndex.ids = string.Join("%", techs_female.OrderBy(x => x.id).Select(x => x.id + "=T").ToArray());
                dc.TechIndex.InsertOnSubmit(techIndex);
            }
            dc.SubmitChanges();
            dgv_show(dc);
        }
开发者ID:huaminglee,项目名称:yousoftbath,代码行数:31,代码来源:TechListForm.cs

示例2: systemId

        //获取系统账号
        public static string systemId(BathDBDataContext db, string connectionString)
        {
            string today = BathClass.Now(connectionString).ToString("yyyyMMdd");
            string max_id = db.SystemIds.Max(x => x.systemId);

            long maxId = 0;
            if (max_id != null)
            {
                if (max_id.Contains(today))
                    maxId = Convert.ToInt64(max_id.Replace(today, ""));
                else
                    db.ExecuteCommand("TRUNCATE TABLE SystemIds");
            }

            return today + (maxId + 1).ToString().PadLeft(5, '0');
        }
开发者ID:huaminglee,项目名称:yousoftbath,代码行数:17,代码来源:BathClass.cs


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