Exemple #1
0
        /// <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);
        }
Exemple #2
0
        /// <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);
        }