public bool AddStr(string strQuery)
        {
            ProvinceItem model = new ProvinceItem();

            model = JsonConvert.DeserializeObject <ProvinceItem>(strQuery);
            ProvinceServer bll = new ProvinceServer();

            return(bll.Add(model));
        }
예제 #2
0
        public bool Add(ProvinceItem model)
        {
            StringBuilder str = new StringBuilder();

            str.Append("insert into Province values(@code,@name)");
            SqlParameter[] parameters =
            {
                new SqlParameter("@code", SqlDbType.NVarChar, 50),
                new SqlParameter("@name", SqlDbType.NVarChar, 50)
            };
            parameters[0].Value = model.Code;
            parameters[1].Value = model.Name;
            int returnCount = int.Parse(SqlHelper.ExecteNonQuery(CommandType.Text, str.ToString(), parameters).ToString());

            if (returnCount > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #3
0
    private void PopulateProvinceList()
    {
        try
        {
            List <IProvince> GetProvinceList = Province.GetProvinceList();

            ddl_province.Items.Add("Select Province");
            foreach (Province ProvinceItem in GetProvinceList)
            {
                ddl_province.Items.Add(ProvinceItem.Name());
            }
            AbleToAddAddress.Visible   = true;
            unableToAddAddress.Visible = false;
            ddl_city.Items.Add("Select City (Please select province first)");
            ddl_city.Style.Add("opacity", "0.3");
            ddl_city.Disabled = true;
        }
        catch (Exception)
        {
            AbleToAddAddress.Visible   = false;
            unableToAddAddress.Visible = true;
        }
    }
 public bool Add(ProvinceItem model)
 {
     return(dal.Add(model));
 }
        public bool AddModel(ProvinceItem model)
        {
            ProvinceServer bll = new ProvinceServer();

            return(bll.Add(model));
        }