Exemplo n.º 1
0
    protected void Button2Export_Click(object sender, EventArgs e)
    {
        DataTable dy = null;

        DataTable dz = null;

        PatentBusiness obj = new PatentBusiness();

        string    MemberId = txtEmployeecode.Text;
        DataTable dt       = obj.GetPatentWisePoints(MemberId);


        if (dt.Rows.Count == 0)
        {
            GridView2.Visible   = false;
            PanelPatent.Visible = false;
            //   noField.Visible = true;
            //  noField.Text = "No Records Found";
        }
        else
        {
            ViewState["GridViewStudentlist"] = dt;
        }

        //  DataTable dt = (DataTable)ViewState["GridViewStudentlist"];

        string filename = "PatentWisePointExcel.xls";

        string headerTable = @"<table width='100%' border='1'  align='center'  class='TestCssStyle'><h4>Patent Wise Points Summary<br/></h4></table>";


        HttpContext.Current.Response.Write(headerTable);



        System.IO.StringWriter       tw = new System.IO.StringWriter();
        System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);
        DataGrid dgGrid = new DataGrid();

        dgGrid.DataSource = dt;
        dgGrid.DataBind();
        foreach (DataGridItem item in dgGrid.Items)
        {
            for (int j = 0; j < item.Cells.Count; j++)
            {
                item.Cells[j].Attributes.Add("style", "mso-number-format:\\@");
            }
        }
        dgGrid.ShowHeader = true;
        dgGrid.RenderControl(hw);

        Response.ContentType = "application/vnd.ms-excel";
        Response.AppendHeader("Content-Disposition", "attachment; filename=" + filename + "");

        this.EnableViewState = false;
        Response.Write(tw.ToString());
        Response.End();
    }
    protected void GridViewPatentSearch_SelectedIndexChanged(object sender, EventArgs e)
    {
        txtmemberPatent.Text     = "";
        TxtcurrentPatent.Text    = "";
        txttotalPointPatent.Text = "";
        //txtBasePoint.Text = "";
        //txtSNIPSJRPoint.Text = "";
        //txtThresholdPoint.Text = "";
        txttotalPointPatent.Text     = "";
        txtreferencePatent.Text      = "";
        btnupdatePatent.Enabled      = true;
        GridViewPatentSearch.Visible = true;
        GridViewRow row      = GridViewPatentSearch.SelectedRow;
        string      memberid = row.Cells[1].Text;

        txtmemberPatent.Text    = row.Cells[1].Text;
        txtreferencePatent.Text = row.Cells[3].Text;

        PatentBusiness busobj = new PatentBusiness();
        Patent         obj    = new Patent();

        obj = busobj.SelectPatentData(memberid, row.Cells[3].Text.Trim());
        //int ThresholdPublicationNo = Convert.ToInt16(ConfigurationManager.AppSettings["ThresholdPublicationNo"]);
        //int count = busobj.CountThresholdPublicationPoint(obj);
        //point 3 (crosses 6 publication) is awarded once in a year
        //if (count > ThresholdPublicationNo)
        //{
        //    if (obj.MUNonMU == "M")
        //    {
        //        txtThresholdPoint.Enabled = true;
        //    }
        //    else
        //    {
        //        txtThresholdPoint.Enabled = false;
        //    }
        //}
        //else
        //{
        //    txtThresholdPoint.Enabled = false;
        //    txtThresholdPoint.Text = "";
        //}

        //if (obj.AuthorType == "P" || obj.isCorrAuth == "Y")
        //{
        //    txtSNIPSJRPoint.Enabled = true;
        //}
        //else
        //{
        //    txtSNIPSJRPoint.Enabled = true;
        //    txtSNIPSJRPoint.Text = "";
        //}

        IncentivePoint obj1 = new IncentivePoint();

        obj1 = busobj.SelectPatentMemberCurBalance(memberid);
        TxtcurrentPatent.Text = obj1.CurrentBalance.ToString();
    }
Exemplo n.º 3
0
    protected void BtnsearchPatent_Click(object sender, EventArgs e)
    {
        Patent         d   = new Patent();
        string         Pid = txtpatentID.Text.Trim();
        PatentBusiness obj = new PatentBusiness();

        d                    = obj.fnfindpatent(Pid);
        txtID.Text           = Pid;
        txtTitle.Text        = d.Title;
        txtdescription.Text  = d.description;
        txtfilingoffice.Text = d.Filing_Office;
        if (txtfilingoffice.Text == "C")
        {
            txtfilingoffice.Text = "Chennai";
        }
        else if (txtfilingoffice.Text == "D")
        {
            txtfilingoffice.Text = "Delhi";
        }
        else if (txtfilingoffice.Text == "K")
        {
            txtfilingoffice.Text = "Kolkata";
        }
        else if (txtfilingoffice.Text == "M")
        {
            txtfilingoffice.Text = "Mumbai";
        }
        if (d.Grant_Date != null)
        {
            txtgrantdate.Text = d.Grant_Date.ToShortDateString();
        }

        txtPatentno.Text       = d.Patent_Number;
        Gridview1.Visible      = true;
        Gridview1.DataSourceID = "SqlDataSource6";
        Gridview1.DataBind();
        if (Gridview.Rows.Count == 0)
        {
        }
    }