private bool SaveData() { objClsCommon = new clsCommon(); objCountry = new tblCountry(); if (objClsCommon.IsRecordExists("tblCountry", tblCountry.ColumnNames.AppCountry, tblCountry.ColumnNames.AppCountryID, txtCountry.Text, hdnPKID.Value)) { DInfo.ShowMessage(" Country already exits.", Enums.MessageType.Error); return(false); } if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "") { objCountry.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value)); } else { objCountry.AddNew(); } objCountry.AppCountry = txtCountry.Text; //objCountry.AppIsActive = chkIsActive.Checked; objCountry.Save(); iCountryID = objCountry.AppCountryID; objCountry = null; objClsCommon = null; return(true); }
private void SetValuesToControls() { if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "") { objCountry = new tblCountry(); if (objCountry.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value))) { txtCountry.Text = objCountry.AppCountry.ToString(); // chkIsActive.Checked = objCountry.AppIsActive; } objCountry = null; } }