コード例 #1
0
        protected void btnUpdateCountry_Click(object sender, EventArgs e)
        {
            #region Fetching Data from screen to update country
            DC_Country _objCountry = new DC_Country();
            _objCountry.Create_Date = DateTime.Now;
            _objCountry.Create_User = System.Web.HttpContext.Current.User.Identity.Name;
            _objCountry.Country_Id  = Guid.Parse(Countryid);
            _objCountry.Name        = Convert.ToString(txtCountryName.Text);
            _objCountry.Code        = Convert.ToString(txtCountryCode.Text);
            _objCountry.Status      = Convert.ToString(ddlStatus.SelectedValue);

            _objCountry.RegionName = Convert.ToString(txtRegionName.Text);
            _objCountry.RegionCode = Convert.ToString(txtRegionCode.Text);
            _objCountry.Key        = Convert.ToString(txtKey.Text);
            _objCountry.Rank       = Convert.ToString(txtRank.Text);
            _objCountry.Priority   = Convert.ToString(txtPriority.Text);


            _objCountry.ISOofficial_name_en = Convert.ToString(txt_ISOofficial_name_en.Text);
            _objCountry.ISO3166_1_Alpha_2   = Convert.ToString(txt_ISO3166_1_Alpha_2.Text);
            _objCountry.ISO3166_1_Alpha_3   = Convert.ToString(txt_ISO3166_1_Alpha_3.Text);
            _objCountry.ISO3166_1_M49       = Convert.ToString(txt_ISO3166_1_M49.Text);
            _objCountry.ISO3166_1_ITU       = Convert.ToString(txt_ISO3166_1_ITU.Text);
            _objCountry.MARC = Convert.ToString(txt_MARC.Text);
            _objCountry.WMO  = Convert.ToString(txt_WMO.Text);
            _objCountry.DS   = Convert.ToString(txt_DS.Text);
            _objCountry.Dial = Convert.ToString(txt_Dial.Text);
            _objCountry.ISO4217_currency_alphabetic_code = Convert.ToString(txt_ISO4217_currency_alphabetic_code.Text);
            _objCountry.ISO4217_currency_country_name    = Convert.ToString(txt_ISO4217_currency_country_name.Text);
            _objCountry.ISO4217_currency_minor_unit      = Convert.ToString(txt_ISO4217_currency_minor_unit.Text);
            _objCountry.ISO4217_currency_name            = Convert.ToString(txt_ISO4217_currency_name.Text);
            _objCountry.ISO4217_currency_numeric_code    = Convert.ToString(txt_ISO4217_currency_numeric_code.Text);
            _objCountry.ISO3166_1_Capital    = Convert.ToString(txt_ISO3166_1_Capital.Text);
            _objCountry.ISO3166_1_Continent  = Convert.ToString(txt_ISO3166_1_Continent.Text);
            _objCountry.ISO3166_1_TLD        = Convert.ToString(txt_ISO3166_1_TLD.Text);
            _objCountry.ISO3166_1_Languages  = Convert.ToString(txt_ISO3166_1_Languages.Text);
            _objCountry.ISO3166_1_Geoname_ID = Convert.ToString(txt_ISO3166_1_Geoname_ID.Text);
            _objCountry.ISO3166_1_EDGAR      = Convert.ToString(txt_ISO3166_1_EDGAR.Text);
            _objCountry.GooglePlaceID        = Convert.ToString(txt_GooglePlaceID.Text);
            #endregion

            _objCountry.Edit_Date = DateTime.Now;
            _objCountry.Edit_User = System.Web.HttpContext.Current.User.Identity.Name;
            _objCountry.Action    = "Update";
            MasterDataSVCs _objMaster = new MasterDataSVCs();
            DC_Message     _msg       = new DC_Message();
            _msg = _objMaster.AddUpdateCountryMaster(_objCountry);
            if (_msg.StatusCode == MDMSVC.ReadOnlyMessageStatusCode.Success)
            {
                BootstrapAlert.BootstrapAlertMessage(dvMsgCountry, "Country has been updated successfully", BootstrapAlertType.Success);
            }
            else
            {
                BootstrapAlert.BootstrapAlertMessage(dvMsgCountry, _msg.StatusMessage, (BootstrapAlertType)_msg.StatusCode);
            }
        }
コード例 #2
0
        protected void frmCountrydetail_ItemCommand(object sender, FormViewCommandEventArgs e)
        {
            DC_Message _msg = new DC_Message();

            try
            {
                //Getting all controls here
                TextBox txtCountryName = (TextBox)frmCountrydetail.FindControl("txtCountryName");
                TextBox txtCountryCode = (TextBox)frmCountrydetail.FindControl("txtCountryCode");

                TextBox txtKey        = (TextBox)frmCountrydetail.FindControl("txtKey");
                TextBox txtRegionName = (TextBox)frmCountrydetail.FindControl("txtRegionName");
                TextBox txtRegionCode = (TextBox)frmCountrydetail.FindControl("txtRegionCode");
                TextBox txtRank       = (TextBox)frmCountrydetail.FindControl("txtRank");
                TextBox txtPriority   = (TextBox)frmCountrydetail.FindControl("txtPriority");

                DropDownList ddlStatus = (DropDownList)frmCountrydetail.FindControl("ddlStatus");

                TextBox txt_ISOofficial_name_en = (TextBox)frmCountrydetail.FindControl("txt_ISOofficial_name_en");
                TextBox txt_ISO3166_1_Alpha_2   = (TextBox)frmCountrydetail.FindControl("txt_ISO3166_1_Alpha_2");
                TextBox txt_ISO3166_1_Alpha_3   = (TextBox)frmCountrydetail.FindControl("txt_ISO3166_1_Alpha_3");
                TextBox txt_ISO3166_1_M49       = (TextBox)frmCountrydetail.FindControl("txt_ISO3166_1_M49");
                TextBox txt_ISO3166_1_ITU       = (TextBox)frmCountrydetail.FindControl("txt_ISO3166_1_ITU");

                TextBox txt_MARC = (TextBox)frmCountrydetail.FindControl("txt_MARC");
                TextBox txt_WMO  = (TextBox)frmCountrydetail.FindControl("txt_WMO");
                TextBox txt_DS   = (TextBox)frmCountrydetail.FindControl("txt_DS");
                TextBox txt_Dial = (TextBox)frmCountrydetail.FindControl("txt_Dial");

                TextBox txt_ISO4217_currency_alphabetic_code = (TextBox)frmCountrydetail.FindControl("txt_ISO4217_currency_alphabetic_code");
                TextBox txt_ISO4217_currency_country_name    = (TextBox)frmCountrydetail.FindControl("txt_ISO4217_currency_country_name");
                TextBox txt_ISO4217_currency_minor_unit      = (TextBox)frmCountrydetail.FindControl("txt_ISO4217_currency_minor_unit");
                TextBox txt_ISO4217_currency_name            = (TextBox)frmCountrydetail.FindControl("txt_ISO4217_currency_name");
                TextBox txt_ISO4217_currency_numeric_code    = (TextBox)frmCountrydetail.FindControl("txt_ISO4217_currency_numeric_code");
                TextBox txt_ISO3166_1_Capital    = (TextBox)frmCountrydetail.FindControl("txt_ISO3166_1_Capital");
                TextBox txt_ISO3166_1_Continent  = (TextBox)frmCountrydetail.FindControl("txt_ISO3166_1_Continent");
                TextBox txt_ISO3166_1_TLD        = (TextBox)frmCountrydetail.FindControl("txt_ISO3166_1_TLD");
                TextBox txt_ISO3166_1_Languages  = (TextBox)frmCountrydetail.FindControl("txt_ISO3166_1_Languages");
                TextBox txt_ISO3166_1_Geoname_ID = (TextBox)frmCountrydetail.FindControl("txt_ISO3166_1_Geoname_ID");
                TextBox txt_ISO3166_1_EDGAR      = (TextBox)frmCountrydetail.FindControl("txt_ISO3166_1_EDGAR");
                TextBox txt_GooglePlaceID        = (TextBox)frmCountrydetail.FindControl("txt_GooglePlaceID");
                Guid    _countryid = Guid.NewGuid();
                if (e.CommandName.ToString() == "Add")
                {
                    DC_Country _objCountry = new DC_Country();
                    _objCountry.Create_Date = DateTime.Now;
                    _objCountry.Create_User = System.Web.HttpContext.Current.User.Identity.Name;
                    _objCountry.Country_Id  = _countryid;
                    _objCountry.Name        = (Convert.ToString(txtCountryName.Text));
                    _objCountry.Code        = Convert.ToString(txtCountryCode.Text);
                    _objCountry.RegionCode  = (Convert.ToString(txtRegionCode.Text));
                    _objCountry.RegionName  = (Convert.ToString(txtRegionName.Text));
                    _objCountry.Key         = (Convert.ToString(txtKey.Text));
                    _objCountry.Rank        = (Convert.ToString(txtRank.Text));
                    _objCountry.Priority    = (Convert.ToString(txtPriority.Text));

                    _objCountry.Status = Convert.ToString(ddlStatus.SelectedValue);
                    _objCountry.ISOofficial_name_en = Convert.ToString(txt_ISOofficial_name_en.Text);
                    _objCountry.ISO3166_1_Alpha_2   = Convert.ToString(txt_ISO3166_1_Alpha_2.Text);
                    _objCountry.ISO3166_1_Alpha_3   = Convert.ToString(txt_ISO3166_1_Alpha_3.Text);
                    _objCountry.ISO3166_1_M49       = Convert.ToString(txt_ISO3166_1_M49.Text);
                    _objCountry.ISO3166_1_ITU       = Convert.ToString(txt_ISO3166_1_ITU.Text);
                    _objCountry.MARC = Convert.ToString(txt_MARC.Text);
                    _objCountry.WMO  = Convert.ToString(txt_WMO.Text);
                    _objCountry.DS   = Convert.ToString(txt_DS.Text);
                    _objCountry.Dial = Convert.ToString(txt_Dial.Text);
                    _objCountry.ISO4217_currency_alphabetic_code = Convert.ToString(txt_ISO4217_currency_alphabetic_code.Text);
                    _objCountry.ISO4217_currency_country_name    = Convert.ToString(txt_ISO4217_currency_country_name.Text);
                    _objCountry.ISO4217_currency_minor_unit      = Convert.ToString(txt_ISO4217_currency_minor_unit.Text);
                    _objCountry.ISO4217_currency_name            = Convert.ToString(txt_ISO4217_currency_name.Text);
                    _objCountry.ISO4217_currency_numeric_code    = Convert.ToString(txt_ISO4217_currency_numeric_code.Text);
                    _objCountry.ISO3166_1_Capital    = Convert.ToString(txt_ISO3166_1_Capital.Text);
                    _objCountry.ISO3166_1_Continent  = Convert.ToString(txt_ISO3166_1_Continent.Text);
                    _objCountry.ISO3166_1_TLD        = Convert.ToString(txt_ISO3166_1_TLD.Text);
                    _objCountry.ISO3166_1_Languages  = Convert.ToString(txt_ISO3166_1_Languages.Text);
                    _objCountry.ISO3166_1_Geoname_ID = Convert.ToString(txt_ISO3166_1_Geoname_ID.Text);
                    _objCountry.ISO3166_1_EDGAR      = Convert.ToString(txt_ISO3166_1_EDGAR.Text);
                    _objCountry.GooglePlaceID        = Convert.ToString(txt_GooglePlaceID.Text);
                    _objCountry.Action = "Save";
                    _msg = _objMaster.AddUpdateCountryMaster(_objCountry);
                    if (_msg.StatusCode == MDMSVC.ReadOnlyMessageStatusCode.Success)
                    {
                        Response.Redirect("~/geography/CountryStateMgmt?Country_Id=" + _countryid + "&Created=true");
                    }
                    else
                    {
                        BootstrapAlert.BootstrapAlertMessage(msgAlert, _msg.StatusMessage, (BootstrapAlertType)_msg.StatusCode);
                    }
                }
            }
            catch
            {
                throw;
            }
        }