private void RemoveButton_Press(object sender, EventArgs e) { Dictionary <string, string> p = new Dictionary <string, string>(); p.Add("resourceID", ResourceIdTextBox.Text); cz.Error r = ManagerSystem.Instance.MySuperAccount.DelResource(ref p); switch (r) { case cz.Error.OK: { Toast("删除成功"); } break; case cz.Error.CONNECT_ERROR: { Toast("网络连接错误"); } break; default: { #if (DEBUG) Toast(r.ToString()); #else Toast("未知错误"); #endif } break; } }
private void AddButton_Press(object sender, EventArgs e) { UpdateResourceInputInfo(); cz.Error r = ManagerSystem.Instance.MySuperAccount.AddResource(ref resourceInputInfo); switch (r) { case cz.Error.OK: { Toast("添加成功"); } break; case cz.Error.CONNECT_ERROR: { Toast("网络连接错误"); } break; default: { #if (DEBUG) Toast(r.ToString()); #else Toast("未知错误"); #endif } break; } }
private void SeatList_ItemActionPress(object sender, ListMenuViewItemPressEventArgs e) { //未测试 try { cz.Error r = ManagerSystem.Instance.MyAccount.SetNewReservation(startTime, endTime, int.Parse(e.Item.Content.Split(':')[1])); switch (r) { case cz.Error.OK: { Toast("预约成功"); Form.Close(); } break; case cz.Error.PARAM_FORMAT_ERROR: { Toast("您在该时间段已有预约"); } break; case cz.Error.CONNECT_ERROR: { Toast("网络连接错误"); } break; default: { #if (DEBUG) Toast(r.ToString()); #endif Toast("未知错误,预约失败"); } break; } } #if (DEBUG) catch (FormatException excrption) { Toast("资源ID格式错误"); } #endif catch (Exception excrption) { Toast("未知错误"); } }