Beispiel #1
0
 protected void DataList3_ItemCommand(object source, DataListCommandEventArgs e)
 {
     if (e.CommandName == "PageNumber")
     {
         CurrentPage = Convert.ToInt32(e.CommandArgument);
         //int id = Convert.ToInt32(DropDownList1.SelectedValue);
         int id = Convert.ToInt32(Session["CateID"]);
         GetListPage(DAO.GetTotalRows(id));
         DataList1.DataSource = DAO.getAllCategories();
         DataList1.DataBind();
         DataList3.DataSource = listPage;
         DataList3.DataBind();
         Gridview.DataSource = DAO.getProductPaging(id, CurrentPage);
         Gridview.DataBind();
     }
     //if (e.CommandName == "Category")
     //{
     //    Session["CateID"] = Convert.ToInt32(e.CommandArgument);
     //    GetListPage(DAO.GetTotalRows(Convert.ToInt32(Session["CateID"])));
     //    DataList1.DataSource = DAO.getAllCategories();
     //    DataList1.DataBind();
     //    DataList3.DataSource = listPage;
     //    DataList3.DataBind();
     //    Gridview.DataSource = DAO.getProductPaging(Convert.ToInt32(Session["CateID"]), CurrentPage);
     //    Gridview.DataBind();
     //}
 }
Beispiel #2
0
        protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
        {
            int catID = Convert.ToInt32(e.CommandArgument);

            //Gridview.DataSource = DAO.getAllProductsByCatID(catID);
            if (DAO.getProductPaging(catID, 1).Rows.Count > 0)
            {
                Gridview.DataSource = DAO.getProductPaging(catID, 1);
                Session["CateID"]   = "";
                Session["CateID"]   = catID;
                GetListPage(DAO.GetTotalRows(catID));
                DataList3.DataSource = listPage;
                DataList3.DataBind();
                Gridview.DataBind();
                Label1.Text = "";
            }
            else
            {
                Label1.Text         = "Not found Data of this Category!";
                Gridview.DataSource = null;
                Gridview.DataBind();
                Session["CateID"]    = null;
                DataList3.DataSource = null;
                DataList3.DataBind();
            }
        }
    protected void btnSendMail_Click(object sender, EventArgs e)
    {
        if (!Page.IsValid)
        {
            return;
        }
        try
        {
            IncentiveBusiness b       = new IncentiveBusiness();
            EmailDetails      details = new EmailDetails();
            SendMailObject    obj     = new SendMailObject();
            details.FromEmail = ConfigurationManager.AppSettings["FromAddress"].ToString();
            string finance_emailid = Session["emailId"].ToString();

            string employeeid  = Session["MemberId"].ToString();
            string referenceid = Session["referenceid"].ToString();
            string toemail     = txtTo.Text;
            string ccmail      = txtCC.Text;
            details.ToEmail = toemail.ToString();
            details.CCEmail = ccmail.ToString();
            details.Type    = referenceid;
            details.Id      = "";
            details.Module  = Session["transctiontype"].ToString();

            string FooterText = ConfigurationManager.AppSettings["FooterText"].ToString();
            details.EmailSubject = txtSubject.Text;
            details.MsgBody      = "<span style=\"font-size: 10pt; color: #3300cc; font-family: Verdana\"> <br>" +
                                   "<b> '" + txtMsgContent.Text + "' <br> " +
                                   "<br>" + "<br>" + "<br>" + "<br>" + FooterText +
                                   " </b><br><b> </b></span>";

            bool resultv = obj.InsertIntoEmailQueue(details);
            if (resultv == true)
            {
                bool flag = b.UpdateUtilizationMailFlag(employeeid, referenceid, Session["transctiontype"].ToString());
                Gridview.DataBind();
                Gridview.Visible      = true;
                PanelSendMail.Visible = false;
                txtTo.Text            = "";
                txtCC.Text            = "";
                txtSubject.Text       = "";
                txtMsgContent.Text    = "";
                string CloseWindow1 = "alert('Mail Sent successfully')";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "newWindow", CloseWindow1, true);
            }
            else
            {
                PanelSendMail.Visible = true;
                string CloseWindow1 = "alert('Problem while sending mail')";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "newWindow", CloseWindow1, true);
            }
        }


        catch (Exception ex)
        {
            log.Error(ex.StackTrace);
            log.Error(ex.Message);
        }
    }
Beispiel #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         GetListPage(DAO.GetTotalRows(1));
         if (Session["Cart"] == null)
         {
             Session["Cart"] = new Dictionary <int, int>();
         }
         if (Session["CateID"] == null)
         {
             Session["CateID"] = 1;
         }
         Cart = (Dictionary <int, int>)Session["Cart"];
         DataList1.DataSource = DAO.getAllCategories();
         DataList1.DataBind();
         //Gridview.DataSource = DAO.getAllProductsByCatID(1);
         Gridview.DataSource = DAO.getProductPaging(1, 1);
         Gridview.DataBind();
         DataList3.DataSource = listPage;
         DataList3.DataBind();
         LoadCart();
     }
 }
Beispiel #5
0
 protected void Load_content()
 {
     Gridview.DataSource = _businesscode.GetCRAs(sortingPar);
     Gridview.DataBind();
 }
 protected void BtnSearch_Click(object sender, EventArgs e)
 {
     Gridview.DataBind();
     Gridview.Visible = true;
 }
    protected void Btnsearch_Click(object sender, EventArgs e)
    {
        PublishData       v         = new PublishData();
        string            Pid       = txtPublicationId.Text.Trim();
        Business          obj       = new Business();
        IncentiveBusiness ince_obj  = new IncentiveBusiness();
        string            TypeEntry = "JA";

        v = obj.fnfindjid(Pid, TypeEntry);

        TextBoxPubId.Text                    = Pid;
        txtboxTitleOfWrkItem.Text            = v.TitleWorkItem;
        TextBoxPubJournal.Text               = v.PublisherOfJournal;
        TextBoxNameJournal.Text              = v.PublisherOfJournalName;
        DropDownListMuCategory.SelectedValue = v.MUCategorization;
        DropDownListMonthJA.SelectedValue    = v.PublishJAMonth.ToString();
        string PublicationYearwebConfig = ConfigurationManager.AppSettings["PublicationYear"];
        int    currenntYear             = DateTime.Now.Year;
        int    year = Convert.ToInt32(PublicationYearwebConfig);

        int yeardiff = currenntYear - year;

        if (yeardiff < 0)
        {
            yeardiff = -(yeardiff);
        }
        for (int i = 0; i <= yeardiff; i++)
        {
            int yeatAppend = year + i;
            TextBoxYearJA.Items.Add(new ListItem(yeatAppend.ToString(), yeatAppend.ToString(), true));
        }
        TextBoxYearJA.DataBind();
        TextBoxYearJA.SelectedValue = v.PublishJAYear;
        int pubyear  = Convert.ToInt32(TextBoxYearJA.SelectedValue);
        int pubmonth = 0;

        pubmonth = Convert.ToInt32(DropDownListMonthJA.SelectedValue);
        if (pubyear >= 2018 && pubmonth >= 7)
        {
            string quartileid = v.QuartileOnIncentivize;
            lblQuartile.Visible = true;
            txtquartile.Visible = true;
            txtquartileid.Text  = quartileid.ToString();
            //Session["Quartile"] = txtquartileid.Text;
            //txtquartileid.Text = Session["Quartile"].ToString();
            PublishData v2 = new PublishData();
            if (txtquartileid.Text != "" && txtquartileid.Text != "0")
            {
                v2 = ince_obj.getquartileName(txtquartileid.Text);
                txtquartile.Text = v2.Name;
                if (Convert.ToInt16(v.PublishJAYear) >= 2018 && Convert.ToInt16(v.PublishJAMonth) >= 7)
                {
                    v.ImpactFactor = txtquartileid.Text;
                }
            }
        }
        else
        {
            lblQuartile.Visible = false;
            txtquartile.Visible = false;
        }
        if (v.IncentivePointSatatus == "CAN" && v.Status == "CAN")
        {
            PanelCancel.Visible   = true;
            txtcancelRemarks.Text = v.PubCancelRemarks;
            Gridview.Visible      = true;
            Gridview.DataSourceID = "SqlDataSource3";
            Gridview.DataBind();
            if (Gridview.Rows.Count == 0)
            {
            }
        }
        else
        {
            PanelCancel.Visible   = false;
            Gridview.Visible      = true;
            Gridview.DataSourceID = "SqlDataSource2";
            Gridview.DataBind();
            if (Gridview.Rows.Count == 0)
            {
            }
        }

        TextBoxImpFact.Text  = v.ImpactFactor;
        TextBoxImpFact5.Text = v.ImpactFactor5;
        if (v.IFApplicableYear != 0)
        {
            txtIFApplicableYear.Text = v.IFApplicableYear.ToString();
        }
        TextBoxPageFrom.Text = v.PageFrom;
        TextBoxPageTo.Text   = v.PageTo;
        TextBoxVolume.Text   = v.Volume;
        TextBoxIssue.Text    = v.Issue;
        DropDownListPubType.SelectedValue = v.Publicationtype;

        //Gridview.Visible = true;
        //Gridview.DataSourceID = "SqlDataSource2";
        //Gridview.DataBind();
        //if (Gridview.Rows.Count==0)
        //{
        //}
    }