Beispiel #1
0
 protected void AddressBookDataGrid_Delete(System.Object sender, System.Web.UI.WebControls.DataGridCommandEventArgs args)
 {
     if (this._delete_items != null && this._delete_items.Count > 0)
     {
         System.Collections.Specialized.ListDictionary addressbook = anmar.SharpWebMail.UI.AddressBook.GetAddressbook(this.addressbookselect.Value, Application["sharpwebmail/send/addressbook"]);
         System.Data.DataTable data = GetDataSource(addressbook, false, Session["client"] as anmar.SharpWebMail.IEmailClient);
         if (data != null)
         {
             bool delete = false;
             System.Data.DataView view = data.DefaultView;
             foreach (System.String item in this._delete_items)
             {
                 view.RowFilter = System.String.Concat(data.Columns[1].ColumnName, "='", item, "'");
                 if (view.Count == 1)
                 {
                     view[0].Delete();
                     delete = true;
                 }
             }
             if (delete)
             {
                 anmar.SharpWebMail.UI.AddressBook.UpdateDataSource(data, addressbook, Session["client"] as anmar.SharpWebMail.IEmailClient);
             }
         }
     }
 }
Beispiel #2
0
 public void ItemCommand(System.Web.UI.WebControls.DataGridCommandEventArgs e)
 {
     if (e.CommandName == "Detail")
     {
         EnableDetail(e.CommandArgument.ToString());
     }
 }
        protected void dgList_DeleteCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
        {
            long deleteID = (long)dgList.DataKeys[e.Item.ItemIndex];

            MTApp.CatalogServices.ProductPropertiesDestroy(deleteID);
            FillList();
        }
Beispiel #4
0
 private void dgModules_DeleteCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
 {
     if (IsAdmin)
     {
         DataTable tb = Config.GetConfigTable("modules.config", "module");
         tb.Rows.RemoveAt(e.Item.ItemIndex);
         Config.WriteConfigTable("modules.config", tb, "root");
     }
     Response.Redirect(Path.Full);
 }
Beispiel #5
0
        public void ItemCommand(System.Web.UI.WebControls.DataGridCommandEventArgs e)
        {
            switch (e.CommandName)
            {
            case "Supplement":

                BI.DeleteReceiptInfoByID(Convert.ToInt32(e.CommandArgument));
                break;
            }
            Load_MyGrid();
        }
Beispiel #6
0
        protected void grdAdmin_ItemCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
        {
            string strCa = e.CommandArgument.ToString();

            if (e.CommandName == "Edit")
            {
                DataTable dt = AdminService.Admin_GetById(strCa);
                txtId.Value      = dt.Rows[0]["AdmId"].ToString();
                txtUsername.Text = dt.Rows[0]["Username"].ToString();
                txtFullName.Text = dt.Rows[0]["FullName"].ToString();
                txtBod.Text      = DateTimeClass.ConvertDateTime(dt.Rows[0]["Bod"].ToString(), "MM/dd/yyyy");
                txtAddress.Text  = dt.Rows[0]["Address"].ToString();
                txtPhone.Text    = dt.Rows[0]["Phone"].ToString();
                txtEmail.Text    = dt.Rows[0]["Email"].ToString();
                pnUpdate.Visible = true;
                pnView.Visible   = false;
            }
        }
Beispiel #7
0
        protected void grdDetails_ItemCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
        {
            if (e.CommandName == "Delete")
            {
                string        cmdu;
                SqlConnection con = new SqlConnection(sConnectionString);
                if (con.State == ConnectionState.Open)
                {
                    con.Close();
                }
                cmdu = "update smtertiary set del_flag='Y',user_delete= '" + txtUser.Text + "', delete_date= getdate()" + " where cust_code='" + e.Item.Cells[0].Text + "' and year='" + cmbYear.Text + "' and month='" + cmbMonth.Text + "'";
                try
                {
                    SqlCommand cmd = new SqlCommand(cmdu, con);
                    con.Open();
                    cmd.ExecuteNonQuery();
                    con.Close();
                    binddata();
                }
                catch (Exception ex)
                {
                    lblError.Text = "Delete Eror:" + ex.Message;
                }
            }
            if (e.CommandName == "Edit")
            {
                if (chkMonth(cmbMonth.SelectedValue, cmbYear.Text))
                {
                    lblError.Text = "This month is locked !! you can only view";
                    return;
                }

                cmbHQ.SelectedValue    = e.Item.Cells[33].Text;
                cmbParty.SelectedValue = e.Item.Cells[0].Text;
                cmbType.SelectedValue  = e.Item.Cells[2].Text;
                // cmbCity.SelectedValue = e.Item.Cells(3).Text
                enableDisableControl(false);
                //getPrimary();
                //getOpening();
                //getTertiary();
                // getReturns()
                Panel_Search.Visible = false; Panel_AddEdit.Visible = true;
            }
        }
Beispiel #8
0
 protected void InboxDataGrid_Delete(System.Object sender, System.Web.UI.WebControls.DataGridCommandEventArgs args)
 {
     if (this.delete != null && this.delete.Count > 0)
     {
         anmar.SharpWebMail.CTNInbox inbox = (anmar.SharpWebMail.CTNInbox)Session["inbox"];
         foreach (System.String item in this.delete)
         {
             if (item != null)
             {
                 inbox.DeleteMessage(item);
             }
         }
         if ((bool)Application["sharpwebmail/read/inbox/commit_ondelete"])
         {
             inbox.Client.PurgeInbox(inbox, false);
         }
         this.SharpUI.setVariableLabels();
     }
 }
        private void dtgObservacion_ItemCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
        {
            if (e.CommandName == "Select")
            {
                string        observacionID     = e.Item.Cells[0].Text;
                string        codigo            = e.Item.Cells[1].Text;
                string        obsDescrip        = e.Item.Cells[2].Text;
                string        setearOrigen      = txtSetearOrigen.Text;
                string        tipoObservacionID = txtTipoObservacionID.Text;
                string        fila         = txtFila.Text;
                StringBuilder scriptString = new StringBuilder();
                scriptString.Append("<script language='javascript'>\n");
                scriptString.Append("select(" + "'" + observacionID + "'" + "," + "'" + codigo + "'" + "," + "'" + obsDescrip + "'" + "," + "'" + setearOrigen + "'" + "," + "'" + tipoObservacionID + "'" + "," + "'" + parpaso + "'" + " );");
                //scriptString.Append("window.dialogArguments.TipoObservacionID = '" + tipoObservacionID + "';\n");
                //    scriptString.Append("parent.window.returnValue = true;\n");
                scriptString.Append("parent.window.close();\n");
                scriptString.Append("</script>");

                Page.RegisterClientScriptBlock("scriptModalObservacion", scriptString.ToString());
            }
        }
        protected void DataGrid1_DeleteCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
        {
            int row = e.Item.ItemIndex;
            XmlDocumentExtender doc = new XmlDocumentExtender();

            doc.Load(configPath);
            XmlNodeList shortcutmenus = doc.SelectNodes("/dataset/shortcut");
            int         i             = 0;

            foreach (XmlNode xn in shortcutmenus)
            {
                if (i == row)
                {
                    xn.ParentNode.RemoveChild(xn);
                }
                i++;
            }
            doc.Save(configPath);
            MenuManage.CreateMenuJson();
            base.RegisterStartupScript("delete", "<script type='text/javascript'>window.parent.LoadShortcutMenu();</script>");
            BindDataGrid();
        }
        protected void dgList_EditCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
        {
            long editID = (long)dgList.DataKeys[e.Item.ItemIndex];

            Response.Redirect("~/BVAdmin/Catalog/ProductTypePropertiesEdit.aspx?id=" + editID);
        }
Beispiel #12
0
        protected void OnItemEditClick(object sender, System.Web.UI.WebControls.DataGridCommandEventArgs e)
        {
            string EquipId = e.Item.Cells[1].Text;

            Response.Redirect("view.aspx?id=" + EquipId + "");
        }