Example #1
0
        private void bindData()
        {
            PenjaminanDataset.m_documentRow dr = m_document.selectDocumentByID(eID);
            Models.PenjaminanDatasetTableAdapters.m_kategoriTableAdapter ta = new Models.PenjaminanDatasetTableAdapters.m_kategoriTableAdapter();

            DropDownList1.DataSource = (PenjaminanDataset.m_kategoriDataTable)ta.GetDataKategoriByID(dr.fk_kategori);
            DropDownList1.DataBind();
            txtName.Value        = dr.name.ToString();
            txtDescription.Value = dr.description.ToString();
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserProfile"] == null)
            {
                Response.Redirect("/Default.aspx");
            }
            if (!Page.IsPostBack)
            {
                if (eType == "add")
                {
                }
                else if (eType == "edit")
                {
                    bindData();
                }
                else if (eType == "delete")
                {
                    softDeleteData(eID);
                }
            }

            lblMenu.Text          = "Entry Master Document";
            Session["activepage"] = "document";

            if (!Page.IsPostBack)
            {
                Models.PenjaminanDatasetTableAdapters.m_kategoriTableAdapter ta = new Models.PenjaminanDatasetTableAdapters.m_kategoriTableAdapter();

                DropDownList1.DataSource = (PenjaminanDataset.m_kategoriDataTable)ta.GetData();
                DropDownList1.DataBind();

                if (eType == "edit")
                {
                    PenjaminanDataset.m_documentRow dr = m_document.selectDocumentByID(eID);
                    tKategoriID = dr.fk_kategori;
                    DropDownList1.SelectedValue = tKategoriID.ToString();
                }

                //DropDownList1.DataTextFormatString = "{0} - {1}";
                //DropDownList1.DataTextField = "ID,NamaDivisi";
            }
        }
Example #3
0
        public static PenjaminanDataset.m_documentRow selectDocumentByID(int id)
        {
            PenjaminanDatasetTableAdapters.m_documentTableAdapter ta = new PenjaminanDatasetTableAdapters.m_documentTableAdapter();
            PenjaminanDataset.m_documentDataTable dt = new PenjaminanDataset.m_documentDataTable();
            PenjaminanDataset.m_documentRow       dr = null;

            try
            {
                ta.FillDocumentByID(dt, id);

                if (dt.Count > 0)
                {
                    dr = dt[0];
                }

                return(dr);
            }
            catch (Exception ex)
            {
                throw new ApplicationException("Failed to load document data : " + ex.Message);
            }
        }