Exemplo n.º 1
0
        protected void uiButtonSaveColor_Click(object sender, EventArgs e)
        {
            CardColor color = new CardColor();
            CardColor temp = new CardColor();
            temp.LoadByPrimaryKey(Convert.ToInt32(uiDropDownListBackColor.SelectedValue), CurrentCard.CardID);
            if (!(temp.RowCount > 0))
            {
                color.AddNew();
                color.CardID = CurrentCard.CardID;
                color.ColorID = Convert.ToInt32(uiDropDownListBackColor.SelectedValue);
                color.Save();

                BindCardColors();
                ClientScript.RegisterStartupScript(this.GetType(), "selectTab", "$(document).ready(function (){ $('#myTab a[href=\"#t-4\"]').tab('show'); $('#myTab a[href=\"#t-1\"]').removeClass('active'); $('#myTab a[href=\"#t-4\"]').addClass('active'); });", true);
                uiDropDownListBackColor.SelectedIndex = 0;
            }
            else
            {
                ClientScript.RegisterStartupScript(this.GetType(), "selectTab", "$(document).ready(function (){ $('#myTab a[href=\"#t-4\"]').tab('show'); $('#myTab a[href=\"#t-1\"]').removeClass('active'); $('#myTab a[href=\"#t-4\"]').addClass('active'); });", true);
                return;
            }
        }
Exemplo n.º 2
0
 protected void uiGridViewColors_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "DeleteColor")
     {
         try
         {
             CardColor objData = new CardColor();
             objData.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString()), CurrentCard.CardID);
             objData.MarkAsDeleted();
             objData.Save();
             BindCardColors();
             ClientScript.RegisterStartupScript(this.GetType(), "selectTab", "$(document).ready(function (){ $('#myTab a[href=\"#t-4\"]').tab('show'); $('#myTab a[href=\"#t-1\"]').removeClass('active'); $('#myTab a[href=\"#t-4\"]').addClass('active'); });", true);
         }
         catch (Exception ex)
         {
             return;
         }
     }
 }