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


C# Job.LoadLastJobBySubstitute方法代码示例

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


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

示例1: LoadAllPreferredSubstitutes

 public DataView LoadAllPreferredSubstitutes(int locationId)
 {
     if (DalUser.LoadAllPreferredSubstitutes(locationId).Count>0)
     {
         int substituteId = 0;
         Job job = new Job();
         DataRowView drv;
         DalUser.DefaultView.Table.Columns.Add("Teacher");
         DalUser.DefaultView.Table.Columns.Add("DatetimeStart");
         foreach (DataRow dr in DalUser.DefaultView.Table.Rows)
         {
             if (dr["SubstituteId"] != null && dr["SubstituteId"] != DBNull.Value)
             {
                 substituteId = Convert.ToInt32(dr["SubstituteId"]);
                 drv = job.LoadLastJobBySubstitute(substituteId);
                 if (drv!=null)
                 {
                     if (drv["Name"] != null)
                         dr["Teacher"] = drv["Name"];
                     else
                         dr["Teacher"] = " ";
                     if (drv["DatetimeStart"] != null)
                         dr["DatetimeStart"] = drv["DatetimeStart"];
                 }
             }
         }
         return DalUser.DefaultView;
     }
     else
         return null;
 }
开发者ID:bigWebApps,项目名称:Substitute,代码行数:31,代码来源:User.cs

示例2: LoadAvailables

        public DataView LoadAvailables(int jobId)
        {
            if (DalSubstitute.LoadAvailables(jobId))
            {
                int substituteId = 0;
                int locationId = 0;
                bool isAvailable;
                Job job = new Job(jobId);
                Substitute substitute = new Substitute();
                Dal.Preferred pref = new Miami.Substitute.Dal.Preferred();
                Dal.SubstituteExceptions substituteExceptions = new Miami.Substitute.Dal.SubstituteExceptions();
                DataRowView drv;
                DalSubstitute.DefaultView.Table.Columns.Add("IsApplied");
                DalSubstitute.DefaultView.Table.Columns.Add("TimeWorks");
                DalSubstitute.DefaultView.Table.Columns.Add("DatetimeStart");
                DalSubstitute.DefaultView.Table.Columns.Add("VisibleAssign");
                foreach (DataRow dr in DalSubstitute.DefaultView.Table.Rows)
                {
                    if (dr["SubstituteId"] != null && dr["SubstituteId"] != DBNull.Value)
                    {
                        substituteId = Convert.ToInt32(dr["SubstituteId"]);
                        substitute = new Substitute(substituteId);
                        locationId = Convert.ToInt32(dr["JobLocationId"]);
                        isAvailable = !substituteExceptions.IsOverlapped(substitute.UserId, job.DatetimeStart, job.DatetimeEnd);

                        drv = job.LoadLastJobBySubstitute(substituteId);
                        if (drv != null)
                        {
                            dr["TimeWorks"] = drv["TimeWorks"];
                            dr["DatetimeStart"] = drv["DatetimeStart"];
                        }

                        if (job.IsOverlap(jobId, substituteId))
                        {
                            dr["IsApplied"] = "<img src='Images/clerkassigned.gif' border='0'>";
                            dr["VisibleAssign"] = 0;
                        }
                        else if (!isAvailable)
                        {
                            dr["IsApplied"] = "<img src='Images/notapplied.gif' border='0'>";
                            dr["VisibleAssign"] = 0;
                        }
                        else
                        {
                            if (job.LoadSubstituteJob(jobId, substituteId))
                                dr["IsApplied"] = "<img src='Images/applied.gif' border='0'>";
                            else
                                dr["IsApplied"] = "<img src='Images/blue.gif' border='0'>";
                            dr["VisibleAssign"] = 1;
                        }
                    }
                    else
                    {
                        dr["IsApplied"] = "<img src='Images/notapplied.gif' border='0'>";
                        dr["VisibleAssign"] = 0;
                    }
                }
                DalSubstitute.DefaultView.Sort = "IsClerkPreferred DESC, IsPreferred DESC";
                return DalSubstitute.DefaultView;
            }
            else
                return null;
        }
开发者ID:bigWebApps,项目名称:Substitute,代码行数:63,代码来源:Substitute.cs


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