protected void dgvGridView_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) { if (!string.IsNullOrEmpty(e.CommandArgument.ToString())) { objCommon = new clsCommon(); hdnPKID.Value = e.CommandArgument.ToString(); if (e.CommandName == "IsActive") { objPinCode = new tblPinCode(); if (objPinCode.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value))) { if (objPinCode.s_AppIsActive != "") { if (objPinCode.AppIsActive == true) { objPinCode.AppIsActive = false; } else if (objPinCode.AppIsActive == false) { objPinCode.AppIsActive = true; } } else { objPinCode.AppIsActive = true; } objPinCode.Save(); LoadDataGrid(false, false); } objPinCode = null; } } }
private bool SaveData() { objClsCommon = new clsCommon(); objPinCode = new tblPinCode(); if (objClsCommon.IsRecordExists("tblPinCode", tblPinCode.ColumnNames.AppPinCode, tblPinCode.ColumnNames.AppPinCodeID, txtPINCode.Text, hdnPKID.Value)) { DInfo.ShowMessage(" Pin Code already exits.", Enums.MessageType.Error); return(false); } if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "") { objPinCode.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value)); } else { objPinCode.AddNew(); } objPinCode.AppPinCode = Convert.ToInt32(txtPINCode.Text); objPinCode.s_AppCityID = ddlCity.SelectedValue.ToString(); objPinCode.AppIsActive = chkIsActive.Checked; objPinCode.Save(); iBrandID = objPinCode.AppPinCodeID; objPinCode = null; objClsCommon = null; return(true); }
private bool Delete(int intPKID) { bool retval = false; objPinCode = new tblPinCode(); if (objPinCode.LoadByPrimaryKey(intPKID)) { objPinCode.MarkAsDeleted(); objPinCode.Save(); retval = true; } objPinCode = null; return(retval); }