private void BtnPublish_Click(object sender, EventArgs e)
        {
            FileGenerator file = SaveFileSetting();
            if (file == null)
            {
                return;
            }

            CustomerSetting setting = new CustomerSetting();
            setting.CustomerSysNo = SessionContext.CustomerInfo.SysNo;
            setting.Setting = XmlSerializerHelper.Serializer<FileGenerator>(file);

            Task task = new Task();
            task.Setting = setting;
            task.CustomerSysNo = SessionContext.CustomerInfo.SysNo;
            task.RunTimes = 10;
            task.BeginDate = DateTime.Now;
            task.Costs = 100;

            TaskService taskService = ServiceManager.CreateTaskService();
            string result = taskService.CreateTask(task);

            if (string.IsNullOrEmpty(result))
            {
                MessageHelper.ShowMeesageBox("发布成功!");
            }
            else
            {
                MessageHelper.ShowMeesageBox(result);
            }
        }
        private void BtnRun_Click(object sender, EventArgs e)
        {
            FileGenerator file = SaveFileSetting();
            if (file == null)
            {
                return;
            }

            CustomerSetting setting = new CustomerSetting();
            setting.CustomerSysNo = SessionContext.CustomerInfo.SysNo;
            setting.Setting = XmlSerializerHelper.Serializer<FileGenerator>(file);

            CustomerService service = ServiceManager.CreateCustomerService();
            string result = service.SaveCustomerSetting(setting);

            if (string.IsNullOrEmpty(result))
            {
                MessageHelper.ShowMeesageBox("保持成功!");
            }
            else
            {
                MessageHelper.ShowMeesageBox(result);
            }
        }
示例#3
0
 public string SaveCustomerSetting(CustomerSetting customerSetting)
 {
     object[] results = this.Invoke("SaveCustomerSetting", new object[] {
                 customerSetting});
     return (string)(results[0]);
 }