Exemplo n.º 1
0
        protected void BtnSerach_Click1(object sender, EventArgs e)
        {
            DataSet  ds      = NazarClass.GetList(null, null, null, null, null, null, null);
            DataView dv      = new DataView(ds.Tables[0]);
            String   StrSort = Securenamespace.SecureData.CheckSecurity(ViewState["Nazar"].ToString());

            if (StrSort != null)
            {
                dv.Sort = StrSort;
            }
            GridView1.DataSource = dv;
            GridView1.DataBind();
        }
Exemplo n.º 2
0
        public void DeleteItem(object sender, System.EventArgs e)
        {
            String id = ((HtmlAnchor)sender).HRef.ToString();
            int    i  = NazarClass.Delete(Convert.ToInt32(id));

            if (i == 0)
            {
                LblMsg.Text = " error ";
                ScriptManager.RegisterClientScriptBlock(Page, Page.GetType(), Guid.NewGuid().ToString(), "alert('خطا در حذف');", true);
            }
            else
            {
                BindGrid();
            }
            //LightBox.Value = "0";
        }
Exemplo n.º 3
0
        public void BindGrid()
        {
            DataSet ds = NazarClass.GetList(null, null, null, null, null, null, LicensingId.ToString());

            //DataView dv = new DataView(ds.Tables[0]);
            //if (Securenamespace.SecureData.CheckSecurity(ViewState["Nazar"].ToString()) == null)
            //{
            //    ViewState["Nazar"] = "id Desc";
            //}
            //dv.Sort = Securenamespace.SecureData.CheckSecurity(ViewState["Nazar"].ToString()).ToString();
            if (ds != null)
            {
                GridView1.DataSource = ds.Tables[0];
                GridView1.DataBind();
            }
        }
Exemplo n.º 4
0
        protected void BtnUpdate_Click1(object sender, EventArgs e)
        {
            int i = NazarClass.Update(TXTid.Text, DDNazarTypeId.SelectedValue.ToString(), TXTNazarComment.Text, null, Session["UserID"].ToString(), DDManage.SelectedValue.ToString(), LblLicensingId.Text);

            if (i == 0)
            {
                LblMsg.ForeColor = System.Drawing.Color.Red;
                LblMsg.Text      = "خطا";
            }
            else
            {
                LblMsg.ForeColor = System.Drawing.Color.Green;
                LblMsg.Text      = "ویرایش انجام شد";
                BindGrid();
            }
        }
Exemplo n.º 5
0
        protected void BtnInsert_Click(Object sender, System.EventArgs e)
        {
            int t = NazarClass.insert(DDNazarTypeId.SelectedValue.ToString(), TXTNazarComment.Text, null, Session["UserID"].ToString(), DDManage.SelectedValue.ToString(), LblLicensingId.Text);

            if (t == 0)
            {
                LblMsg.ForeColor = System.Drawing.Color.Red;
                LblMsg.Text      = "خطا در ثبت";
            }
            else
            {
                LblMsg.ForeColor = System.Drawing.Color.Green;
                LblMsg.Text      = "ثبت  انجام شد.";
                BindGrid();
            }
        }
Exemplo n.º 6
0
        public void UpItem(object sender, EventArgs e)
        {
            String  id = ((HtmlAnchor)sender).HRef.ToString();
            DataSet ds = NazarClass.GetList(id, null, null, null, null, null, null);
            DataRow dr = ds.Tables[0].Rows[0];

            TXTid.Text           = dr["id"].ToString();;
            TXTNazarComment.Text = dr["NazarComment"].ToString();;

            DDNazarTypeId.SelectedValue = dr["NazarTypeId"].ToString();
            DDManage.SelectedValue      = dr["Manage"].ToString();

            // EmptyLight();
            //// LightBox.Value = "1";
            BtnInsert.Visible = false;

            BtnUpdate.Visible = true;
        }