예제 #1
0
        private bool Delete()
        {
            bool   boRetValue = false;
            string stIDs      = "";

            foreach (DataListItem item in lstItem.Items)
            {
                HtmlInputCheckBox chkList = (HtmlInputCheckBox)item.FindControl("chkList");
                if (chkList != null)
                {
                    if (chkList.Checked == true)
                    {
                        stIDs     += chkList.Value + ",";
                        boRetValue = true;
                    }
                }
            }
            if (boRetValue)
            {
                Data.Unit clsUnit = new Data.Unit();
                clsUnit.Delete(stIDs.Substring(0, stIDs.Length - 1));
                clsUnit.CommitAndDispose();
            }

            return(boRetValue);
        }
예제 #2
0
        protected void lstItem_ItemCommand(object sender, DataListCommandEventArgs e)
        {
            HtmlInputCheckBox chkList = (HtmlInputCheckBox)e.Item.FindControl("chkList");
            string            stParam = string.Empty;

            switch (e.CommandName)
            {
            case "imgItemDelete":
                Data.Unit clsUnit = new Data.Unit();
                clsUnit.Delete(chkList.Value);
                clsUnit.CommitAndDispose();

                LoadList();
                break;

            case "imgItemEdit":
                stParam = "?task=" + Common.Encrypt("edit", Session.SessionID) + "&id=" + Common.Encrypt(chkList.Value, Session.SessionID);
                Response.Redirect("Default.aspx" + stParam);
                break;
            }
        }
예제 #3
0
		private bool Delete()
		{
			bool boRetValue = false;
			string stIDs = "";

			foreach(DataListItem item in lstItem.Items)
			{
				HtmlInputCheckBox chkList = (HtmlInputCheckBox) item.FindControl("chkList");
				if (chkList!=null)
				{
					if (chkList.Checked == true)
					{
						stIDs += chkList.Value + ",";		
						boRetValue = true;
					}
				}
			}
			if (boRetValue)
			{
                Data.Unit clsUnit = new Data.Unit();
				clsUnit.Delete( stIDs.Substring(0,stIDs.Length-1));
				clsUnit.CommitAndDispose();
			}

			return boRetValue;
		}
예제 #4
0
        protected void lstItem_ItemCommand(object sender, DataListCommandEventArgs e)
        {
            HtmlInputCheckBox chkList = (HtmlInputCheckBox)e.Item.FindControl("chkList");
            string stParam = string.Empty;
            switch (e.CommandName)
            {
                case "imgItemDelete":
                    Data.Unit clsUnit = new Data.Unit();
                    clsUnit.Delete(chkList.Value);
                    clsUnit.CommitAndDispose();

                    LoadList();
                    break;
                case "imgItemEdit":
                    stParam = "?task=" + Common.Encrypt("edit", Session.SessionID) + "&id=" + Common.Encrypt(chkList.Value, Session.SessionID);
                    Response.Redirect("Default.aspx" + stParam);
                    break;
            }
        }