Beispiel #1
0
 public bool quickUpdate(XHD.Model.Personal_Calendar model)
 {
     return(dal.quickUpdate(model));
 }
Beispiel #2
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <XHD.Model.Personal_Calendar> DataTableToList(DataTable dt)
        {
            List <XHD.Model.Personal_Calendar> modelList = new List <XHD.Model.Personal_Calendar>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                XHD.Model.Personal_Calendar model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new XHD.Model.Personal_Calendar();
                    if (dt.Rows[n]["Id"].ToString() != "")
                    {
                        model.Id = int.Parse(dt.Rows[n]["Id"].ToString());
                    }
                    if (dt.Rows[n]["emp_id"].ToString() != "")
                    {
                        model.emp_id = int.Parse(dt.Rows[n]["emp_id"].ToString());
                    }
                    model.emp_name = dt.Rows[n]["emp_name"].ToString();
                    if (dt.Rows[n]["companyid"].ToString() != "")
                    {
                        model.companyid = int.Parse(dt.Rows[n]["companyid"].ToString());
                    }
                    model.Subject  = dt.Rows[n]["Subject"].ToString();
                    model.Location = dt.Rows[n]["Location"].ToString();
                    if (dt.Rows[n]["MasterId"].ToString() != "")
                    {
                        model.MasterId = int.Parse(dt.Rows[n]["MasterId"].ToString());
                    }
                    model.Description = dt.Rows[n]["Description"].ToString();
                    if (dt.Rows[n]["CalendarType"].ToString() != "")
                    {
                        model.CalendarType = int.Parse(dt.Rows[n]["CalendarType"].ToString());
                    }
                    if (dt.Rows[n]["StartTime"].ToString() != "")
                    {
                        model.StartTime = DateTime.Parse(dt.Rows[n]["StartTime"].ToString());
                    }
                    if (dt.Rows[n]["EndTime"].ToString() != "")
                    {
                        model.EndTime = DateTime.Parse(dt.Rows[n]["EndTime"].ToString());
                    }
                    if (dt.Rows[n]["IsAllDayEvent"].ToString() != "")
                    {
                        if ((dt.Rows[n]["IsAllDayEvent"].ToString() == "1") || (dt.Rows[n]["IsAllDayEvent"].ToString().ToLower() == "true"))
                        {
                            model.IsAllDayEvent = true;
                        }
                        else
                        {
                            model.IsAllDayEvent = false;
                        }
                    }
                    if (dt.Rows[n]["HasAttachment"].ToString() != "")
                    {
                        if ((dt.Rows[n]["HasAttachment"].ToString() == "1") || (dt.Rows[n]["HasAttachment"].ToString().ToLower() == "true"))
                        {
                            model.HasAttachment = true;
                        }
                        else
                        {
                            model.HasAttachment = false;
                        }
                    }
                    model.Category = dt.Rows[n]["Category"].ToString();
                    if (dt.Rows[n]["InstanceType"].ToString() != "")
                    {
                        model.InstanceType = int.Parse(dt.Rows[n]["InstanceType"].ToString());
                    }
                    model.Attendees     = dt.Rows[n]["Attendees"].ToString();
                    model.AttendeeNames = dt.Rows[n]["AttendeeNames"].ToString();
                    model.OtherAttendee = dt.Rows[n]["OtherAttendee"].ToString();
                    model.UPAccount     = dt.Rows[n]["UPAccount"].ToString();
                    model.UPName        = dt.Rows[n]["UPName"].ToString();
                    if (dt.Rows[n]["UPTime"].ToString() != "")
                    {
                        model.UPTime = DateTime.Parse(dt.Rows[n]["UPTime"].ToString());
                    }
                    model.RecurringRule = dt.Rows[n]["RecurringRule"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Beispiel #3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(XHD.Model.Personal_Calendar model)
 {
     return(dal.Add(model));
 }
Beispiel #4
0
 /// <summary>
 /// ��������б�
 /// </summary>
 public List<XHD.Model.Personal_Calendar> DataTableToList(DataTable dt)
 {
     List<XHD.Model.Personal_Calendar> modelList = new List<XHD.Model.Personal_Calendar>();
     int rowsCount = dt.Rows.Count;
     if (rowsCount > 0)
     {
         XHD.Model.Personal_Calendar model;
         for (int n = 0; n < rowsCount; n++)
         {
             model = new XHD.Model.Personal_Calendar();
             if(dt.Rows[n]["Id"].ToString()!="")
             {
                 model.Id=int.Parse(dt.Rows[n]["Id"].ToString());
             }
             if(dt.Rows[n]["emp_id"].ToString()!="")
             {
                 model.emp_id=int.Parse(dt.Rows[n]["emp_id"].ToString());
             }
             model.emp_name=dt.Rows[n]["emp_name"].ToString();
             if(dt.Rows[n]["companyid"].ToString()!="")
             {
                 model.companyid=int.Parse(dt.Rows[n]["companyid"].ToString());
             }
             model.Subject=dt.Rows[n]["Subject"].ToString();
             model.Location=dt.Rows[n]["Location"].ToString();
             if(dt.Rows[n]["MasterId"].ToString()!="")
             {
                 model.MasterId=int.Parse(dt.Rows[n]["MasterId"].ToString());
             }
             model.Description=dt.Rows[n]["Description"].ToString();
             if(dt.Rows[n]["CalendarType"].ToString()!="")
             {
                 model.CalendarType=int.Parse(dt.Rows[n]["CalendarType"].ToString());
             }
             if(dt.Rows[n]["StartTime"].ToString()!="")
             {
                 model.StartTime=DateTime.Parse(dt.Rows[n]["StartTime"].ToString());
             }
             if(dt.Rows[n]["EndTime"].ToString()!="")
             {
                 model.EndTime=DateTime.Parse(dt.Rows[n]["EndTime"].ToString());
             }
             if(dt.Rows[n]["IsAllDayEvent"].ToString()!="")
             {
                 if((dt.Rows[n]["IsAllDayEvent"].ToString()=="1")||(dt.Rows[n]["IsAllDayEvent"].ToString().ToLower()=="true"))
                 {
                 model.IsAllDayEvent=true;
                 }
                 else
                 {
                     model.IsAllDayEvent=false;
                 }
             }
             if(dt.Rows[n]["HasAttachment"].ToString()!="")
             {
                 if((dt.Rows[n]["HasAttachment"].ToString()=="1")||(dt.Rows[n]["HasAttachment"].ToString().ToLower()=="true"))
                 {
                 model.HasAttachment=true;
                 }
                 else
                 {
                     model.HasAttachment=false;
                 }
             }
             model.Category=dt.Rows[n]["Category"].ToString();
             if(dt.Rows[n]["InstanceType"].ToString()!="")
             {
                 model.InstanceType=int.Parse(dt.Rows[n]["InstanceType"].ToString());
             }
             model.Attendees=dt.Rows[n]["Attendees"].ToString();
             model.AttendeeNames=dt.Rows[n]["AttendeeNames"].ToString();
             model.OtherAttendee=dt.Rows[n]["OtherAttendee"].ToString();
             model.UPAccount=dt.Rows[n]["UPAccount"].ToString();
             model.UPName=dt.Rows[n]["UPName"].ToString();
             if(dt.Rows[n]["UPTime"].ToString()!="")
             {
                 model.UPTime=DateTime.Parse(dt.Rows[n]["UPTime"].ToString());
             }
             model.RecurringRule=dt.Rows[n]["RecurringRule"].ToString();
             modelList.Add(model);
         }
     }
     return modelList;
 }