Exemple #1
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(Garfield.Model.Personal_Calendar model)
 {
     return(dal.Add(model));
 }
Exemple #2
0
 public bool quickUpdate(Garfield.Model.Personal_Calendar model)
 {
     return(dal.quickUpdate(model));
 }
Exemple #3
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <Garfield.Model.Personal_Calendar> DataTableToList(DataTable dt)
        {
            List <Garfield.Model.Personal_Calendar> modelList = new List <Garfield.Model.Personal_Calendar>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                Garfield.Model.Personal_Calendar model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Garfield.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);
        }