當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。