private void ShowWarningMsg(string msg, Color msgColor) { //tlblStatus.Text = msg; //tlblStatus.ForeColor = msgColor; JCMsg.ShowInfoOK(msg); }
/// <summary> /// 更改当前城市名称 /// </summary> /// <param name="city"></param> private bool DoEditCity(string oldcity) { frmLoadIndexAddCity f = new frmLoadIndexAddCity(oldcity); if (f.ShowDialog() == DialogResult.OK) { string errMsg = ""; string newcity = f.CityName; if (newcity == oldcity) { return(false); } int ret = bll.UpdateCity(newcity, oldcity, out errMsg); if (ret == 1) { this.jccmbLocation.Text = newcity; JCMsg.ShowInfoOK(JCMsg.INFO_SUCCESS); return(true); } else { JCMsg.ShowErrorOK(errMsg); } } return(false); }
/// <summary> /// 增加新城市 /// </summary> private bool DoAddCity() { frmLoadIndexAddCity f = new frmLoadIndexAddCity(); if (f.ShowDialog() == DialogResult.OK) { string city = f.CityName; int ret = bll.AddCity(city, out errMsg); if (ret == 1) { this.jccmbLocation.Text = city; JCMsg.ShowInfoOK(JCMsg.INFO_SUCCESS); return(true); } else if (ret == 0) { JCMsg.ShowWarningOK(errMsg); } else { JCMsg.ShowErrorOK(errMsg); } } return(false); }
/// <summary> /// 将当前城市设为默认城市 /// </summary> private void DoSetDefaultCity(string city) { if (bll.SetDefaultCity(city, out errMsg)) { JCMsg.ShowInfoOK(JCMsg.INFO_SUCCESS); } else { JCMsg.ShowErrorOK(errMsg); } }
/// <summary> /// 删除当前选中的 Load index 记录 /// </summary> /// <param name="roomType"></param> private void DoDeleteIndex(string city, string rType) { if (bll.DeleteLoadIndex(city, rType, out errMsg)) { JCMsg.ShowInfoOK(JCMsg.INFO_SUCCESS); BindLoadIndexList(jccmbLocation.Text.Trim()); } else { JCMsg.ShowErrorOK(errMsg); } }
/// <summary> /// 将当前 Load index 记录设为默认项 /// </summary> private void DoSetDefaultLoadIndex(string city, string rType) { if (bll.SetDefaultRoomLoadIndex(city, rType, out errMsg)) { JCMsg.ShowInfoOK(JCMsg.INFO_SUCCESS); BindLoadIndexList(city); } else { JCMsg.ShowErrorOK(errMsg); } }
/// <summary> /// 编辑当前选中的 Load index 记录 /// </summary> /// <param name="roomType"></param> private void DoEditIndex(RoomLoadIndex item) { frmLoadIndexAddIndex f = new frmLoadIndexAddIndex(item); if (f.ShowDialog() == DialogResult.OK) { RoomLoadIndex newItem = f.LoadIndexItem; if (bll.UpdateLoadIndex(newItem, out errMsg) == 1) { JCMsg.ShowInfoOK(JCMsg.INFO_SUCCESS); BindLoadIndexList(jccmbLocation.Text.Trim()); } else { JCMsg.ShowErrorOK(errMsg); } } }
/// <summary> /// 增加新的 Load index 记录 /// </summary> private void DoAddIndex(string city) { frmLoadIndexAddIndex f = new frmLoadIndexAddIndex(city); if (f.ShowDialog() == DialogResult.OK) { RoomLoadIndex newItem = f.LoadIndexItem; int index = bll.AddLoadIndex(newItem, out errMsg); if (index == 1) { JCMsg.ShowInfoOK(JCMsg.INFO_SUCCESS); BindLoadIndexList(jccmbLocation.Text.Trim()); } else if (index == 0) { JCMsg.ShowErrorOK(Msg.ROOM_TYPE_IS_EXIST()); } else { JCMsg.ShowErrorOK(errMsg); } } }