Esempio n. 1
0
    public void allFavorites()
    {
        DataTable dtresults = new DataTable();

        dtresults.Columns.Add("ID");
        dtresults.Columns.Add("ResourceName");
        dtresults.Columns.Add("Description");
        dtresults.Columns.Add("QuickLink");
        dtresults.Columns.Add("ShowInNewWindow");
        dtresults.Columns.Add("ShowLogin");
        dtresults.Columns.Add("SharedPassword");
        dtresults.Columns.Add("SharedUsername");
        dtresults.Columns.Add("contentType");
        dtresults.Columns.Add("collection");
        commonfunctions cf = new commonfunctions();

        DataTableReader dtr = commonfunctions.AllMyFavsDTP().CreateDataReader();
        while (dtr.Read())
        {

            string ResourceContentType = dtr["ResourceContentType"].ToString().Trim();
            string FavoriteURL = dtr["FavoriteURL"].ToString().Trim();
            string collection = dtr["collection"].ToString().Trim();
            string Data = dtr["Data"].ToString().Trim();
            switch (ResourceContentType)
            {
                case "1": //this is a resource
                    dtresults.Rows.Add(getResourceitem(FavoriteURL, ResourceContentType));
                    break;

                case "2": //this is a ektron content
                    dtresults.Rows.Add(getEktronContenItem(FavoriteURL, ResourceContentType));
                    //  Response.Write(resourceID + "<br/>");
                    break;

                case "3": //SSA Report - ContentDM
                    dtresults.Rows.Add(getContentDMItem(FavoriteURL, ResourceContentType, collection));

                    break;

                case "4": //Summon Search
                    dtresults.Rows.Add(getSummonItem(FavoriteURL, ResourceContentType, Data));
                    break;
                 case "6": //Tools For
                     dtresults.Rows.Add(getToolsForContent(FavoriteURL, ResourceContentType));

                    break;
            }

        }
           // Response.Write(dtresults.Rows.Count);

        DL_Resourceslist.DataSource = commonfunctions.sortDataTable(dtresults, "ResourceName", "ASC");
        DL_Resourceslist.DataBind();
    }
Esempio n. 2
0
    /// <summary>
    /// Page load event
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["id"]))
            {
                long contentId = long.Parse(Request.QueryString["id"]);

            }
            commonfunctions cf = new commonfunctions();

            if (!string.IsNullOrEmpty(Request.QueryString["resourceid"]))
            {
                string resourceid = Request.QueryString["resourceid"].ToString();
                DataTable dtResource = DataBase.dbDataTable("Select * from Resources where ID ='" + resourceid + "'");
                DL_Resourceslist.DataSource = dtResource;
                DL_Resourceslist.DataBind();

                  subjectArea = "";
                string sql = "SELECT  * FROM [ViewAllSubjectArea_SSADL] order by Name ASC";
                DataTable dtSA = DataBase.dbDataTable(sql, "Ektron.DbConnection");

                DataTableReader dtr = dtResource.CreateDataReader();
                if (dtr.HasRows)
                {
                    while (dtr.Read())
                    {
                        string ID = dtr["ID"].ToString().Trim();
                          Title = dtr["ResourceName"].ToString().Trim();
                        string Link = "/dynamicdb.aspx?resourceid=" + dtr["ID"].ToString().Trim();
                        string Description = dtr["Description"].ToString().Trim();

                        string SubjectAreasIDs = dtr["SubjectAreasTaxonomy"].ToString().Trim();

                        if (SubjectAreasIDs != "")
                        {
                            string[] SubjectAreaIDss = SubjectAreasIDs.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
                            foreach (string SubjectAreaID in SubjectAreaIDss)
                            {

                                DataRow[] result = dtSA.Select("TaxID='" + SubjectAreaID + "'");
                                foreach (DataRow row in result)
                                {

                                    subjectArea += "<li><a href='" + row["URL"].ToString() + "'>" + row["Name"].ToString() + "</a></li>";

                                }

                            }
                        }

                    }
                }

            }
        }

        uxPageTitle.pgTitle = Title; // mainContent.EkItem.Title.ToString();
        uxPageTitle.pageId = mainContent.EkItem.Id.ToString();
        mainContent.Text = "<!-- -->";
        uxPageTitle.ResourceTypeId = "2";
        uxBreadcrumb.contentID = mainContent.EkItem.Id.ToString();
    }
Esempio n. 3
0
    private void CountDeliveryAmount()
    {
        foreach (DataListItem item in DataList1.Items)
        {
            Label lblcartid = (Label)item.FindControl("lblCartid");
            string ChefID = con.singlecell("select Chef_ID from CartMaster where Cart_ID='" + lblcartid.Text + "'");
            string ChefZipCode = con.singlecell("Select PinCode from ChefPersonalDetail Where Chef_ID='" + ChefID + "'");
            string Destination = lblpincode.Text;
            
            //string consumeraddresss = objcheck.get_User_Address(Session["Consumer_ID"].ToString(),false,true,addressid);
            //string chefaddress = objcheck.get_User_Address(ChefID,true,true,null);

            if (con.check_data("Select * from DeliveryCount where Cart_ID='" + lblcartid.Text + "'"))
            {
            }
            else
            {
             commonfunctions cf = new commonfunctions();
                Dictionary<string, string> fromvalues = new Dictionary<string, string>();
                //fromvalues = cf.CalculateResult(chefaddress, consumeraddresss);
                fromvalues = cf.CalculateResult(ChefZipCode, Destination);
                lblshippingcharge.Text = fromvalues["charges"];

                string shippingcarge = fromvalues["charges"];

                    int shippingcharge = int.Parse(fromvalues["charges"]);
                    SqlParameter[] p1 = new SqlParameter[3];
                    p1[0] = new SqlParameter("@CartID", lblcartid.Text);
                    p1[1] = new SqlParameter("@Mode", 3);
                    p1[2] = new SqlParameter("@DeliveryAmt", shippingcharge);

                    con1.Ins_Upd_Del("SP_ConsumerCart_Edit", p1);
                   // con.insert_data("insert into DeliveryCount values('" + ChefID + "','" + fromvalues["distancecount"] + "','" + lblcartid.Text + "','" + shippingcharge.ToString() + "')");
                    con.insert_data("insert into DeliveryCount values('" + Session["Consumer_ID"] + "','" + fromvalues["distancecount"] + "','" + lblcartid.Text + "','" + shippingcharge.ToString() + "')");
               
            }

        }
        string totdelAmt = con.singlecell("Select Sum(Amount) from DeliveryCount where Chef_ID='" + Session["Consumer_ID"] + "' and Amount!='-1'");
        con.delete_data("delete from DeliveryCount where Chef_ID='" + Session["Consumer_ID"] + "'");
        lblshippingcharge.Text = totdelAmt;
    }