Ejemplo n.º 1
0
 /// <summary>
 /// 应用到这个项目
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnApply_Click(object sender, EventArgs e)
 {
     ProjectCalendarBo projectcalendar = new ProjectCalendarBo();
     projectcalendar.Week = week;
     projectcalendar.TimeSlot = worktimes;
     bool isSuccess = WcfServiceLocator.Create<IProjectCalendarService>().saveProjectCalendarByProjectId(projectcalendar, project.Id);
 }
Ejemplo n.º 2
0
 public bool saveProjectCalendarByProjectId(ProjectCalendarBo projectcalendar, int id)
 {
     Calendar cal = new Calendar();
     cal.ProjectId = id;
     cal.Week = JavaScriptConvert.SerializeObject(projectcalendar.Week);
     cal.TimeSlot = JavaScriptConvert.SerializeObject(projectcalendar.TimeSlot);
     //保存代码
     return false;
 }
Ejemplo n.º 3
0
 public ProjectCalendarBo getProjectCalendarByProjectId(int id)
 {
     ProjectCalendarBo projectcalendar = new ProjectCalendarBo();
     projectcalendar.Id = 1;
     projectcalendar.ProjectName = "杀猪";
     projectcalendar.StartTime = "2014-02-26 08:30:00";
     string week = "{Sunday:false,Monday:true,Tuesday:true,Wednesday:true,Thursday:true,Friday:true,Saturday:false}";
     projectcalendar.Week = JavaScriptConvert.DeserializeObject<WeekBo>(week);
     string worktime = "[{Start:'09:00',End:'12:00'},{Start:'13:00',End:'18:00'},{Start:'',End:''},{Start:'',End:''}]";
     projectcalendar.TimeSlot = JavaScriptConvert.DeserializeObject<List<WorkTimeBo>>(worktime);
     string workdate = "[{Time:'2014-2-2',State:'班'},{Time:'2014-2-1',State:'班'}]";
     projectcalendar.DateState = JavaScriptConvert.DeserializeObject<List<WorkDateBo>>(workdate);
     return projectcalendar;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 把设置保存成默认值
 /// </summary>
 /// <param name="projectcalendar"></param>
 /// <returns></returns>
 public bool setProjectCalendarToDefault(ProjectCalendarBo projectcalendar)
 {
     try
     {
         if (!Directory.Exists(@".\Settings"))//判断文件夹是否已经存在
         {
             Directory.CreateDirectory(@".\Settings");//创建文件夹
         }
         StreamWriter file = new StreamWriter(@"Settings\Calendar.ini");
         file.WriteLine("Week=" + JavaScriptConvert.SerializeObject(projectcalendar.Week));
         file.WriteLine("Time=" + JavaScriptConvert.SerializeObject(projectcalendar.TimeSlot));
         file.Close();
         return true;
     }
     catch
     {
         return false;
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 设置默认
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnDefault_Click(object sender, EventArgs e)
 {
     ProjectCalendarBo projectcalendar = new ProjectCalendarBo();
     projectcalendar.Week = week;
     projectcalendar.TimeSlot = worktimes;
     projectcalendar.DateState = specialdate;
     bool isSuccess = WcfServiceLocator.Create<IProjectCalendarService>().setProjectCalendarToDefault(projectcalendar);
 }