Ejemplo n.º 1
0
        protected void gvNewKey_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            log4net.ILog logger = log4net.LogManager.GetLogger("File");
            try
            {
                if (e.NewPageIndex >= 0)
                {
                    gvKeySearch.PageIndex = e.NewPageIndex;
                    AdminBLL         ws    = new AdminBLL();
                    GetNewKey        _req  = new GetNewKey();
                    GetNewKeyRequest _resp = ws.GetNewKey(_req);

                    int pageSize = ContextKeys.GRID_PAGE_SIZE;
                    gvKeySearch.PageSize   = pageSize;
                    gvKeySearch.DataSource = _resp.Key;

                    gvKeySearch.DataBind();
                }
            }

            catch (Exception ex)
            {
                logger.Info(ex.Message);
            }
        }
Ejemplo n.º 2
0
        private void BindGridWithFilter()
        {
            log4net.ILog logger = log4net.LogManager.GetLogger("File");
            try
            {
                AdminBLL  ws          = new AdminBLL();
                GetNewKey objReq      = new GetNewKey();
                string    WhereClause = ReturnWhere();

                if (!string.IsNullOrEmpty(txtKeyNo.Text))
                {
                    objReq.key_no = txtKeyNo.Text;
                }
                if (!string.IsNullOrEmpty(ddlstatus.Text))
                {
                    objReq.status = ddlstatus.Text;
                }
                if (!string.IsNullOrEmpty(txtKeyName.Text))
                {
                    objReq.name = txtKeyName.Text;
                }
                if (!string.IsNullOrEmpty(txtKeyNRIC.Text))
                {
                    objReq.nricno = txtKeyNRIC.Text;
                }
                if (!string.IsNullOrEmpty(WhereClause))
                {
                    objReq.WhereClause = WhereClause;
                }

                if (!string.IsNullOrEmpty(txtdateto.Text))
                {
                    if (!string.IsNullOrEmpty(txtdatefrom.Text))
                    {
                        objReq.Date_From = txtdatefrom.Text;
                        objReq.Date_From = txtdatefrom.Text;
                    }
                }

                if (!string.IsNullOrEmpty(txtdatefrom.Text))
                {
                    if (string.IsNullOrEmpty(txtdateto.Text))
                    {
                        objReq.Date_From = txtdatefrom.Text;
                    }
                }


                GetNewKeyRequest ret = ws.GetNewKey(objReq);
                int pageSize         = ContextKeys.GRID_PAGE_SIZE;
                gvKeySearch.PageSize   = pageSize;
                gvKeySearch.DataSource = ret.Key;
                gvKeySearch.DataBind();
            }
            catch (Exception ex)
            {
                logger.Info(ex.Message);
            }
        }
Ejemplo n.º 3
0
        private void PopulatePageCntrls(string argsBGID)
        {
            Int32            iCount = 0;
            GetNewKeyRequest ret    = null;

            log4net.ILog logger = log4net.LogManager.GetLogger("File");
            try
            {
                AdminBLL  objAdminBLL = new AdminBLL();
                GetNewKey objGetBillingTableRequest = new GetNewKey();
                objGetBillingTableRequest.key_no = argsBGID.ToString();

                objGetBillingTableRequest.WhereClause = " where Key_ID= '" + argsBGID + "' ";

                ret = objAdminBLL.GetNewKey(objGetBillingTableRequest);

                hdnBTID.Value = ret.Key[iCount].key_ID.ToString();
                //hdnBTID.Value = ret.Key[iCount].Description.ToString();

                txtKeyNo.Text   = ret.Key[iCount].key_ID.ToString();
                txtKeyDesc.Text = ret.Key[iCount].Description.ToString();

                txtKeyName.Text     = ret.Key[iCount].name.ToString();
                txtKeyPosition.Text = ret.Key[iCount].position.ToString();
                txtKeyNRIC.Text     = ret.Key[iCount].Staff_ID.ToString();
                //txtKeyConnt.Text = ret.Key[iCount].Staff_ID.ToString();

                //-------------------------------------------------------------------
                DBConnectionHandler1 db = new DBConnectionHandler1();
                SqlConnection        cn = db.getconnection();
                cn.Open();
                SqlCommand cmd = new SqlCommand("select NRICno from UserInformation where NRICno=@staffid", cn);
                cmd.Parameters.AddWithValue("@staffid", txtKeyNRIC.Text);
                SqlDataReader dr = cmd.ExecuteReader();
                if (dr.Read())
                {
                    txtKeyNRIC.Text = dr.GetString(0);
                    //txtKeyConnt.Text = "";
                    //========================//
                    dr.Close();
                    dr.Dispose();
                    //========================//
                    cn.Close();
                }
                //-------------------------------------------------------------------
            }
            catch (Exception ex)
            {
                logger.Info(ex.Message);
            }
        }
Ejemplo n.º 4
0
 public GetNewKeyRequest GetNewKey(GetNewKey objGetNewKeyRequest)
 {
     try
     {
         AdminDAL              objAdminDAL = new AdminDAL();
         GetNewKeyRequest      ret         = new GetNewKeyRequest();
         List <AdminAddNewKey> lst         = objAdminDAL.GetNewKey(objGetNewKeyRequest);
         ret.Key = lst;
         return(ret);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 5
0
        private void BindGrid()
        {
            log4net.ILog logger = log4net.LogManager.GetLogger("File");
            try
            {
                AdminBLL         ws    = new AdminBLL();
                GetNewKey        _req  = new GetNewKey();
                GetNewKeyRequest _resp = ws.GetNewKey(_req);

                int pageSize = ContextKeys.GRID_PAGE_SIZE;
                gvKeySearch.PageSize   = pageSize;
                gvKeySearch.DataSource = _resp.Key;
                gvKeySearch.DataBind();
            }
            catch (Exception ex)
            {
                logger.Info(ex.Message);
            }
        }