private void btn_Save_Customer_Click(object sender, EventArgs e)
        {
            BLCustomer blC = new BLCustomer();

            if (SaveStatus == 1)
            {
                blC.CreateCustomer(txt_Customer_CustomerName.Text,
                                   txt_Customer_IdentityCard.Text,
                                   txt_Customer_PhoneNumber.Text,
                                   txt_Customer_CustomerAddress.Text);
            }
            else if (SaveStatus == 2)
            {
                blC.UpdateCustomer(txt_Customer_CustomerID.Text,
                                   txt_Customer_CustomerName.Text,
                                   txt_Customer_IdentityCard.Text,
                                   txt_Customer_PhoneNumber.Text,
                                   txt_Customer_CustomerAddress.Text);
            }
            SaveStatus = 0;
            dgv_Customer.DataSource = blC.LoadCustomer();
            dgv_Customer_CellClick(null, null);
            btn_Update_Customer.Enabled = true;
            btn_Create_Customer.Enabled = true;
            btn_Save_Customer.Enabled   = false;
        }
Exemple #2
0
        public string ManageCustomer(BLCustomer obj)
        {
            string result = string.Empty;

            if (obj._CUSTOMERID == null)
            {
                obj._CUSTOMERID = 0;
            }

            string queryString = "CALL SP_MANAGECUSTOMER(?_CUSTOMERID, ?_CUSTOMERCODE, ?_CUSTOMERNAME, ?_ADDRESS, ?_EMAIL, ?_CONTACTPERSON, ?_CONTACTNO, ?_ACTIVE, ?_CREATEDBY, ?_CREATEDON, ?_MODE)";

            MySqlParameter[] mySqlParam = new MySqlParameter[11];

            mySqlParam[0]  = CreateParameters(DbType.Int32, obj._CUSTOMERID, "?_CUSTOMERID", ParameterDirection.Input);
            mySqlParam[1]  = CreateParameters(DbType.String, obj._CUSTOMERCODE, "?_CUSTOMERCODE", ParameterDirection.Input);
            mySqlParam[2]  = CreateParameters(DbType.String, obj._CUSTOMERNAME, "?_CUSTOMERNAME", ParameterDirection.Input);
            mySqlParam[3]  = CreateParameters(DbType.String, obj._ADDRESS, "?_ADDRESS", ParameterDirection.Input);
            mySqlParam[4]  = CreateParameters(DbType.String, obj._EMAIL, "?_EMAIL", ParameterDirection.Input);
            mySqlParam[5]  = CreateParameters(DbType.String, obj._CONTACTPERSON, "?_CONTACTPERSON", ParameterDirection.Input);
            mySqlParam[6]  = CreateParameters(DbType.String, obj._CONTACTNO, "?_CONTACTNO", ParameterDirection.Input);
            mySqlParam[7]  = CreateParameters(DbType.String, obj._ACTIVE, "?_ACTIVE", ParameterDirection.Input);
            mySqlParam[8]  = CreateParameters(DbType.Int32, obj._CREATEDBY, "?_CREATEDBY", ParameterDirection.Input);
            mySqlParam[9]  = CreateParameters(DbType.DateTime, obj._CREATEDON, "?_CREATEDON", ParameterDirection.Input);
            mySqlParam[10] = CreateParameters(DbType.String, obj._MODE, "?_MODE", ParameterDirection.Input);

            result = ((String)MySqlHelper.ExecuteScalar(connectionString, queryString, mySqlParam)).ToString();
            return(result);
        }
Exemple #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (custs() == null)
        {
            BLCustomer cust = new BLCustomer(0);
            Application["cust"]=cust;

        }

           // if (messages.orgs_.ID <= 0)
        if (custs().signedInorgID <= 0)
        {
            Response.Redirect("Login.aspx?login=org");
        }

        if (!IsPostBack)
        {
            messages.cnt = 0;
            messages.arCats = new  String [20];

            DataSet ds = UpdateDonate("R", "get_Categories", 0, "");

            lstcatsub1.Visible = false;
            lstcatsub2.Visible = false;
            lstcatsub3.Visible = false;

            lstcat.DataSource = ds;
            lstcat.DataBind();
        }
    }
Exemple #4
0
        public IHttpActionResult AddCustomer(Customer customer)
        {
            BLCustomer blCustomer = new BLCustomer();
            string     result     = blCustomer.AddCustomer(customer);

            return(Content(HttpStatusCode.OK, result));
        }
        public int CartCount()
        {
            try
            {
                BLCustomer bal   = new BLCustomer();
                int        count = 0;
                if (Session["CustomerId"] != null)
                {
                    int CustomerId = Convert.ToInt32(Session["CustomerId"]);
                    int CartId     = balCustomer.CartCustomerExist(CustomerId);

                    List <DLProducts> lst = bal.CartItem(CartId);
                    foreach (var v in lst)
                    {
                        count++;
                    }
                    Session["CartCount"] = count;
                }
                return(count);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void btn_Delete_Customer_Click(object sender, EventArgs e)
        {
            BLCustomer blC = new BLCustomer();

            blC.DeleteCustomer(txt_Customer_CustomerID.Text);
            dgv_Customer.DataSource = blC.LoadCustomer();
            dgv_Customer_CellClick(null, null);
        }
Exemple #7
0
 public DataSet GetCustomers(BLCustomer obj)
 {
     if (obj._MODE == "BYCUSTOMERID")
     {
         return(GetUserByUserID(obj));
     }
     else if (obj._MODE == "GETALL")
     {
         return(GetAllActiveUsers(obj));
     }
     else
     {
         return(SearchUser(obj));
     }
 }
Exemple #8
0
        public ActionResult SignIn(string Email, string Password)
        {
            try
            {
                bal = new BLCustomer();
                if (!string.IsNullOrEmpty(Email) && !string.IsNullOrEmpty(Password))
                {
                    string   email    = Request["Email"];
                    string   password = SHA1.Encode(Password);
                    string[] i        = bal.SignIn(email, password);

                    if (i != null)
                    {
                        Session["LoginCustomer"] = i[0];
                        Session["CustomerId"]    = i[1];

                        if (Session["CustomerId"] != null)
                        {
                            int CustomerId = Convert.ToInt32(Session["CustomerId"]);

                            int CartId            = bal.CartCustomerExist(CustomerId);
                            List <DLProducts> lst = bal.CartItem(CartId);

                            int count = 0;
                            foreach (var val in lst)
                            {
                                count++;
                            }
                            Session["CartCount"] = count;
                        }
                        return(Redirect("/Customer/Home"));
                    }
                    else
                    {
                        TempData["Error"] = "Invalid email or password";
                    }
                }
                else
                {
                    TempData["Error"] = "Required Email or password";
                }
                return(Redirect("/Customer/Home"));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #9
0
        public void ReadCustomerListTest()
        {
            int           id     = 0;
            List <string> errors = new List <string>();

            //id = 0
            BLCustomer.ReadCustomer(id, ref errors);
            Assert.AreEqual(1, errors.Count);
            AsynchLog.LogNow(errors);

            //no errors
            errors = new List <string>();

            BLCustomer.ReadCustomer(1, ref errors);
            Assert.AreEqual(0, errors.Count);
            AsynchLog.LogNow(errors);
        }
Exemple #10
0
        private void Checkin_TextBox_SearchCutomer_TextChanged(object sender, EventArgs e)
        {
            BS_Layer.BLCustomer bl = new BLCustomer();
            var dtHD = new DataTable();

            dtHD.Clear();
            DataSet ds = new DataSet();

            if (Checkin_Combobox_Search.Text == "Customer Name")
            {
                ds = bl.SearchCutomer(Checkin_TextBox_SearchCutomer.Text, null);
            }
            else
            {
                ds = bl.SearchCutomer(null, Checkin_TextBox_SearchCutomer.Text);
            }
            dtHD = ds.Tables[0];
            Checkin_Datagridview_ListOfCustomer.DataSource = dtHD;
        }
        private void btn_Customer_Click(object sender, EventArgs e)
        {
            TabControl_Main.TabPages.Clear();
            TabControl_Main.TabPages.Add(TabPage_Customer);
            dgv_Customer.AutoResizeColumns();
            BLCustomer dbC  = new BLCustomer();
            var        data = dbC.LoadCustomer();

            if (data != null)
            {
                dgv_Customer.DataSource = data;
            }
            else
            {
                dgv_Customer.DataSource = null;
            }
            dgv_Customer_CellClick(null, null);
            txt_Customer_CustomerID.Enabled = false;
        }
Exemple #12
0
        public ActionResult Login()
        {
            try
            {
                bal = new BLCustomer();
                DLCustomer dlcustomer = new DLCustomer();
                dlcustomer.Firstname = Request["Firstname"];

                dlcustomer.Lastname      = Request["Lastname"];
                dlcustomer.GoogleId      = Request["GoogleID"];
                dlcustomer.Email         = Request["Email"];
                Session["LoginCustomer"] = dlcustomer.Firstname + " " + dlcustomer.Lastname;

                dlcustomer.Password = null;


                int val = bal.Signup(dlcustomer, "Insert");

                Session["CustomerId"] = bal.GPlusCustomer();
                if (Session["CustomerId"] != null)
                {
                    int CustomerId = Convert.ToInt32(Session["CustomerId"]);

                    int CartId = bal.CartCustomerExist(CustomerId);
                    if (CartId > 0)
                    {
                        List <DLProducts> lst = bal.CartItem(CartId);
                        int count             = 0;
                        foreach (var v in lst)
                        {
                            count++;
                        }
                        Session["CartCount"] = count;
                    }
                }

                return(Redirect("/Customer/Home"));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public object GetCustomerByID(Guid itemID)
        {
            ServiceResult   result = new ServiceResult();
            List <Customer> items;

            try
            {
                items          = new BLCustomer().GetCustomer(itemID);
                result.Success = true;
                result.Data    = items;
            }
            catch (Exception ex)
            {
                CommonFunction.WriteLog(ex, SerializeUtil.Serialize(itemID), Request.RequestUri.ToString());
                result.Success   = false;
                result.ErrorCode = ex.Message;
            }
            return(result);
        }
Exemple #14
0
 public string ManageCustomer(int _CUSTOMERID, string _CUSTOMERCODE, string _CUSTOMERNAME, string _ADDRESS, string _EMAIL, string _CONTACTPERSON, string _CONTACTNO,
                              string _ACTIVE, int _CREATEDBY, string _CREATEDON, string _MODE)
 {
     using (BLCustomer objbl = new BLCustomer())
     {
         objbl._CUSTOMERID    = Convert.ToInt32(_CUSTOMERID);
         objbl._CUSTOMERCODE  = _CUSTOMERCODE;
         objbl._CUSTOMERNAME  = _CUSTOMERNAME;
         objbl._ADDRESS       = _ADDRESS;
         objbl._EMAIL         = _EMAIL;
         objbl._CONTACTPERSON = _CONTACTPERSON;
         objbl._CONTACTNO     = _CONTACTNO;
         objbl._ACTIVE        = _ACTIVE;
         objbl._CREATEDBY     = Convert.ToInt32(_CREATEDBY);
         objbl._CREATEDON     = _CREATEDON;
         objbl._MODE          = _MODE;
         //==================
         return(objbl.ManageCustomer());
         //==================
     }
 }
Exemple #15
0
    public GetCustomer[] GetCustomers(int _CUSTOMERID, string _CUSTOMERCODE, string _CUSTOMERNAME, string _ADDRESS, string _EMAIL, string _CONTACTPERSON, string _CONTACTNO,
                                      string _ACTIVE, int _CREATEDBY, string _CREATEDON, string _MODE)
    {
        List <GetCustomer> returnObj = new List <GetCustomer>();

        using (BLCustomer obj = new BLCustomer())
        {
            //============
            obj._CUSTOMERID    = _CUSTOMERID;
            obj._CUSTOMERCODE  = _CUSTOMERCODE;
            obj._CUSTOMERNAME  = _CUSTOMERNAME;
            obj._ADDRESS       = _ADDRESS;
            obj._EMAIL         = _EMAIL;
            obj._CONTACTPERSON = _CONTACTPERSON;
            obj._CONTACTNO     = _CONTACTNO;
            obj._ACTIVE        = _ACTIVE;
            obj._CREATEDBY     = _CREATEDBY;
            obj._CREATEDON     = _CREATEDON;
            obj._MODE          = _MODE;
            //============
            DataSet ds = obj.GetCustomers();
            //============
            foreach (DataRow item in ds.Tables[0].Rows)
            {
                returnObj.Add(new GetCustomer()
                {
                    CUSTOMERID    = Convert.ToInt32(item["CUSTOMERID"]),
                    CUSTOMERCODE  = Convert.ToString(item["CUSTOMERCODE"]),
                    CUSTOMERNAME  = Convert.ToString(item["CUSTOMERNAME"]),
                    ADDRESS       = Convert.ToString(item["ADDRESS"]),
                    CONTACTPERSON = Convert.ToString(item["CONTACTPERSON"]),
                    CONTACTNO     = Convert.ToString(item["CONTACTNO"]),
                    EMAIL         = Convert.ToString(item["EMAIL"]),
                    ACTIVE        = Convert.ToString(item["ACTIVE"]),
                });
            }
        }
        return(returnObj.ToArray());
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        string qry = Request.QueryString !=null  && Request.QueryString.Count>0 ?   Request.QueryString[0].ToString():  "" ;
        DataSet ds = new DataSet();

        int auctionid=     qry==null || qry == "" ?   0 :    (int) Convert.ToInt16 ( qry ) ;

        if (Application["cust"] == null)
        {

            BLCustomer cust = new BLCustomer(0);

            Application["cust"] = cust;

        }

        //try
        //{

          String Credits = custs().Credits.ToString();// dr["Credits"].ToString();

          HtmlContainerControl loginorg = (HtmlContainerControl)this.FindControl("loginorg");
          loginorg.InnerText = custs()  == null || custs().signedinorgid == 0 ? "" : custs().signedinorgname;

          HtmlContainerControl logincust = (HtmlContainerControl)this.FindControl("logincust");
          logincust.InnerText = custs().CustName == null || custs().CustName == "" ? "" : custs().CustName;

        HtmlContainerControl credits = (HtmlContainerControl)this.FindControl("credits");
        credits.InnerText =   Credits.ToString();   //messages.currentBidAmount.ToString();

        HtmlContainerControl cartcount = (HtmlContainerControl)this.FindControl("cartcount");
        cartcount.InnerText = items().cartcount.ToString();

        //HtmlContainerControl handling = (HtmlContainerControl)this.FindControl("cartcount");
        //handling.InnerText = items().Handling.ToString();

        //}
        //catch (Exception) { }
    }
Exemple #17
0
        public DataSet GetAllActiveUsers(BLCustomer obj)
        {
            string queryString = "CALL SP_MANAGECUSTOMER(?_CUSTOMERID, ?_CUSTOMERCODE, ?_CUSTOMERNAME, ?_ADDRESS, ?_EMAIL, ?_CONTACTPERSON, ?_CONTACTNO, ?_ACTIVE, ?_CREATEDBY, ?_CREATEDON, ?_MODE)";

            MySqlParameter[] mySqlParam = new MySqlParameter[11];

            mySqlParam[0]  = CreateParameters(DbType.Int32, obj._CUSTOMERID, "?_CUSTOMERID", ParameterDirection.Input);
            mySqlParam[1]  = CreateParameters(DbType.String, "", "?_CUSTOMERCODE", ParameterDirection.Input);
            mySqlParam[2]  = CreateParameters(DbType.String, "", "?_CUSTOMERNAME", ParameterDirection.Input);
            mySqlParam[3]  = CreateParameters(DbType.String, "", "?_ADDRESS", ParameterDirection.Input);
            mySqlParam[4]  = CreateParameters(DbType.String, "", "?_EMAIL", ParameterDirection.Input);
            mySqlParam[5]  = CreateParameters(DbType.String, "", "?_CONTACTPERSON", ParameterDirection.Input);
            mySqlParam[6]  = CreateParameters(DbType.String, "", "?_CONTACTNO", ParameterDirection.Input);
            mySqlParam[7]  = CreateParameters(DbType.String, "", "?_ACTIVE", ParameterDirection.Input);
            mySqlParam[8]  = CreateParameters(DbType.Int32, "1", "?_CREATEDBY", ParameterDirection.Input);
            mySqlParam[9]  = CreateParameters(DbType.DateTime, obj._CREATEDON, "?_CREATEDON", ParameterDirection.Input);
            mySqlParam[10] = CreateParameters(DbType.String, obj._MODE, "?_MODE", ParameterDirection.Input);

            DataSet _ds = (DataSet)MySqlHelper.ExecuteDataset(connectionString, queryString, mySqlParam);

            return(_ds);
        }
Exemple #18
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //Response.Cookies["userName"].Value = "patrick";
        //Response.Cookies["userName"].Expires = DateTime.Now.AddDays(1);

        //HttpCookie aCookie = new HttpCookie("lastVisit");
        //aCookie.Value = DateTime.Now.ToString();
        //aCookie.Expires = DateTime.Now.AddDays(1);
        //Response.Cookies.Add(aCookie);

        //if (Request.Cookies["userName"] != null)
        //    Label1.Text = Server.HtmlEncode(Request.Cookies["userName"].Value);

        //if (Request.Cookies["userName"] != null)
        //{
        //    HttpCookie aCookie = Request.Cookies["userName"];
        //    Label1.Text = Server.HtmlEncode(aCookie.Value);
        //}

        //Session["nonProfit"] = "L";

        BLItem.refreshMenu += new EventHandler(refreshMenus);

        ////////////////////refreshMenu();

        //////////////while ((Logins.password != "tzally123" && Logins.password != "zalman123" && Logins.password != "zalman123" && Logins.password != "zalman123") &&
        ////////////// (Logins.userid != "tzally123" && Logins.userid != "zalman123" && Logins.userid != "zalman123" && Logins.userid != "zalman123"))
        //////////////{
        //////////////   items().rowlimit=0;
        //////////////     items().pager =0;

        //////////////    Response.Redirect("Login.aspx");
        //////////////};
           // Logins.userid = txtLoginEmail.Text;

           ///////// item_Search();

           /////////////////// refreshOrgs(sender, e);

        try
        {

            //if (!IsPostBack)
            //{
                messages.bidlevel = 0;
                //switch (Logins.password)
                //{
                //    case "tzally123":
                //        messages.buyerID = 6;

                //        break;
                //    case "zalman123":
                //        messages.buyerID = 1;

                //        break;

                //    case "eli123":
                //        messages.buyerID = 2;

                //        break;

                //    default:

                //        BLCustomer cust = new BLCustomer(messages.buyerID);

                //        messages.cust = cust;

                //        break;

                //}

                if (Application["cust"] == null)
                {

                    BLCustomer cust = new BLCustomer(0);

                  ///  messages.cust = cust;
                    Application["cust"] = cust;

                    //Response.Redirect("Login.aspx?login=org");
                }
                else{

                    //BLCustomer cust = new BLCustomer(1);

                    //messages.cust = cust;
                }

                imgLogo.ImageUrl = "images/" +    ( (BLCustomer)   Application["cust"] ).Organization.Logo;

            ///////////    imgLogo.ImageUrl = "images/"+ messages.orgs_.Logo;

                //}

                int credits_ = items().Credits;
                //HtmlGenericControl pOtherViews = (HtmlGenericControl)Page.Master.FindControl("pOtherViews");
                //pOtherViews.InnerHtml = "you have a total of " + credits_ + " credits ";

                    //if (  drplstOrgs.SelectedIndex==0)

                  //////      if (BLCustomer.buyerID == 0)
                  //////{
                  //////    pOtherViews.InnerHtml = "";
                  //////}

                string status = "approved";
              ///////////////  int origid =   BLOrganization.orgID ;

               // origid = ((BLCustomer)Application["cust"]).Organization.ID;
                origid =orgs().orgID;

                Application["origid"]=origid;

                //DataSet ds = messages.getOrgs("S", "get_Orgs", origid, status);

              /////////  origid = 0;

            BLCustomer cst =  (BLCustomer) custs();
            DataSet ds = orgs().GetOrgList(ref  cst, "S", "get_Orgs", origid, status);

                custs_ = cst;

                int indx = drplstOrgs.SelectedIndex;//!= -1 ? drplstOrgs.SelectedIndex :0 ;

                if (indx >= 0) { origid = Convert.ToInt16(drplstOrgs.SelectedValue.ToString()); }

              if (!IsPostBack)
              {

                  drplstOrgs.DataSource = ds;
                  drplstOrgs.DataValueField = "orgID";
                  drplstOrgs.DataTextField = "orgTitle";
                  drplstOrgs.DataBind();

                  drplstOrgs.Items.Insert(0, "All Orginazations");
              }

              ///  if (indx != -1) drplstOrgs.SelectedIndex = indx;

                if (origid != 0  )
                {
                    ///////drplstOrgs.Items.FindByValue(BLOrganization.orgID.ToString()).Selected = true;

                    drplstOrgs.Items.FindByValue(  orgs().orgID.ToString()).Selected = true;

                }

                else
                {
                    if (indx >= 0) { drplstOrgs.SelectedIndex = indx; }

                    else { drplstOrgs.SelectedIndex = 0; }

                }

                //if (!IsPostBack  )
                //{

                    //////////////if (origid != 0 )
                    //////////////{
                    //////////////    drplstOrgs.Items.FindByValue(origid.ToString()).Selected = true;
                    //////////////}
                    //////////////else
                    //////////////{
                    //////////////    if (indx == -1) drplstOrgs.SelectedIndex = 0;
                    //////////////}
                //////}

                ////////if (origid != 0)
                ////////{
                ////////    drplstOrgs.Items.FindByValue(origid.ToString()).Selected = true;
                ////////}
                ////////else { drplstOrgs.SelectedIndex = 0; }

                //if (messages.DataTable != null)
                //{
                ContentPlaceHolder MainContent = (ContentPlaceHolder)Page.Master.FindControl("Body");

                DropDownList drplstSort = (DropDownList)(MainContent.FindControl("drplstSort"));

             //   UserControl pageing = (UserControl)(MainContent.FindControl("orgProducts2")).FindControl("pageing1");

                UserControl pageing = (UserControl)MainContent.FindControl("pageing1");

                DataList dtalstItems = (DataList)MainContent.FindControl("orgProducts2").FindControl("dtalstItems");

                HtmlContainerControl dvPageing = (HtmlContainerControl)MainContent.FindControl("dvPageing");

                if (dvPageing == null || dvPageing.Visible == false)
                {

                }

                else
                {

                    DropDownList drplstPageSize = (DropDownList)pageing.FindControl("drplstPageSize");

                   // items().pager = 1;
                    //items().rowlimit = Convert.ToInt16(drplstPageSize.SelectedValue.ToString());  ///15;

                    //int rowLimit = items().rowlimit;
                    //int page = items().pager * rowLimit;

                      items().pager = 1;

                     items().rowlimit = Convert.ToInt16(drplstPageSize.SelectedValue.ToString());  ///15;

                    int rowLimit = items().rowlimit;
                    int page = items().pager * rowLimit;

                    ////DataList dtalstItems = (DataList)(MainContent.FindControl("orgProducts2")).FindControl("dtalstItems");

                    ////////////////////  Label CurrentPage = (Label)(MainContent.FindControl("orgProducts2")).FindControl("CurrentPage");

           ///////////         Label CurrentPage = (Label)pageing.FindControl("CurrentPage");

                    // CurrentPage.Text = page.ToString();// "1";

                    ///////////////CurrentPage.Text = items().pager.ToString();
                    int pageNext = items().pager + 1;

                    //items().pager += 1;

                    /////////////// DataTable dataTable = messages.DataTable != null ? messages.DataTable : null;      //              ((DataTable)dtalstItems.DataSource);

                    //  dtalstItems.DataSource = messages.DataTable;

                    ////  dataTable=  messages.DataTable;
                    /////  DataTable datatable = dataTable;

                    //tblProductsCopy.ImportRow(tblProducts.Rows[i]);

                    //int rowLimit = items().rowlimit;
                    //int page = items().pager * rowLimit;

                    ////row = MyDataTable.NewRow();
                    ////row.ItemArray = OtherDataTableDataRow.ItemArray;
                    ////MyDataTable.Rows.Add(row);

                    //while (dataTable.Rows.Count > page  )

                    //       dataTable.Rows[dataTable.Rows.Count - 1].Delete();

                    //////////////////DataTable datatable = new DataTable();
                    //////////////////datatable = messages.DataTable.Clone();

                    //////////////////for (int x = page; x < page + rowLimit; x++)
                    //////////////////{
                    //////////////////    //if (x < page || x > page + rowLimit)
                    //////////////////    //{

                    //////////////////    datatable.ImportRow(messages.DataTable.Rows[x]);

                    //////////////////    ////////// dataTable.Rows[x].Delete();
                    //////////////////    //}
                    //////////////////}

                    ///////  datatable = dataTable.AsEnumerable().Skip(page).Take(rowLimit).CopyToDataTable();

                    //////////////////////////DataView dv = new DataView();
                    //////////////////////////datatable.TableName = "table1";

                    //////////////////////////dv.Table = datatable;

                    //////////////////////////dtalstItems.DataSource = dv; // datatable;// messages.DataTable;
                    /////////////////////// messages.DataTable=null;
                    //////////////////////////////////////////////////////////////////////////////////dtalstItems.DataBind();

                    ///// messages.datalist= dtalstItems ;

                    //}

                    //////////////int totPages = messages.DataTable.Rows.Count / rowLimit;
                    int totPagesRem = dtalstItems.Items.Count % rowLimit;
                    ////////if (totPagesRem > 0) { totPages += 1; }

                    //////////////////////Label TotalPages = (Label)(MainContent.FindControl("orgProducts2")).FindControl("TotalPages");

                    Label TotalPages = (Label)pageing.FindControl("TotalPages");
                    ///    TextBox TotalPages = (TextBox)(MainContent.FindControl("TotalPages"));

                    //////////////////TotalPages.Text = totPages.ToString();
                    ///////////////////////////////////////////////////////itemSearch(sender, e);

                }

            //   m_bidPennySec
            //m_bidPennySecRepeat
            //bidPennySec
                cartitems.Text = items().cartcount.ToString();// messages.cartcount.ToString();

            //Code for the Countdown timer
            //Code for the Countdown timer
            DateTime dtNow = new DateTime();
            /// dtNow = DateTime.Now.AddMilliseconds( -  messages.pennysec );

            dtNow = DateTime.Now.AddMilliseconds(0 );

            DateTime dtFuture = new DateTime();//  (messages.bidEndTime.Year, messages.bidEndTime.Month, messages.bidEndTime.Day, messages.bidEndTime.Minute, messages.bidEndTime.Second, messages.bidEndTime.Millisecond);//        dtNow.Year, dtNow.Month, dtNow.Day, 23, 59, 59);
            DateTime dtFuture1 = new DateTime();
            DateTime dtFuture2 = new DateTime();
            DateTime dtFuture3 = new DateTime();

            //DateTime dtFuture = new DateTime(2009, 10, 12, 14, 59, 59);

            //dtFuture1 = messages.bidEndTime1;
            //dtFuture2 = messages.bidEndTime2;
            //dtFuture3 = messages.bidEndTime3;

            //dtFuture = messages.bidEndTime;

            //TimeSpan ts = new TimeSpan();// dtFuture.Subtract(dtNow);
            //ts = dtFuture.Subtract(dtNow);
            // amount = (long)ts.TotalMilliseconds;

            ////////////amount = messages.amount_;/// calcdatespan(dtFuture);
            //////////////////// if (amount <= 378488)
            ////////////////////{

            ////////////////////    switch (messages.bidlevel)
            ////////////////////    {
            ////////////////////        case 0 :

            ////////////////////            messages.bidlevel = 1;

            ////////////////////            messages.bidEndTime = messages.bidEndTime1;

            ////////////////////            amount = calcdatespan(messages.bidEndTime);
            ////////////////////            break;
            ////////////////////        case 1:

            ////////////////////            messages.bidlevel = 2;

            ////////////////////            messages.bidEndTime = messages.bidEndTime2;
            ////////////////////            amount = calcdatespan(messages.bidEndTime);
            ////////////////////            break;

            ////////////////////        case 2:

            ////////////////////            messages.bidlevel = 3;

            ////////////////////            messages.bidEndTime = messages.bidEndTime3;
            ////////////////////            amount = calcdatespan(messages.bidEndTime);
            ////////////////////            break;
            ////////////////////        case 3:

            ////////////////////            break;
            ////////////////////    }

            ////////////////////}

            ////if (messages.bidEndTime.ToString() != messages.bidEndTime1.ToString())
            ////{
            ////    messages.bidEndTime = messages.bidEndTime1;
            ////}

            ////else
            ////{

            ////    if (messages.bidEndTime.ToString() != messages.bidEndTime2.ToString())
            ////    {
            ////        messages.bidEndTime = messages.bidEndTime2;
            ////    }
            ////    else
            ////    {

            ////        if (messages.bidEndTime.ToString() != messages.bidEndTime3.ToString())
            ////        {
            ////            messages.bidEndTime = messages.bidEndTime3;
            ////        }

            ////    }
            ////}

            ///////////////   dtFuture = messages.bidEndTime;

            //////////////////// TimeSpan ts = new TimeSpan();// dtFuture.Subtract(dtNow);
            ////////////ts = dtFuture.Subtract(dtNow);
            ////////////long amount = (long)ts.TotalMilliseconds;

            //ts = dtFuture1.Subtract(dtNow);
            //long amount1 = (long)ts.TotalMilliseconds;

            //ts = dtFuture2.Subtract(dtNow);
            //long amount2 = (long)ts.TotalMilliseconds;

            //ts = dtFuture3.Subtract(dtNow);
            //long amount3 = (long)ts.TotalMilliseconds;

            //if (amount>0)
            DataSet dss = new DataSet();
            String parm = "Z";
            string commandtext = "get_Items";
            int id = 0;
            int orgid =  items().AuctionOrgID ;
            int catid = 0;
            int itemid = 0;
             status = "";
            String auctiontype = "";
            int auctionid = items().AuctionID;
            dss = item().GetAuctionItemt(item(), parm, commandtext, custs().ID, orgid, catid, itemid, status, auctiontype, auctionid);

            DataRow dr = dss.Tables[0].Rows[0];

              dtFuture = Convert.ToDateTime(dr["endTime"]);

            amount = calcdatespan(dtFuture);
            time(amount);

        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message);
        }
    }
Exemple #19
0
    protected void itemSearch(Object sender, EventArgs e)
    {
        items().pager = 0;
          /////items().rowlimit = 10 ;

        string sortr = "";

          //////////  if (messages.dvorgProducts != null)
          //////////       sortr = messages.dvorgProducts.Sort.ToString() ;

          //////////  String sorter = drplstSort.SelectedValue.ToString();

          //////////if (  messages.dvorgProducts!=null)
          //////////  messages.dvorgProducts.Sort =    sorter ;

        // orgItems   obj = new orgItems();

        //foreach (Control c in Page.Controls)

        //{
        //    string nm = c.ID;
        //    foreach (Control cc in c.Controls)
        //    {
        //        string nmc = cc.ID;

        //        foreach (Control ccc in cc.Controls)
        //        {
        //            string nmcc = ccc.ID;

        //        }

        //    }
        //}
          ContentPlaceHolder MainContent = (ContentPlaceHolder)Page.Master.FindControl("Body");
          DropDownList drplstOrgs = (DropDownList)MainContent.FindControl("drplstOrgs");
          DataList dtalstItems = (DataList)(MainContent.FindControl("orgProducts2")).FindControl("dtalstItems");
           UserControl category1 = (UserControl)MainContent.FindControl("category1");

           ListBox lstcat = (ListBox)(MainContent.FindControl("category1")).FindControl("lstcat");

          TextBox txtPriceStart = (TextBox)category1.FindControl("txtPriceStart");

          TextBox txtPriceEnd = (TextBox)category1.FindControl("txtPriceEnd");

          Decimal PriceStart = txtPriceStart != null && txtPriceStart.Text.Trim() != "" ? Convert.ToDecimal(txtPriceStart.Text) : 0;

          Decimal PriceEnd = txtPriceEnd != null && txtPriceEnd.Text.Trim() != "" ? Convert.ToDecimal(txtPriceEnd.Text) : 0;

        //[get_Categories]

        //    @opt varchar(1),
        //    @catID  int ,
        //    @catName varchar(50

          ////////////////////if (lstcat != null && lstcat.SelectedValue.ToString().Trim() !="")
          ////////////////////{
          ////////////////////    messages.catID = Convert.ToInt16( lstcat.SelectedValue.ToString());

          //////////////////// ((BLCustomer)messages.cust).Organization.Orgitems.CatID=   Convert.ToInt16(lstcat.SelectedValue.ToString());
          ////////////////////}

          //if (lstcat != null)
          //{
          //    messages.orgID = drplstOrgs.SelectedValue.ToString() == "" ? 0 : Convert.ToInt16(drplstOrgs.SelectedValue.ToString() == "");

          //}

          int orgid =   orgs().orgID;// ((BLCustomer)messages.cust).Organization.ID;
          int catid =  orgs().Orgitems.CatID;       // ((BLCustomer)messages.cust).Organization.Orgitems.CatID; /// messages.catID;

          DataSet ds = new DataSet();

          String param = "";

           ///   ds =            messages.UpdateDonate("I", "get_Items", 0, catid, orgid, txtItemSearch.Text.Trim());

          if (items() == null || orgs().Orgitems.Items ==null  || orgs().Orgitems.Items.Tables.Count == 0 || orgs().Orgitems.Items.Tables[0].Rows.Count == 0)

          { param = "Q"; }
          else { param = "J"; }
          BLCustomer cst = (BLCustomer)custs();
          ds = items().GetItemsList(ref cst, param, "get_Items", 0, orgid, catid, "");
          custs_ = cst;

        if (ds!=null)

        {
          //DataView dv = new DataView((DataTable)dtalstItems.DataSource);
          DataView dv = new DataView(ds.Tables[0]);

         /////////////// items().rowlimit = items().rowlimit == 0 ? 15 : items().rowlimit;
          items().rowlimit = items().rowlimit == 0 ? 16 : items().rowlimit;

          items().pager = items().pager == 0 ? 1 : items().pager;

         int rowLimit = items().rowlimit;
         int page = items().pager * rowLimit;
        ///////////  items().pager += 1;

          if (ds.Tables.Count > 0)
          {

          if (PriceEnd > 0 && PriceEnd > PriceStart ||  ( filters != null && filters != ""))
          {
              if (PriceEnd > 0 && PriceEnd > PriceStart && ( filters != null && filters != ""))
              {
                  dv.RowFilter = "Price >= " + PriceStart + "    and Price <=" + PriceEnd + " and " + filters;
              }
              else
              {
                  if (PriceEnd > 0 && PriceEnd > PriceStart)
                  {
                      dv.RowFilter = "Price >= " + PriceStart + "    and Price <=" + PriceEnd;
                  }
                  else { dv.RowFilter = filters; }
              }
          }

          dv.Sort = drplstSort.SelectedValue.ToString();

          /// ((BLCustomer)messages.cust).Organization.Orgitems.ItemsDV = dv;

          DataTable dataTable = dv.ToTable();

          items().dataTable = dataTable;

          int totPages = dataTable.Rows.Count / rowLimit;
          int totPagesRem = dataTable.Rows.Count % rowLimit;

          items().rempage = totPagesRem;

          items().totpage = totPagesRem > 0 && dataTable.Rows.Count >= rowLimit ? totPages + 1 : totPages;

          //////////////////    int totPagesRemAll = messages.DataTable.Rows.Count % rowLimit;

          UserControl pageing1 = (UserControl)MainContent.FindControl("pageing1");

          /////////////////////////////    Label CurrentPage = (Label)pageing1.FindControl("CurrentPage");

          Label TotalPages = (Label)pageing1.FindControl("TotalPages");

          DropDownList drplstCPage = (DropDownList)pageing1.FindControl("drplstCPage");

          ////////////////////CurrentPage.Text = items().pager.ToString();

          TotalPages.Text = totPages.ToString();

          totPages = totPagesRem > 0 && dataTable.Rows.Count>0 ? totPages + 1 : totPages;

          drplstCPage.Items.Clear();
          for (int pg = 1; pg <= totPages; pg++)
          {
              ListItem pages = new ListItem();
              pages.Value = pg.ToString();

              drplstCPage.Items.Add(pages);

          }

          //////////////////////////////////////////////////////////////////    drplstCPage.SelectedIndex = items().pager - 1;

          if (dataTable.Rows.Count > 0)
          {

              //////////////////  messages.DataTable = dataTable;
              //////if (ds.Tables[0].Rows.Count>0)
              //////    messages.DataTable = dataTable;

              if (dataTable.Rows.Count > page)
              {

                  dataTable = dataTable.AsEnumerable().Skip(page).Take(rowLimit).CopyToDataTable();
                  //while (dataTable.Rows.Count > rowLimit)
                  //    dataTable.Rows[dataTable.Rows.Count - 1].Delete();
              }
          }
              DataView dvv = new DataView();
              dataTable.TableName = "table1";

              dvv.Table = dataTable;
              dtalstItems.DataSource = dvv;// dataTable; /// messages.dvorgProducts;
              dtalstItems.DataBind();

          }
          }
    }
Exemple #20
0
    protected void loads()
    {
        DataView dv;

        int orgid = Convert.ToInt16(messages.orgID);
        int catid = 0;// Convert.ToInt16(messages.catID);
        orgid = 12;

        if (messages.dvorgProducts != null)

        { dv = messages.dvorgProducts; }

        else
        {
            DataSet ds = new DataSet();

            ///////// ds   =     UpdateDonate("Q", "get_Items", 0, catid, orgid, "");

            //////  ds = UpdateDonate("Q", "get_Items", 0, catid, orgid, "");

            BLOrganization org = new BLOrganization();

            org.Orgitems.OrgID = orgid;

            org.Orgitems.CatID = catid;

            BLCustomer cst = (BLCustomer)custs();
            ds = items().GetItemsList(ref cst, "C", "get_Items", custs().ID, catid, orgid, "");
            custs_ = cst;

            ///  ds = BLItems.o..UpdateDonate("Q", "get_Items", 0, catid, orgid, "");

            ///  ds = BLItems.GetItemsList("Q", "get_Items", 0, catid, orgid, "");

            //    BLItems Itemss = new BLItems();

            //BLOrganization.

            ///// Itemss.Items = Itemss.UpdateDonate(parm, commandtext, id, orgid, catid, status);
            //  return Itemss.Items;

            //// grdvSubGmach.AutoGenerateColumns = false;
            ///////  items().rowlimit = 15;

            dv = new DataView(ds.Tables[0]);
        }
        int rowLimit = items().rowlimit; ;

        // dv.RowFilter = "";
        DataTable dataTable = dv.ToTable();

        while (dataTable.Rows.Count > rowLimit)
            dataTable.Rows[dataTable.Rows.Count - 1].Delete();

        ///   dataTable = dataTable.AsEnumerable().Skip(0).Take(50).CopyToDataTable();

        //  return dataTable;

        dataTable.TableName = "table1";

        DataView dvv = new DataView();

        dvv.Table = dataTable;

        dtalstItems.DataSource = dvv;// dataTable;// ds;

        dtalstItems.DataBind();
    }
Exemple #21
0
    protected void items_Search(Object sender, EventArgs e)
    {
        /// DataSet ds = UpdateDonate("R", "get_Categories", 0, "");
        ///
        BLCustomer cst = (BLCustomer)custs();
        DataSet ds = orgs().Category.GetCatList(ref cst,"R", "get_Categories", 0, "");
        custs_ = cst;

        //lstcatsub1.Visible = false;
        //lstcatsub2.Visible = false;
        //lstcatsub3.Visible = false;
         ContentPlaceHolder MainContent = (ContentPlaceHolder)Page.Master.FindControl("Body");
         UserControl category1 = (UserControl)MainContent.FindControl("category1");
        ListBox lstcat = (ListBox)category1.FindControl("lstcat");
        lstcat.DataSource = ds;
        lstcat.DataBind();

        lstcat.Items.Insert(0, "All Categories");

        HtmlGenericControl dvCatsGen = (HtmlGenericControl)this.FindControl("dvCatsGen");

        dvCatsGen.Style.Add("visibility", "hidden");

        int ggg = ((ListBox)sender).SelectedIndex >= 0 ? ((ListBox)sender).SelectedIndex : 0;

        int cat_id =   Convert.ToInt16(lstvCatGeneral.Items[ggg].Value);

        int org_id = orgs().ID;// messages.orgs_.ID;

           /// messages.orgs_.Orgitems.CatID= cat_id;

        items().CatID = cat_id;

        item_Searchs(org_id, cat_id);
    }
Exemple #22
0
    protected void refreshCat(object sender, EventArgs e)
    {
        BLCustomer cst = (BLCustomer)custs();
            /////DataSet ds = BLCategory.GetCatList(ref  cst, "R", "get_Categories", 0, "");
            DataSet ds = orgs().Category.GetCatList(ref  cst, "R", "get_Categories", 0, "");

        custs_=cst;

            lstcat.DataSource = ds;
            lstcat.DataBind();

            lstcat.Items.Insert(0, "All Categories");
    }
Exemple #23
0
    protected void subCatAction(Object sender, EventArgs e)
    {
        int subcat = 0;
        subcat = items().CatID;// BLItems.catid;
        BLCustomer cst = (BLCustomer)custs();
        DataSet ds = orgs().Category.GetCatList(ref cst, "S", "get_Categories", subcat, "");

        custs_ = cst;

         //////////////////   HtmlInputText hc = (HtmlInputText)this.FindControl("lisub");
         //   if (messages.cnt > 1) { hc.Value += " > "; }

        //messages.arCats[counter] = lb.SelectedItem.ToString() + " ";
        //messages.address += lb.SelectedItem.ToString() + " ";

        //////////////////////    hc.Value =   messages.arCats.ToString() ; //messages.address;

        //lbn.DataSource = ds; ;
        //lbn.DataBind();

        lstcat.DataSource = ds;
        lstcat.DataBind();

        int orgid = Convert.ToInt16(orgs().ID);
           // int catid = Convert.ToInt16(messages.subCat);

          cst.Organization.Orgitems.CatID = subcat;
           /// BLCustomer cst = custs();
           ///

          dst = items().GetItemsList(ref cst, "Q", "get_Items", custs().ID, orgid, subcat, "");

        custs_ = cst;

         ////DataView dv = new DataView(dst.Tables[0]);

          ///   messages.dvorgProducts = dv;

        ContentPlaceHolder MainContent = (ContentPlaceHolder)Page.Master.FindControl("Body");

         DataList dtalstItems = (DataList)(MainContent.FindControl("orgProducts2")).FindControl("dtalstItems");

        /// Repeater rptBreadCrumbs = (Repeater)(MainContent.FindControl("orgProducts2")).FindControl("rptBreadCrumbs");

          Repeater rptBreadCrumbs = (Repeater) MainContent.FindControl("rptBreadCrumbs");

         //////dtalstItems.DataSource = dv;
         ////// dtalstItems.DataBind();

          rptBreadCrumbs.DataSource = items().CatbreadCrumbs;// messages.orgs_.Orgitems.CatbreadCrumbs;
          rptBreadCrumbs.DataBind();

         //    DataTable dataTable = dv.ToTable();

         DataView dv = new DataView(dst.Tables[0]);

         DataTable dataTable = dv.ToTable();

         items().pager = 1;

         int rowLimit = items().rowlimit;
         int page = items().pager * rowLimit;
        // items().pager += 1;

             String   filters = items().Live;
         if (dst.Tables.Count > 0)
         {

             Decimal PriceEnd = txtPriceEnd != null && txtPriceEnd.Text.Trim() != "" ? Convert.ToDecimal(txtPriceEnd.Text) : 0;
             Decimal PriceStart = txtPriceStart != null && txtPriceStart.Text.Trim() != "" ? Convert.ToDecimal(txtPriceStart.Text) : 0;

             if (PriceEnd > 0 && PriceEnd > PriceStart)
             {
                 dv.RowFilter = "Price >=" + PriceStart + "   and Price <= " + PriceEnd;
                 if(filters.Trim()!=""){  dv.RowFilter +=  " and " + filters;}
             }

          ///   if (PriceEnd > 0 && PriceEnd > PriceStart ||  ( filters != null && filters != ""))

           //      if (PriceEnd > 0 && PriceEnd > PriceStart &&   ( filters != null && filters != ""))

        //          dv.RowFilter = "Price >= " + PriceStart + "    and Price <=" + PriceEnd;

                       //  if(filters.Trim()!=""){  dv.RowFilter +=  " and " + filters;}

             else { dv.RowFilter = filters; }
            ////filters = " Live = " + "'BID'";
            ////   filters = " Live = " + "'Count Down'";

                 //else { dv.RowFilter = filters; }

             DropDownList drplstSort = (DropDownList)MainContent.FindControl("drplstSort");
             dv.Sort = drplstSort.SelectedValue.ToString();

             /// ((BLCustomer)messages.cust).Organization.Orgitems.ItemsDV = dv;

             items().dataTable = dataTable;

             int totPages = dataTable.Rows.Count / rowLimit;
             int totPagesRem = dataTable.Rows.Count % rowLimit;

             items().rempage = totPagesRem;

             items().totpage = totPagesRem > 0 ? totPages + 1 : totPages;

             //////////////////    int totPagesRemAll = messages.DataTable.Rows.Count % rowLimit;

             UserControl pageing1 = (UserControl)MainContent.FindControl("pageing1");

          /////////////////   Label CurrentPage = (Label)pageing1.FindControl("CurrentPage");

          Label TotalPages = (Label)pageing1.FindControl("TotalPages");

             DropDownList drplstCPage = (DropDownList)pageing1.FindControl("drplstCPage");

             ////CurrentPage.Text = items().pager.ToString();

        TotalPages.Text = totPages.ToString();

             totPages = totPagesRem > 0 ? totPages + 1 : totPages;

             drplstCPage.Items.Clear();
             for (int pg = 1; pg <= totPages; pg++)
             {
                 ListItem pages = new ListItem();
                 pages.Value = pg.ToString();

                 drplstCPage.Items.Add(pages);

             }

             //////////////////////////////////////////////////////////////////    drplstCPage.SelectedIndex = items().pager - 1;

             if (dataTable.Rows.Count > 0 && dataTable.Rows.Count > page)
             {

                 //////////////////  messages.DataTable = dataTable;
                 //////if (ds.Tables[0].Rows.Count>0)
                 //////    messages.DataTable = dataTable;

                 dataTable = dataTable.AsEnumerable().Skip(page).Take(rowLimit).CopyToDataTable();
                 //while (dataTable.Rows.Count > rowLimit)
                 //    dataTable.Rows[dataTable.Rows.Count - 1].Delete();
             }

                 DataView dvv = new DataView();
                 dataTable.TableName = "table1";

                 dvv.Table = dataTable;
                 dtalstItems.DataSource = dvv;// dataTable; /// messages.dvorgProducts;
                 dtalstItems.DataBind();

         }
    }
Exemple #24
0
 public Customer ReadCustomer(int id, ref List <string> errors)
 {
     return(BLCustomer.ReadCustomer(id, ref errors));
 }
Exemple #25
0
    public static DataSet fillcarts(ref BLCustomer cst)
    {
        BLOrganization orgs = (BLOrganization)cst.Organization;

            DataSet ds = new DataSet();
         ds=  orgs.ShoppingCart.fillCart(orgs);

         return ds;
    }
Exemple #26
0
    // get_Bids(string commandName, string prm, int itemAuctionID, int buyerID, DateTime biddate,
    // decimal bidamount,  int credits,
    //    string soldFixedBid, int fee_per_bid, string auctionType)
    //{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Application["cust"] == null)
         {

             BLCustomer cust = new BLCustomer(0);

             Application["cust"] = cust;

         }

         string qry = Request.QueryString != null && Request.QueryString.Count > 0 ? Request.QueryString[0].ToString() : "";

         int auctionid_ = qry == null || qry == "" ? 0 : (int)Convert.ToInt16(qry);

         auction_id = auctionid_;

         //items().Item.auctionID = auctionid_;
         //org_name = BLOrganization.orgTitle;

         //if (messages.orgs_.ID == null || messages.orgs_.ID == 0)
         //{
         //    items().GetOrgbyAuctionID(auctionid_);

         //}

         items().AuctionID = auctionid_;
         item().auctionID = auctionid_;
         org_name = orgs().orgTitle;

         //if (messages.orgs_.ID == null || messages.orgs_.ID == 0)
         //{
        int orgid=   items().GetOrgbyAuctionID(items(), auctionid_);

        items().AuctionOrgID = orgid;

         //}

           //  DateTime amount_;

           //  Auction a = new Auction();
           //  //#region "Landing"
           //long amounter;
           //Thread oThread = new Thread(new ThreadStart( this.timeing()));

         //// Start the thread
         //oThread.Start();

         //// Spin for a while waiting for the started thread to become
         //// alive:
         //while (!oThread.IsAlive) ;

         //// Put the Main thread to sleep for 1 millisecond to allow oThread
         //// to do some work:
         //Thread.Sleep(1);

         //// Request that oThread be stopped
         //oThread.Abort();

         buyer_names = custs().CustName;// dr["buyer_name"].ToString();
         BuyerID = custs().buyerID;
         int buyerid = BuyerID;// messages.cust.ID;
         string commandName = "get_Credits";
         string prm = "E";

         ////////Decimal credits_ = r.get_Credits(commandName, prm, buyerid, 0);

         ////////((BLCustomer)messages.cust).Credits = r.get_Credits(commandName, prm, buyerid, 0);

         int credits_ = Convert.ToInt16(   custs().Credits);// messages.credits;

        //string  prm = "E";

        //Decimal credtsowned = r.get_Bids("get_Bids", prm, messages.auctionID, messages.buyerID, DateTime.Today, 0, 0, "", 0, "");

           /////////// messages.credits = Convert.ToInt32(credits_);

         bidsLog( sender,     e);

          //   items().rowlimit = 4;

         int catid = 0;

         orgid = orgs().ID;// messages.orgs_.ID;// Convert.ToInt16(drplstOrgs.SelectedValue.ToString());

        /// orgid = messages.orgs_.ID;//  12;
         //messages.itemID = messages.orgs_.Orgitems.Item.ID;
         //catid = messages.orgs_.Orgitems.CatID;// 12;
          itemID = item().ID;
         catid = items().CatID;// 12;

         DataView dv;
         DataSet dss = new DataSet();

         //  categoryProduct

           ////// dss =  messages.getItems("S", "get_Items", 0, catid, orgid, "");
           // dss = messages.getItems("Q", "get_Items", 0, catid, orgid, "");

         BLCustomer cst = custs();

        // dss = BLItems.GetItemsList( ref  cst,    "V", "get_Items", 0, orgid, catid, "");

         dss = items().GetItemsList(ref  cst, "V", "get_Items", 0, orgid, catid, "");

        custs_ = cst;

         dv = new DataView(dss.Tables[0]);

         int rowLimit = 4;

         // dv.RowFilter = "";

         ///   dataTable = dataTable.AsEnumerable().Skip(0).Take(50).CopyToDataTable();

         //  return dataTable;

         ContentPlaceHolder MainContent = (ContentPlaceHolder)Page.Master.FindControl("Body");

         DataList dtalstItems = (DataList)(MainContent.FindControl("orgProducts2")).FindControl("dtalstItems");

        ////////////HtmlContainerControl dvPageing = (HtmlContainerControl)(MainContent.FindControl("dvPageing");

        /// HtmlContainerControl dvPageing = (HtmlContainerControl)(MainContent.FindControl("orgProducts2")).FindControl("dvPageing");
        //////// dvPageing.Visible = false;

         ////////////////////UserControl category1 = (UserControl)Page.FindControl("category1");
         ////////////////////DataList catlstbx = (DataList)category1.FindControl("catlstbx");

         ////////////////////TextBox txtPriceStart = (TextBox)category1.FindControl("txtPriceStart");
         ////////////////////TextBox txtPriceEnd = (TextBox)category1.FindControl("txtPriceEnd");

         //String txtPriceStarts = txtPriceStart.Text;
         //String txtPriceEnds = txtPriceEnd.Text;
         ////String filter = catlstbx.SelectedItem.ToString() + " "; ;

         ////dv.RowFilter = filter;
         ////dv.RowFilter = filter + "'cartPrice' >  txtPriceStarts and 'cartPrice' < txtPriceEnds ";

         //UserControl uc = (UserControl)this.FindControl("orgProducts2");

         //DataList dtalstItems = (DataList)uc.FindControl("dtalstItems");

         DataTable dataTable = dv.ToTable();

         DataTable datatable = new DataTable();
         datatable = dataTable.Clone();

         for (int x = 0; x < 4   ; x++)
         {
             //if (x < page || x > page + rowLimit)
             //{

             if (dataTable.Rows.Count>x)
             {
             datatable.ImportRow(dataTable.Rows[x]);
             }
             ////////// dataTable.Rows[x].Delete();
             //}
         }

         ////while (dataTable.Rows.Count > rowLimit)
         ////    dataTable.Rows[dataTable.Rows.Count - 1].Delete();

         ///   dataTable = dataTable.AsEnumerable().Skip(0).Take(50).CopyToDataTable();

         //  return dataTable;

         dtalstItems.DataSource = datatable;// ds;

         dtalstItems.DataBind();

         orgs().auctionOrgID = items().AuctionOrgID;

        ////int credits = messages.credits ;

           ///  ContentPlaceHolder MainContent = (ContentPlaceHolder)Page.Master.FindControl("Body");
         ////////HtmlGenericControl pOtherViews = (HtmlGenericControl)MainContent.FindControl("pOtherViews");
         ////////pOtherViews.InnerHtml = "you have a total of " + credits_ + " credits ";

         HtmlTextArea txtarKnow = (HtmlTextArea)MainContent.FindControl("txtarKnow");

         txtarKnow.Value = orgs().Know;

         if (!IsPostBack)
         {

        //HtmlContainerControl hdnTimer = (HtmlContainerControl)this.FindControl("hdnTimer.ClientID");

        //HtmlContainerControl hdnTimer1 = (HtmlContainerControl)this.FindControl("hdnTimer1");

        //HtmlContainerControl hdnTimer2 = (HtmlContainerControl)this.FindControl("hdnTimer2");

        //HtmlContainerControl hdnTimer3 = (HtmlContainerControl)this.FindControl("hdnTimer3");

        //HtmlContainerControl dvAuction = (HtmlContainerControl)this.FindControl("dvAuction");

        //HtmlContainerControl dvBuyer = (HtmlContainerControl)MainContent.FindControl("dvBuyer");
        //HtmlContainerControl hdnamount = (HtmlContainerControl)this.FindControl("hdnamount");

        //if (hdnTimer != null)
        //{
        //    //dvAuction.InnerHtml = messages.orgs_.Orgitems.Item.auctionID.ToString();

        //    //dvBuyer.InnerHtml = messages.cust.ID.ToString();
        //    hdnamount.InnerText = messages.amount_.ToString();

        //    hdnTimer.InnerHtml = messages.amount_.ToString();
            //hdnTimer1.InnerHtml =  messages.amount1.ToString();
            //hdnTimer2.InnerHtml =  messages.amount2.ToString();

            //hdnTimer3.InnerHtml =  messages.amount3.ToString();

        //}

             int aid = 0;
             int id = 0; int cid = 0;

             if (Request.QueryString != null && Request.QueryString.Count>=1)
             {

                 string query1 = ""; string query2 = ""; string query3 = "";

                 switch (Request.QueryString.Count)
                 {
                     case 1:
                         query1 = Request.QueryString[0] != null ? Request.QueryString[0] : "";
                         break;

                     case 2:
                       query1 = Request.QueryString[0] != null ? Request.QueryString[0] : "";

                        query2 = Request.QueryString[1] != null ? Request.QueryString[1] : "";
                         break;

                     case 3:
                         query1 = Request.QueryString[0] != null ? Request.QueryString[0] : "";

                          query2 = Request.QueryString[1] != null ? Request.QueryString[1] : "";
                         query3 = Request.QueryString[2] != null ? Request.QueryString[2] : "";
                         break;
                 }

             if (!string.IsNullOrEmpty(query1) && Int32.TryParse(query1, out aid))
             {
             items().AuctionOrgID  = aid;

                // messages.auctionID = Request.QueryString[0] != null && Request.QueryString.ToString() != "" ? Convert.ToInt16(Request.QueryString[0].ToString()) : 0;

             }

             if (!string.IsNullOrEmpty(query2) && Int32.TryParse(query2, out cid))
             {
                /// messages.itemID = Request.QueryString[1] != null && Request.QueryString[1].ToString() != "" ? Convert.ToInt16(Request.QueryString[1].ToString()) : 0;

                 /// ((BLCustomer)messages.cust).Organization.Orgitems = new BLItems();
               item().catID = cid;

             }
             if (!string.IsNullOrEmpty(query3) && Int32.TryParse(query3, out id))
             {
                 ///messages.itemID = Request.QueryString[1] != null && Request.QueryString[1].ToString() != "" ? Convert.ToInt16(Request.QueryString[1].ToString()) : 0;

                 /// ((BLCustomer)messages.cust).Organization.Orgitems = new BLItems();
                item().ID = id;

             }
             }

           //  messages.bidtype = "penny";
             ///////////////////////messages.buyerID = 6;
          //   messages.auctionID = 2;

             messages.orgLogo = "images/RZD029.jpg";

             /////// load();
             /////////// loadChildInformation();
             ///////////// Session["init"] = "init";

         }

         DataTable dt = new DataTable();

         DataSet ds = new DataSet();

        HtmlButton btnPreview = (HtmlButton)this.FindControl("btnPreview");

         ///////////////////   orgid = messages.cust.Organization.ID;// Convert.ToInt16(messages.orgID);
        //   catid = messages.blitem.catID;// Convert.ToInt16(messages.catID);
        //int   itemids = messages.blitem.ID;// Convert.ToInt16(messages.itemID);
        //      buyerid = messages.cust.ID;// mes

          catid = item().catID;// Convert.ToInt16(messages.catID);
          int itemids = item().ID;// Convert.ToInt16(messages.itemID);
          buyerid = custs().ID;// mes

        string bidtype =  "penny";

          /////////////////  int auctionid = messages.orgs_.Orgitems.auctionID;

        ds = UpdateDonate("Z", "get_Items", custs().ID, catid, orgid, itemids, "", bidtype, auction_id);

        if (ds.Tables.Count>0)
        {

        dt =  ds.Tables[0];

        DataRow dr = dt.Rows.Count > 0 ? dt.Rows[0] : null;

        if (dr != null) bidValues(dr);
        }
    }
Exemple #27
0
    public DataSet GetOrgList(ref BLCustomer cust,  String parm, string commandtext, int id, string status)
    {
        //// BLCustomer cust = (BLCustomer)messages.cust;

            DataSet ds = new DataSet();

            switch (parm)
            {
                case "S":

                    ds = cust.Organization.Orgitems.Items;

                    break;
                case "J":

                        ds = cust.Organization.Orgitems.Items;

                    break;
                case "I":

                    //  ds = cust.Organization.Orgitems.ItemsGeneralSearch;

                    ds = cust.Organization.Orgitems.Items;
                    break;

                case "A":

                    ds = cust.Organization.Orgitems.categories;

                    break;

            }
            if(parm!="J")
            ds = cust.Organization.UpdateOrgs(parm, commandtext, id, status);

            return ds;
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (custs() == null)
        {
            BLCustomer cust = new BLCustomer(0);
            Application["cust"] = cust;

        }
        string qry = Request.QueryString !=null  && Request.QueryString.Count>0 ?   Request.QueryString[0].ToString():  "" ;
        DataSet ds = new DataSet();
        String parm="Z";
             string commandtext="get_Items";
             int id = custs().ID;// 0;
        int orgid=0;
        int catid=0;
        int itemid =0;
        string status="";
        String auctiontype ="";
        int auctionid=     qry==null || qry == "" ?   0 :    (int) Convert.ToInt16 ( qry ) ;
        try
        {
        if (auctionid>0) {

         ///ds= BLItem.GetAuctionItemt( item(), parm,   commandtext,   id,   orgid,   catid,   itemid,   status,   auctiontype,   auctionid);
         ds = item().GetAuctionItemt(item(), parm, commandtext, id, orgid, catid, itemid, status, auctiontype, auctionid);

        DataRow dr = ds.Tables[0].Rows[0];

        String Live =  dr["Live"].ToString();

            DateTime dtFuture = Convert.ToDateTime(dr["endTime"]);

            DateTime dtNow = new DateTime();
            // dtNow = DateTime.Now.AddMilliseconds(-messages.pennysec);
            dtNow = DateTime.Now;
            TimeSpan ts = new TimeSpan();// dtFuture.Subtract(dtNow);
            ts = dtFuture.Subtract(dtNow);
            long amountTime = (long)ts.TotalMilliseconds;
            HtmlContainerControl amount = (HtmlContainerControl)this.FindControl("amount");
            amount.InnerText = amountTime.ToString();// messages.amount_.ToString();
            // return amount;

          String buyerName = dr["buyer_name"].ToString();

          String currentbidPrice = dr["currentbidPrice"].ToString();

        HtmlContainerControl buyer = (HtmlContainerControl)this.FindControl("buyer");
        buyer.InnerText = buyerName == null ? "" : buyerName.ToString();

        HtmlContainerControl price = (HtmlContainerControl)this.FindControl("price");
        price.InnerText = currentbidPrice.ToString();   //messages.currentBidAmount.ToString();

        HtmlContainerControl live = (HtmlContainerControl)this.FindControl("live");
        live.InnerText = Live.ToString();   //messages.currentBidAmount.ToString();
        }
        }
        catch (Exception) { }

        DataSet dss = new DataSet();
        //  DataTable dt = new DataTable();
        // dt = ds.Tables[0];
           /// dss = bidst("T",auctionid);
        dss = bidst("B", auctionid);
    }
Exemple #29
0
        public void CreateCustomerTest()
        {
            int      customer_id = 0;
            int      age         = 0;
            int      zip         = 0;
            char     gender      = 'T';
            int      income      = -1;
            int      children    = -1;
            string   degree      = "Elementary School Diploma";
            int      ownHouse    = -1;
            Customer customer;

            List <string> errors = new List <string>();

            BLCustomer.CreateCustomer(null, ref errors);
            Assert.AreEqual(1, errors.Count);
            AsynchLog.LogNow(errors);

            //customer_id = 0
            errors   = new List <string>();
            customer = new Customer(customer_id, "first", "last", "address1", "city1", "CA", 92037, 20,
                                    'M', "None", 80000, 2, "None", 1);
            BLCustomer.CreateCustomer(customer, ref errors);
            Assert.AreEqual(1, errors.Count);
            AsynchLog.LogNow(errors);

            //age = 0
            errors   = new List <string>();
            customer = new Customer(1, "first", "last", "address1", "city1", "CA", 92037, age,
                                    'M', "None", 80000, 2, "None", 1);
            BLCustomer.CreateCustomer(customer, ref errors);
            Assert.AreEqual(1, errors.Count);
            AsynchLog.LogNow(errors);

            //zip = 0
            errors   = new List <string>();
            customer = new Customer(1, "first", "last", "address1", "city1", "CA", zip, 20,
                                    'M', "None", 80000, 2, "None", 1);
            BLCustomer.CreateCustomer(customer, ref errors);
            Assert.AreEqual(1, errors.Count);
            AsynchLog.LogNow(errors);

            //gender = T
            errors   = new List <string>();
            customer = new Customer(1, "first", "last", "address1", "city1", "CA", 92037, 20,
                                    gender, "None", 80000, 2, "None", 1);
            BLCustomer.CreateCustomer(customer, ref errors);
            Assert.AreEqual(1, errors.Count);
            AsynchLog.LogNow(errors);

            //income = -1
            errors   = new List <string>();
            customer = new Customer(1, "first", "last", "address1", "city1", "CA", 92037, 20,
                                    'M', "None", income, 2, "None", 1);
            BLCustomer.CreateCustomer(customer, ref errors);
            Assert.AreEqual(1, errors.Count);
            AsynchLog.LogNow(errors);

            //children = -1
            errors   = new List <string>();
            customer = new Customer(1, "first", "last", "address1", "city1", "CA", 92037, 20,
                                    'M', "None", 80000, children, "None", 1);
            BLCustomer.CreateCustomer(customer, ref errors);
            Assert.AreEqual(1, errors.Count);
            AsynchLog.LogNow(errors);

            //degree = Elementary School Diploma
            errors   = new List <string>();
            customer = new Customer(1, "first", "last", "address1", "city1", "CA", 92037, 20,
                                    'M', "None", 80000, 2, degree, 1);
            BLCustomer.CreateCustomer(customer, ref errors);
            Assert.AreEqual(1, errors.Count);
            AsynchLog.LogNow(errors);

            //ownHouse = -1
            errors   = new List <string>();
            customer = new Customer(1, "first", "last", "address1", "city1", "CA", 92037, 20,
                                    'M', "None", 80000, 2, "None", ownHouse);
            BLCustomer.CreateCustomer(customer, ref errors);
            Assert.AreEqual(1, errors.Count);
            AsynchLog.LogNow(errors);
            //ownHouse = -1

            //all 8 errors
            errors   = new List <string>();
            customer = new Customer(customer_id, "first", "last", "address1", "city1", "CA", zip, age,
                                    gender, "None", income, children, degree, ownHouse);
            BLCustomer.CreateCustomer(customer, ref errors);
            Assert.AreEqual(8, errors.Count);
            AsynchLog.LogNow(errors);

            //no errors
            errors   = new List <string>();
            customer = new Customer(1, "first", "last", "address1", "city1", "CA", 92037, 20,
                                    'M', "None", 80000, 2, "None", 1);
            BLCustomer.CreateCustomer(customer, ref errors);
            Assert.AreEqual(0, errors.Count);
            AsynchLog.LogNow(errors);
        }
Exemple #30
0
    private void ClearFields()
    {
        this.id = 0;

            this.customer = null;
            this.customer = new BLCustomer(0);

            this.uid = string.Empty;
            this.enabled = false;
            this.login = string.Empty;
            this.password = string.Empty;
            this.email = string.Empty;
            this.created = DateTime.MinValue;
    }
 protected override void InitBusinessObject()
 {
     base.InitBusinessObject();
     oBL = new BLCustomer();
 }
Exemple #32
0
    public static void initCustomer(int buyerid )
    {
        //switch (Logins.password)
        //{
        //    case "tzally123":
        //        messages.buyerID = 6;

        //        break;
        //    case "zalman123":
        //        messages.buyerID = 1;

        //        break;

        //    case "eli123":
        //        messages.buyerID = 2;

        //        break;

        //    default:

        BLCustomer cust = new BLCustomer(buyerid);

                messages.cust = cust;

        //        break;

        //}
    }
Exemple #33
0
    protected void login(Object sender,  EventArgs e)
    {
        //  string  MessageLogin="";

        //Logins.password = txtLoginPassword.Text;
        //Logins.userid = txtLoginEmail.Text;
        //switch (Logins.password)
        //{
        //    case "tzally123":
        //        messages.buyerID = 6;

        //        break;
        //    case "zalman123":
        //        messages.buyerID = 1;

        //        break;

        //    case "eli123":
        //        messages.buyerID = 2;

        //        break;

        //    default:

        //        BLCustomer cust = new BLCustomer(messages.buyerID);

        //        messages.cust = cust;

        //        break;

        custs().signedinorgid = 0;
        custs().buyerID = 0;

         //       if (  dvheader.InnerHtml != "You are allready loged in Please log out first")

         //{

        String buyer_email = txtLoginEmail.Text      ;
        String password = txtLoginPassword.Text;

        //if (Session["qry"].ToString().IndexOf("not") != -1)
        //         {
                    if (custs().buyerID  != 0) {custs().buyerID   = 0;}

                    else
                    {
                         if (custs().signedinorgid  != 0)custs().signedinorgid   = 0;
                    }

                 //}
                 //else{

        String prm = "P";

        //   String avail_request = Request.Form["avail_request"];

        int idd = 0;

        //  String id = "0";
        //  int Site = (int)Convert.ToInt16(System.Configuration.ConfigurationManager.AppSettings["SiteID"]);
        //   String status = "pending";

        DataSet ds = new DataSet();
        //status = "";// drplstEmailSts.SelectedValue == "All" ? String.Empty : drplstEmailSts.SelectedValue;
        string commandText = "get_Logins";

         ds=    r.getLogins(commandText, prm, buyer_email,password  );

         if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)

         {
         if (ds.Tables[0].Rows[0]["buyerid"] != null &&   ds.Tables[0].Rows[0]["buyerid"].ToString() != "")
         {
            ////////////////////// Update_DonateBuyer();

              int buyerID = Convert.ToInt16(ds.Tables[0].Rows[0]["buyerid"].ToString());
            if (Application["cust"] == null)
            {

                BLCustomer cust = new BLCustomer(buyerID);
                custs().CustName = ds.Tables[0].Rows[0]["buyer_name"].ToString();

                Application["cust"] = cust;

               //////// messages.cust = cust;
            }
            else
            {
                 custs().ID = buyerID;
                custs().CustName = ds.Tables[0].Rows[0]["buyer_name"].ToString();

                custs_ = custs();

            }

            dvmsg.InnerHtml = "you are now Logged in ";
        }

             //else
             //{
             //    HtmlContainerControl dvmsg = (HtmlContainerControl)this.FindControl("dvmsg");

             //    dvmsg.InnerHtml = " Log in failed email & password not found";

             //}

         else {

             if (ds.Tables[0].Rows[0]["orgid"] != null)
             {

                 int orgID = Convert.ToInt16(ds.Tables[0].Rows[0]["orgid"].ToString());
                 string org_title = ds.Tables[0].Rows[0][1].ToString();

                 custs().signedinorgname = org_title;

                 if (messages.cust == null)
                 {
                     BLCustomer cust = new BLCustomer(0);

                     messages.cust = cust;
                 }
                 custs().signedInorgID = orgID;
                 custs().signedinorgname = org_title;

                 custs_ = custs();

                 // messages.cust.Organization.ID = orgID;
                 dvmsg.InnerHtml = "you are now Loged in ";

             }

                /// Update_DonateOrg();
             }
         //}
        Response_End(sender,e);
         //}
        }
    }
Exemple #34
0
        // Chia bảng ra nhiều lần get, một lần get (end - begin) item
        static private DataTable GetDatabase(int begin, int end, out bool flag, string nameTable)
        {
            flag = true;
            DataSet dt = null;

            if (nameTable.Contains("IMAGE"))
            {
                switch (nameTable.Trim())
                {
                case "IMAGE_PHONE":
                    dt = new BLImageSmartPhone().GetData();
                    break;

                case "IMAGE_LAPTOP":
                    dt = new BLImageLaptop().GetData();
                    break;

                case "IMAGE_FASHION":
                    dt = new BLImageFahion().GetData();
                    break;

                case "IMAGE_CAR":
                    dt = new BLImageCar().GetData();
                    break;

                case "IMAGE_BOOK":
                    dt = new BLImageCar().GetData();
                    break;

                default:
                    flag = false;
                    return(null);
                }
            }
            else if (nameTable.Contains("PRODUCT"))
            {
                switch (nameTable.Trim())
                {
                case "PRODUCT_PHONE":
                    dt = new BLProductSmart().GetData();
                    break;

                case "PRODUCT_LAPTOP":
                    dt = new BLProductLaptop().GetData();
                    break;

                case "PRODUCT_FASHION":
                    dt = new BLProductFashion().GetData();
                    break;

                case "PRODUCT_CAR":
                    dt = new BLProductCar().GetData();
                    break;

                case "PRODUCT_BOOK":
                    dt = new BLProductBook().GetData();
                    break;

                default:
                    flag = false;
                    return(null);
                }
            }
            else if (nameTable.Contains("DETAIL"))
            {
                switch (nameTable.Trim())
                {
                case "DETAIL_PHONE":
                    dt = new BLDetailSmartPhone().GetData();
                    break;

                case "DETAIL_LAPTOP":
                    dt = new BLDetailLaptop().GetData();
                    break;

                case "DETAIL_FASHION":
                    dt = new BLDetailFashion().GetData();
                    break;

                case "DETAIL_CAR":
                    dt = new BLDetailCar().GetData();
                    break;

                case "DETAIL_BOOK":
                    dt = new BLDetailBook().GetData();
                    break;

                default:
                    flag = false;
                    return(null);
                }
            }
            else if (nameTable.Contains("CATEGORY"))
            {
                switch (nameTable.Trim())
                {
                case "CATEGORY_PHONE":
                    dt = new BLCategory_Smartphone_Tablet().GetData();
                    break;

                case "CATEGORY_LAPTOP":
                    dt = new BLCategory_Laptop().GetData();
                    break;

                case "CATEGORY_FASHION":
                    dt = new BLCategory_Fashion().GetData();
                    break;

                case "CATEGORY_CAR":
                    dt = new BLCategory_Car().GetData();
                    break;

                case "CATEGORY_BOOK":
                    dt = new BLCategory_Book().GetData();
                    break;

                default:
                    flag = false;
                    return(null);
                }
            }
            else
            {
                switch (nameTable.Trim())
                {
                case "CUSTOMER":
                    dt = new BLCustomer().GetData();
                    break;

                case "COMMENT":
                    dt = new BLComment().GetData();
                    break;

                case "BILL":
                    dt = new BLDetailBill().GetData();
                    break;

                default:
                    flag = false;
                    return(null);
                }
            }

            DataTable table = dt.Tables[0];

            if (table.Rows.Count <= end)
            {
                end  = table.Rows.Count;
                flag = false;
            }
            DataTable resulrSplip = table.AsEnumerable().Skip(begin).Take(end - begin).CopyToDataTable();

            return(resulrSplip);
        }
Exemple #35
0
    protected void subCat(Object sender, EventArgs e)
    {
        ListBox lb = new ListBox();
        ListBox lbn = new ListBox();

        messages.cnt += 1;

          //  queue.Clear() ;

           // queue.Enqueue(hc.Value);

        lstcatsub1.Visible = false;
        lstcatsub2.Visible = false;
        lstcatsub3.Visible = false;
        int counter = 0;

           String name= ((ListBox)sender).ID.ToString();
           int subcat = (int)Convert.ToInt16(((ListBox)sender).SelectedValue.ToString());

           items().CatID = subcat;

           items().CatID = subcat;

           switch (name)
        {

            case "lstcat":
                //lstcatsub1.DataSource = ds;
                //lstcatsub1.DataBind();
                lstcatsub1.Visible = true;
                lb = lstcat;
                lbn = lstcatsub1;
                counter =0;

                break;

            case "lstcatsub1":
                //lstcatsub1.DataSource = ds;   ;
                //lstcatsub1.DataBind();
                lstcatsub1.Visible = true; lstcatsub2.Visible = true;
                lb = lstcatsub1;
                lbn = lstcatsub2;
                counter = 1;

                break;

            case "lstcatsub2":

                lstcatsub1.Visible = true;

                //lstcatsub2.DataSource = ds; ;
                //lstcatsub2.DataBind();
                lstcatsub2.Visible = true; lstcatsub3.Visible = true;
               lb = lstcatsub2;
                lbn = lstcatsub3;
                counter = 2;
                break;

            case "lstcatsub3":

                lstcatsub1.Visible = true;
                lstcatsub2.Visible = true;

                lstcatsub3.Visible = true;
                lb  = lstcatsub3;
                lbn = lstcatsub3;
                counter = 3;
                break;

        }

           messages.arCats[counter] = lb.SelectedItem.ToString() + " ";

           for (int x = counter+1; x < messages.arCats.Count(); x++)
           {
           messages.arCats[x] = "";

           }

           if (((ListBox)sender).SelectedItem.ToString().IndexOf(">") == -1 || name == "lstcatsub3")
           {
           HtmlContainerControl catlstbx = (HtmlContainerControl)this.FindControl("catlstbx");

          custs().Organization.Orgitems.CatID = Convert.ToInt16( ((ListBox)sender).SelectedValue.ToString().Replace('>', ' '));

          custs_ = custs();

           catlstbx.Visible = true;
           return;

           }

        //messages.catID = subcat;

        //{
        //    HtmlContainerControl catlstbx = (HtmlContainerControl)this.FindControl("catlstbx");

        //    catlstbx.Visible = true;
        //}

        //else
        //{

        DataSet ds = UpdateDonate("S", "get_Categories", subcat, "");

        HtmlInputText hc = (HtmlInputText)this.FindControl("lisub");
         //   if (messages.cnt > 1) { hc.Value += " > "; }

        //messages.arCats[counter] = lb.SelectedItem.ToString() + " ";
        //messages.address += lb.SelectedItem.ToString() + " ";

        hc.Value =   messages.arCats.ToString() ; //messages.address;

        lbn.DataSource = ds; ;
        lbn.DataBind();

        //}
    }
Exemple #36
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (custs() == null)
        {
            BLCustomer cust = new BLCustomer(0);

                    custs_ = cust;
        }

        string qry = Request.QueryString !=null  && Request.QueryString.Count>0 ?   Request.QueryString[0].ToString():  "" ;

           Session["qry"]=qry;
          // if (qry.IndexOf("In") == -1)
          // {  BLCustomer.signedinorgid = 0;
          //  BLCustomer.buyerID = 0;

          //     BLCustomer.CustName="";

          //     BLCustomer.signedinorgname = "";

          //Response_End(sender, e);
          // }

           // if (BLCustomer.signedinorgid == 0 && BLCustomer.buyerID == 0)
           //{

           HtmlContainerControl dvheader = (HtmlContainerControl)this.FindControl("dvheader");

           dvheader.InnerHtml = qry + "s Log in";

        ////}
        ////else
        ////{
        ////    if (qry.IndexOf("not") == -1 ) dvheader.InnerHtml = "You are allready loged in Please log out first";

        ////    else { dvheader.InnerHtml = qry + "s Log in"; }

        ////}
    }
Exemple #37
0
    protected void Page_Load(object sender, EventArgs e)
    {
        parent = messages.GetParentOfType(this.Parent
                                         );

        BLItems.navigateCat += new EventHandler(subCatAction);

        if (!IsPostBack)
        {
            switch (parent.ToString())
            {
                case "orgproducts_aspx":

                    break;
            }

            //      txtPriceEnd

            //if (!IsPostBack)
            //{

            messages.cnt = 0;
            messages.arCats = new String[20];

           /// DataSet ds = UpdateDonate("R", "get_Categories", 0, "");
           ///
            BLCustomer cst = (BLCustomer)custs();
            DataSet ds = orgs().Category.GetCatList(ref cst, "R", "get_Categories", 0, "");

            custs_ = cst;

            lstcat.DataSource = ds;
            lstcat.DataBind();

            lstcat.Items.Insert(0, "All Categories");

            //}
        }
    }
Exemple #38
0
    public void Retrieve()
    {
        DataSet items;

            if( this.login.Length > 0 )
                items = DALCUser.GetItemByLogin(this.login);
            else if( this.uid.Length > 0 )
                items = DALCUser.GetItemByUID(this.uid);
            else if( this.email.Length > 0 )
                items = DALCUser.GetItemByEMail(this.email);
            else
                items = DALCUser.GetItem(this.id);

            if( items.Tables.Count > 0 && items.Tables[0].Rows.Count > 0)
            {
                this.id = Convert.ToInt32( items.Tables["User"].Rows[0]["ID"] );
                int customerID = Convert.ToInt32( items.Tables["User"].Rows[0]["CustomerID"] );
                this.uid = Convert.ToString( items.Tables["User"].Rows[0]["UID"] );
                this.enabled = Convert.ToBoolean( items.Tables["User"].Rows[0]["Enabled"] );
                this.login = Convert.ToString( items.Tables["User"].Rows[0]["Login"] );
                this.password = Convert.ToString( items.Tables["User"].Rows[0]["Password"] );
                this.email = Convert.ToString( items.Tables["User"].Rows[0]["EMail"] );
                this.created = Convert.ToDateTime( items.Tables["User"].Rows[0]["Created"] );

                if (customer == null)
                {
                    customer = new BLCustomer(0);
                }
                if( customerID > 0)
                {
                    this.customer.ID = customerID;
                    this.customer.Retrieve();
                }
                else
                {
                }
            }
            else
            {
                ClearFields();
            }
    }
Exemple #39
0
    protected void subCat(Object sender, EventArgs e)
    {
        HtmlGenericControl catSelect = (HtmlGenericControl)this.FindControl("catSelect");

        catSelect.InnerText = ((ListBox)sender).SelectedItem != null ? ((ListBox)sender).SelectedItem.ToString() : "";

        ListBox lb = new ListBox();
        ListBox lbn = new ListBox();

        items().pager = 1;

        messages.cnt += 1;

        //  queue.Clear() ;

        // queue.Enqueue(hc.Value);

        //lstcatsub1.Visible = false;
        //lstcatsub2.Visible = false;
        //lstcatsub3.Visible = false;
        int counter = 0;

        String name = ((ListBox)sender).ID.ToString();
        int subcat = (((ListBox)sender).SelectedValue.ToString()) == "All Categories" ? 0 : (int)Convert.ToInt16(((ListBox)sender).SelectedValue.ToString());

        messages.subcatID = subcat;

        switch (name)
        {

            case "lstcat":
                //lstcatsub1.DataSource = ds;
                //lstcatsub1.DataBind();
                //lstcatsub1.Visible = true;
                // lb = lstcat;
                //lbn = lstcatsub1;
                counter = 0;

                break;

            case "lstcatsub1":
                //lstcatsub1.DataSource = ds;   ;
                //lstcatsub1.DataBind();
                //lstcatsub1.Visible = true; lstcatsub2.Visible = true;
                //lb = lstcatsub1;
                //lbn = lstcatsub2;
                counter = 1;

                break;

            case "lstcatsub2":

                //lstcatsub1.Visible = true;

                //lstcatsub2.DataSource = ds; ;
                //lstcatsub2.DataBind();
                //lstcatsub2.Visible = true; lstcatsub3.Visible = true;
                //lb = lstcatsub2;
                // lbn = lstcatsub3;
                counter = 2;
                break;

            case "lstcatsub3":

                //lstcatsub1.Visible = true;
                //lstcatsub2.Visible = true;

                //lstcatsub3.Visible = true;
                //lb  = lstcatsub3;
                //lbn = lstcatsub3;
                counter = 3;
                break;

        }

        BLCustomer cst = (BLCustomer)custs();

        cst.Organization.Orgitems.CatID = subcat;

                subCatAction( sender,   e);

                custs_ = cst;

        // messages.arCats[counter] = lb.SelectedItem.ToString() + " ";

        //////for (int x = counter+1; x < messages.arCats.Count(); x++)
        //////{
        //////    messages.arCats[x] = "";

        //////}

        //if (((ListBox)sender).SelectedItem.ToString().IndexOf(">") == -1 || name == "lstcatsub3")
        //{
        //    HtmlContainerControl catlstbx = (HtmlContainerControl)this.FindControl("catlstbx");

        //    messages.catID = ((ListBox)sender).SelectedValue.ToString() == ""?   0     :   Convert.ToInt16( ((ListBox)sender).SelectedValue.ToString().Replace('>', ' '))   ;

        //  //  catlstbx.Visible = true;
        //    return;

        //}

        //messages.catID = subcat;

        //{
        //    HtmlContainerControl catlstbx = (HtmlContainerControl)this.FindControl("catlstbx");

        //    catlstbx.Visible = true;
        //}

        //else
        //{
    }
Exemple #40
0
    protected void Update_DonateOrg( )
    {
        //String id = "";
        //String prm = "";
        //    String qry = Server.UrlDecode(Request.QueryString.ToString());

        //if (qry != null && qry.Length > 0 && qry.ToString() != string.Empty)
        //{
        //    prm = qry.ToString().IndexOf("prm=") == -1 ? "0" : qry.Substring(qry.ToString().IndexOf("prm=") + 4, qry.Length - 4);
        //    id = qry.ToString().IndexOf("id=") == -1 ? "0" : qry.Substring(qry.ToString().IndexOf("id=") + 3, qry.Length - 3);
        //}

        string file = messages.image;

        //ContentPlaceHolder MainContent = (ContentPlaceHolder)Page.Master.FindControl("Body");
        //   HtmlForm frm = (HtmlForm)MainContent.FindControl("form1");

        String orgEmail = txtLoginEmail.Text;//  ((HtmlInputControl)MainContent.FindControl("orgEmail")).Value;//   (String)Request.Form["orgEmail"] == null ? "0" : (String)Request.Form["orgEmail"].ToString();)
        // String subtype = ((HtmlInputControl)this.FindControl("orgEmail")).Value;//  (String)Request.Form["subtype"] == null ? "0" : "1";// (String)Request.Form["subtype"] == null ? Request.Form["subtype"].ToString() : Request.Form["subType"].ToString();
        String orgTitle = "";//  ((HtmlInputControl)MainContent.FindControl("orgTitle")).Value;//  (String)Request.Form["orgTitle"] == null ? (String)Request.Form["orgTitle"].ToString() : (String)Request.Form["orgTitle"].ToString();

        String orgFunct = "";//  ((HtmlInputControl)MainContent.FindControl("orgFucnionality")).Value;//  (String)Request.Form["orgFucnionality"] == null ? (String)Request.Form["orgFucnionality"].ToString() : (String)Request.Form["orgFucnionality"].ToString();
        String orgDesc = "";// ((HtmlInputControl)MainContent.FindControl("orgDescription")).Value;//  (String)Request.Form["orgDescription"] == null ? (String)Request.Form["orgDescription"].ToString() : (String)Request.Form["orgDescription"].ToString();
        String orgTaxID = "";// ((HtmlInputControl)MainContent.FindControl("orgTaxID")).Value;//  (String)Request.Form["orgTaxID"] == null ? (String)Request.Form["orgTaxID"].ToString() : (String)Request.Form["orgTaxID"].ToString();

        String orgPaypal =  txtLoginPassword.Text ;//  ((HtmlInputControl)MainContent.FindControl("orgPayPalAccount")).Value;//   (String)Request.Form["orgPayPalAccount"] == null ? (String)Request.Form["orgPayPalAccount"].ToString() : (String)Request.Form["orgPayPalAccount"].ToString();

        String orgLogo = "";//  ((HtmlInputControl)MainContent.FindControl("orgLogo")).Value;//  (String)Request.Form["orgLogo"] == null ? (String)Request.Form["orgLogo"].ToString() : (String)Request.Form["orgLogo"].ToString();
        String orgVideo = "";
        String buttonLogo = "";// ((HtmlInputControl)MainContent.FindControl("buttonLogo")).Value;//   (String)Request.Form["buttonLogo"] == null ? (String)Request.Form["buttonLogo"].ToString() : (String)Request.Form["buttonLogo"].ToString();

        String orgStatus = "pending";// (String)Request.Form["orgStatus"] == null ? (String)Request.Form["orgStatus"].ToString() : (String)Request.Form["orgStatus"].ToString();

        //  String ConfirmImg = (String)Request.Form["ConfirmImg"] == null ? (String)Request.Form["ConfirmImg"].ToString() : (String)Request.Form["ConfirmImg"].ToString();

        //if (ConfirmImg!=null)
        //{
        //    OnSaveClick(buttonLogo);
        //    return;

        //}

        String prm = "P";

        //   String avail_request = Request.Form["avail_request"];

        int idd = 0;

        //  String id = "0";
        //  int Site = (int)Convert.ToInt16(System.Configuration.ConfigurationManager.AppSettings["SiteID"]);
        //   String status = "pending";

        DataSet ds = new DataSet();
        //status = "";// drplstEmailSts.SelectedValue == "All" ? String.Empty : drplstEmailSts.SelectedValue;
        string commandText = "get_Orgs";

        ds = r.getOrgs(commandText, prm, idd,
         orgTitle,
         orgFunct,
         orgDesc,
         orgTaxID,
         orgEmail,
         orgPaypal,
         orgLogo,
         orgStatus,   orgVideo

        );
        //  grdvSubGmach.AutoGenerateColumns = false;

        if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
        {
            int orgID = Convert.ToInt16(ds.Tables[0].Rows[0][0].ToString());

            if (custs() == null)

            /// if (Session["nonProfit"] == null)
            {

                BLCustomer cust = new BLCustomer(0);

                // Session["nonProfit"] = cust;

                custs_ = cust;
            }

            custs().signedinorgid = orgID;
            custs_ = custs();
           //messages.cust.Organization.ID = orgID;
            dvmsg.InnerHtml = "you are now Loged in ";
        }
        else
        {
            HtmlContainerControl dvmsg = (HtmlContainerControl)this.FindControl("dvmsg");

            dvmsg.InnerHtml =  " Log in failed email & password not found";

        }
    }
Exemple #41
0
 public void CreateCustomer(Customer users, ref List <string> errors)
 {
     BLCustomer.CreateCustomer(users, ref errors);
 }
Exemple #42
0
    protected void loads()
    {
        DataView dv;

        int orgid = Convert.ToInt16(orgs().orgID);
        int catid = 0;// Convert.ToInt16(messages.catID);
        orgid = 0;

        //if (messages.dvorgProducts != null)

        //{ dv = messages.dvorgProducts; }

        //else
        //{
            DataSet ds = new DataSet();
            BLCustomer cst = (BLCustomer)custs();

            ds = items().GetItemsList(ref cst, "V", "get_Items", 0, 0, 0, "");
            ///////// ds   =     UpdateDonate("Q", "get_Items", 0, catid, orgid, "");

            custs_ = cst;

            //////  ds = UpdateDonate("Q", "get_Items", 0, catid, orgid, "");

            //BLOrganization org = new BLOrganization();

            //org.Orgitems.OrgID = orgid;

            //org.Orgitems.CatID = catid;

           /////////////////// ds = org.Orgitems.UpdateDonate("V", "get_Items", 0, 0, 0, "");

            ///  ds = BLItems.o..UpdateDonate("Q", "get_Items", 0, catid, orgid, "");

            ///  ds = BLItems.GetItemsList("Q", "get_Items", 0, catid, orgid, "");

            //    BLItems Itemss = new BLItems();

            //BLOrganization.

            ///// Itemss.Items = Itemss.UpdateDonate(parm, commandtext, id, orgid, catid, status);
            //  return Itemss.Items;

            //// grdvSubGmach.AutoGenerateColumns = false;
            ///////  items().rowlimit = 15;

            dv = new DataView(ds.Tables[0]);
        //}
            int rowLimit = 4;// items().rowlimit;

        // dv.RowFilter = "";
        DataTable dataTable = dv.ToTable();

        DataTable datatable = new DataTable();
        datatable = dataTable.Clone();

        for (int x = 0; x < 4; x++)
        {
            //if (x < page || x > page + rowLimit)
            //{refreshMenu

            if (dataTable.Rows.Count-1 >=x)
            {

            datatable.ImportRow(dataTable.Rows[x]);
            }

            ////////// dataTable.Rows[x].Delete();
            //}
        }

        //while (dataTable.Rows.Count > rowLimit)
        //    dataTable.Rows[dataTable.Rows.Count - 1].Delete();

        ///   dataTable = dataTable.AsEnumerable().Skip(0).Take(50).CopyToDataTable();

        //  return dataTable;

        dataTable.TableName = "table1";

        DataView dvv = new DataView();

        dvv.Table = dataTable;

        dtalstItems.DataSource = datatable; // dvv;// dataTable;// ds;

        dtalstItems.DataBind();

        //}
    }
Exemple #43
0
    protected void itemSearch(Object sender, EventArgs e)
    {
        int orgid = orgs().ID;// BLOrganization.orgID;
        int catid = items().CatID;// BLItems.catid;

        catid = 0;

        HtmlContainerControl dvCatsGen = (HtmlContainerControl)this.FindControl("dvCatsGen");

        dvCatsGen.Style.Add("visibility", "visible");

        DataSet ds = new DataSet();

        /////  BLCustomer cust = (BLCustomer)messages.cust;

        BLCustomer cst = (BLCustomer)custs();
        ds = items().GetItemsList(ref cst, "I", "get_Items", custs().ID, orgid, catid, txtItemSearch.Text.Trim());
        custs_ = cst;

           //////// ds = BLItems.GetItemsList("A", "get_Items", 0, orgid, catid, txtItemSearch.Text.Trim());

        lstvCatGeneral.DataTextField = "catnamespec"; //"catname";
        lstvCatGeneral.DataValueField = "catid";

        lstvCatGeneral.DataSource = ds;

        lstvCatGeneral.DataBind();
    }
Exemple #44
0
    public DataSet GetCatList(ref  BLCustomer cust, String parm, string commandtext,   int catid, string status)
    {
        /// BLItems Itemss = new BLItems();

           /// BLCustomer cust = (BLCustomer)messages.cust;

            DataSet ds = new DataSet();

            switch (parm)
            {
                case "S":

                    ds = cust.Organization.Category.Items;

                    break;

                case "I":

                    //  ds = cust.Organization.Orgitems.ItemsGeneralSearch;

                    ds = cust.Organization.Category.Items;
                    break;

                case "A":

                   // ds = cust.Organization.Orgitems.categories;

                    break;

                case "R":

                    // ds = cust.Organization.Orgitems.categories;

                    break;
                    /// cust.Organization.Orgitems.UpdateDonate("I", "get_Items", 0, orgid, catid, status);

            }

            ds = cust.Organization.Category.UpdateDonate(parm, commandtext, catid, status);

            return ds;
    }
Exemple #45
0
    protected void item_Searchs(int Orgid, int Catid)
    {
        //  int ggg = e.NewSelectedIndex;

          //int cat_id =  Convert.ToInt16(  lstvCatGeneral.Items[ggg].Controls[0].ToString());

          //messages.orgs_.Orgitems.ID = cat_id;

        HtmlContainerControl dvCatsGen = (HtmlContainerControl)this.FindControl("dvCatsGen");

        dvCatsGen.Style.Add("visibility", "hidden");

        int orgid = orgs().ID;// messages.orgs_.ID;// BLItems.orgID;
        int catid = items().CatID;// items().CatID;

        //// catid = 0;

        DataSet ds = new DataSet();

        /////  BLCustomer cust = (BLCustomer)messages.cust;

        ///    ds = BLItems.GetItemsList("I", "get_Items", 0, catid, orgid, txtItemSearch.Text.Trim());

        BLCustomer cst = (BLCustomer)custs();

        ds = items().GetItemsList(ref cst, "Q", "get_Items", 0, orgid, catid, "");

        custs_ = cst;

        ///    return;

           // items().pager = 0;

        items().pager = 0;
        /////items().rowlimit = 10;

        string sortr = "";

        //////////if (messages.dvorgProducts != null)
        //////////    sortr = messages.dvorgProducts.Sort.ToString();

        // orgItems   obj = new orgItems();

        //foreach (Control c in Page.Controls)

        //{
        //    string nm = c.ID;
        //    foreach (Control cc in c.Controls)
        //    {
        //        string nmc = cc.ID;

        //        foreach (Control ccc in cc.Controls)
        //        {
        //            string nmcc = ccc.ID;

        //        }

        //    }
        //}

        ContentPlaceHolder MainContent = (ContentPlaceHolder)Page.Master.FindControl("Body");

        DropDownList drplstSort = (DropDownList)(MainContent.FindControl("drplstSort"));

        DataList dtalstItems = (DataList)(MainContent.FindControl("orgProducts2")).FindControl("dtalstItems");

        String sorter = "";

        if (drplstSort != null)
        {

            sorter = drplstSort.SelectedValue.ToString();

            if (messages.dvorgProducts != null)
                messages.dvorgProducts.Sort = sorter;

        }

        UserControl category1 = (UserControl)MainContent.FindControl("category1");
        Decimal PriceEnd = 0;
        Decimal PriceStart = 0;

        if (category1 != null)
        {
            ListBox lstcat = (ListBox)(MainContent.FindControl("category1")).FindControl("lstcat");

            TextBox txtPriceStart = (TextBox)category1.FindControl("txtPriceStart");

            TextBox txtPriceEnd = (TextBox)category1.FindControl("txtPriceEnd");

            PriceStart = txtPriceStart != null && txtPriceStart.Text.Trim() != "" ? Convert.ToDecimal(txtPriceStart.Text) : 0;

            PriceEnd = txtPriceEnd != null && txtPriceEnd.Text.Trim() != "" ? Convert.ToDecimal(txtPriceEnd.Text) : 0;

            //[get_Categories]

            //    @opt varchar(1),
            //    @catID  int ,
            //    @catName varchar(50

            if (lstcat != null && lstcat.SelectedValue.ToString().Trim() != "")
            {
                messages.catID = Convert.ToInt16(lstcat.SelectedValue.ToString());

            }

        }

        //if (lstcat != null)
        //{
        //    messages.orgID = drplstOrgs.SelectedValue.ToString() == "" ? 0 : Convert.ToInt16(drplstOrgs.SelectedValue.ToString() == "");

        //}

        //DataView dv = new DataView((DataTable)dtalstItems.DataSource);
        DataView dv = new DataView(ds.Tables[0]);

        String filters = items().Live;// items().Live;

        int rowLimit = items().rowlimit;
        int page = items().pager * rowLimit;

        if (ds.Tables.Count > 0)
        {

            if (PriceEnd > 0 && PriceEnd > PriceStart)
            {
                dv.RowFilter = "Price >=" + PriceStart + "   and Price <= " + PriceEnd;
                if (filters.Trim() != "") { dv.RowFilter += " and " + filters; }
            }
            else { dv.RowFilter = filters; }

            //if (PriceEnd > 0 && PriceEnd > PriceStart)
            //{
            //    dv.RowFilter = "Price >=" + PriceStart + "   and Price <= " + PriceEnd;
            //}

            if (drplstSort != null)
                dv.Sort = drplstSort.SelectedValue.ToString();

            DataTable dataTable = dv.ToTable();
            DataTable datatable = new DataTable();
            if (ds.Tables[0].Rows.Count > 0)

            {

                ////////////////////////////  dataTable = dataTable.AsEnumerable().Skip(page).Take(rowLimit).CopyToDataTable();
                //while (dataTable.Rows.Count > rowLimit)
                //    dataTable.Rows[dataTable.Rows.Count - 1].Delete();

                //////////////////////////dtalstItems.DataSource = dataTable; /// messages.dvorgProducts;
                //////////////////////////dtalstItems.DataBind();

                parent = messages.GetParentOfType(this.Parent
                                                  );

            ////////////switch (parent.ToString())
            ////////////{
            ////////////    case "orgproducts_aspx":

            ////////////        break;

            ////////////    case "auction_aspx":
            ////////////        messages.DataTable = dataTable;
            ////////////        Response.Redirect("orgproducts.aspx?");

            ////////////    break;

            ////////////}

            UserControl pageing = (UserControl)(MainContent.FindControl("orgProducts2")).FindControl("pageing1");

            HtmlContainerControl dvPageing = (HtmlContainerControl)(MainContent.FindControl("orgProducts2")).FindControl("dvPageing");

            if (dvPageing == null || dvPageing.Visible == false)
            {

            }

            else
            {

                DropDownList drplstPageSize = (DropDownList)pageing.FindControl("drplstPageSize");
               ////////////////// items().pager = 1;
                items().rowlimit = Convert.ToInt16(drplstPageSize.SelectedValue.ToString());  ///15;

                rowLimit = items().rowlimit;
                page = items().pager * rowLimit;

                datatable = dataTable.Clone();

                for (int x = page; x < page + rowLimit; x++)
                {
                    if (x < page || x > page + rowLimit)
                    {
                    }
                    else
                    {
                        if (dataTable.Rows.Count>x )
                        {
                            datatable.ImportRow(dataTable.Rows[x]);
                        }

                    }

                    ////////// dataTable.Rows[x].Delete();
                    //}
                }

                ///////  datatable = datatable.AsEnumerable().Skip(page).Take(rowLimit).CopyToDataTable();

            }

            items().pager += 1;

        /////////    Label CurrentPage = (Label)pageing.FindControl("CurrentPage");

            ///////////CurrentPage.Text = items().pager.ToString();
            int pageNext = items().pager + 1;

                DataView dvv = new DataView();
                datatable.TableName = "table1";

                dvv.Table = datatable;

                dtalstItems.DataSource = dvv;

                dtalstItems.DataBind();

            }
        }
    }
Exemple #46
0
 public void UpdateCustomer(Customer customers, ref List <string> errors)
 {
     BLCustomer.UpdateCustomer(customers, ref errors);
 }
Exemple #47
0
    protected void refreshOrgs(Object sender, EventArgs e)
    {
        ContentPlaceHolder MainContent = (ContentPlaceHolder)Page.Master.FindControl("Body");

        DropDownList drplstSort = (DropDownList)(MainContent.FindControl("drplstSort"));

        Button btnBack = (Button)(MainContent.FindControl("btnBack"));

          orgs().orgID = drplstOrgs.SelectedIndex  >  0     ? Convert.ToInt16(drplstOrgs.SelectedValue.ToString()) :0 ;

          //

        ////if (drplstOrgs.SelectedValue.IndexOf("All") != -1)
        ////{
        ////    btnBack.Visible = true;

           /// BLCustomer cust = (BLCustomer)messages.cust;

           custs().Organizationhld = custs().Organization;
            ///////////////////////////////cust.Organization = new BLOrganization();

           //// cust.Organization.ID = messages.orgID;

            ////////////////////////////////refreshMenu();

        ////}
        ////else { btnBack.Visible = false; }

           ///      txtItemSearch.Text = drplstOrgs.SelectedItem.ToString();

            if (btnBack != null)
            {

            if (custs().Organizationhlder > 0)
            {
                    btnBack.Visible = true;
                }
                else { btnBack.Visible = false; }
            }

            items().pager = 1;

            DataSet dst = new DataSet();

            String param = "Q";
            BLCustomer cst = (BLCustomer)custs();

            dst = items().GetItemsList(ref cst, param, "get_Items", 0, orgs().orgID, 0, "");
            custs_ = cst;

            if (Request.Url.ToString().IndexOf("nonprofitHome") != -1   )

            {
                  Response.Redirect("orgHome.aspx");
            }

         // ||   Request.Url.ToString().IndexOf("orgHome") == -1 )
            if (Request.Url.ToString().IndexOf("orgProducts") != -1)
            {
                Response.Redirect("orgProducts.aspx");
            }
            else { Response.Redirect("orgHome.aspx"); }
            ////else
            ////{
            ////    if (Request.Url.ToString().IndexOf("orgHome") == -1) Response.Redirect("orgHome.aspx");
            ////}

           ////////////////////// item_Searchs(cust.Organization.ID, cust.Organization.Orgitems.CatID);

           // item_Search();

        //itemSearch(sender, e);

        return;

        DataView dv;
        DataSet ds = new DataSet();

        //  categoryProduct
        int catid = 0;

        int orgid = Convert.ToInt16(drplstOrgs.SelectedValue.ToString());

        ds = items().GetItemsList(ref cst, "Q", "get_Items", 0, orgid, catid, "");

        custs_ = cst;

           ////// ds = getItems("Q", "get_Items", 0, catid, orgid, "");

        dv = new DataView(ds.Tables[0]);

        int rowLimit = 4;

        // dv.RowFilter = "";

        ///   dataTable = dataTable.AsEnumerable().Skip(0).Take(50).CopyToDataTable();

        //  return dataTable;
        UserControl category1 = (UserControl)Page.FindControl("category1");
          ///if (){}
        DataList catlstbx = (DataList)category1.FindControl("catlstbx");

        TextBox txtPriceStart = (TextBox)category1.FindControl("txtPriceStart");
        TextBox txtPriceEnd = (TextBox)category1.FindControl("txtPriceEnd");

        //String txtPriceStarts = txtPriceStart.Text;
        //String txtPriceEnds = txtPriceEnd.Text;
        String filter = catlstbx.SelectedItem.ToString() + " "; ;

        dv.RowFilter = filter;
        dv.RowFilter = filter + "'cartPrice' >  txtPriceStarts and 'cartPrice' < txtPriceEnds ";

        UserControl uc = (UserControl)this.FindControl("orgProducts2");

        DataList dtalstItems = (DataList)uc.FindControl("dtalstItems");

        Decimal PriceStart = txtPriceStart != null && txtPriceStart.Text.Trim() != "" ? Convert.ToDecimal(txtPriceStart.Text) : 0;

        Decimal PriceEnd = txtPriceEnd != null && txtPriceEnd.Text.Trim() != "" ? Convert.ToDecimal(txtPriceEnd.Text) : 0;

        DataTable dataTable = dv.ToTable();

        while (dataTable.Rows.Count > rowLimit)
            dataTable.Rows[dataTable.Rows.Count - 1].Delete();

        //////////////////////////////////////////dtalstItems.DataSource = dataTable;// ds;

        //////////////////////////////////////////dtalstItems.DataBind();

        string sortr = "";

        ////if (messages.dvorgProducts != null)
        sortr = messages.dvorgProducts.Sort.ToString();

        String sorter = drplstSort.SelectedValue.ToString();

        //if (  messages.dvorgProducts!=null)
        messages.dvorgProducts.Sort = sorter;
    }
Exemple #48
0
 public List <Customer> ReadCustomers(ref List <string> errors)
 {
     return(BLCustomer.ReadCustomers(ref errors));
 }
Exemple #49
0
    protected void Page_Load(object sender, EventArgs e)
    {
        rptBreadCrumbs.DataSource = items().CatbreadCrumbs;
        rptBreadCrumbs.DataBind();

        ///credits=BLOrganization.getCredits;
        credits = custs().Credits;

        if (custs().Organizationhlder > 0)

        { btnBack.Visible = true; }
        else { btnBack.Visible = false; }

        //if (IsPostBack)
        //{
        //    HtmlGenericControl catHeader = (HtmlGenericControl)this.FindControl("catHeader");
        //    catHeader.InnerHtml = category;
        //}

        if(!IsPostBack)
        {
            items().Live = "";
        }

         filters = items().Live;

         //ContentPlaceHolder MainContent = (ContentPlaceHolder)Page.Master.FindControl("Body");
         //UserControl category1 = (UserControl)MainContent.FindControl("category1");

          ///////////////////////   BLItems.navigateCat += new EventHandler( itemSearch);

        ////////if (messages.cust == null)
        ////////{

        ////////    while ((Logins.password != "tzally123" && Logins.password != "zalman123" && Logins.password != "zalman123" && Logins.password != "zalman123") &&
        ////////     (Logins.userid != "tzally123" && Logins.userid != "zalman123" && Logins.userid != "zalman123" && Logins.userid != "zalman123"))
        ////////    {
        ////////        Response.Redirect("Login.aspx");
        ////////    };
        ////////    // Logins.userid = txtLoginEmail.Text;

        ////////    ///////// item_Search();

        ////////    /////////////////// refreshOrgs(sender, e);

        ////////}

        //if(!IsPostBack)

        //{

        string status ="approved";
        int origid =   Convert.ToInt16(orgs().orgID);

        BLCustomer cst = (BLCustomer)custs();

        DataSet ds = orgs().GetOrgList(ref cst, "S", "get_Orgs", origid, status);

        custs_ = cst;

              //////////drplstOrgs.DataSource = ds;
              //////////drplstOrgs.DataValueField = "orgID";
              //////////drplstOrgs.DataTextField=  "orgTitle";
              //////////drplstOrgs.DataBind();

              //////////drplstOrgs.Items.Insert(0, "All Orginazations");

        int buyerid = custs().ID;// messages.buyerID;
              string commandName = "get_Credits";
              string prm = "E";

              //////Decimal credits_ = r.get_Credits(commandName, prm, buyerid, 0);

              //////messages.credits = Convert.ToInt16(credits_);

         itemSearch(  sender,   e);

           /// load();
           ///

           ///////////////////////////// loads();
            //////////////}

        int catid = 0;
        int orgid = messages.orgID;

        DataSet dst = new DataSet();

        dst = UpdateDonate("C", "get_Items", custs().ID, catid, orgid, "");
    }
Exemple #50
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ///  if (messages.cust.Organizationhlder > 0)

        //{ btnBack.Visible = true; }
        //else { btnBack.Visible = false; }

        if (!IsPostBack)
        {
            items().Live = "";
        }

        filters = items().Live;

        string status = "approved";
        int origid = Convert.ToInt16(org.ID);

        BLCustomer cst = (BLCustomer)custs();
        DataSet ds = orgs().GetOrgList(ref  cst, "S", "get_Orgs", origid, status);

        custs_ = cst;

        int buyerid = cust.ID;// messages.buyerID;
        string commandName = "get_Credits";
        string prm = "E";

        if (messages.cust.ID == 0) return;

        int catid = 0;
        int buyersid = messages.cust.ID;
        int orgid = messages.orgs_.ID;

        DataSet dst = new DataSet();

           // dst = UpdateDonate("C", "get_Items", 0, catid, orgid, "");

        dst = BLOrders.fillcarts(orgs() );
        ContentPlaceHolder MainContent = (ContentPlaceHolder)Page.Master.FindControl("Body");
        UserControl shoppingCart2 = (UserControl)MainContent.FindControl("shoppingCart2");

        GridView dtalstItems = (GridView)shoppingCart2.FindControl("dtalstItems");
        dtalstItems.DataSource = dst;
        dtalstItems.DataBind();
    }
Exemple #51
0
    //  buyerID	buyer_Name	buyer_email	buyer_paypalAccount	buyer_CreditCardInfoID	buyer_BillingAddressID	buyer_ShippingAddressID	buyerSessionID	buyerCreated	buyerSaveInfo	Credits
    protected void Update_DonateBuyer()
    {
        //String id = "";
        //String prm = "";
        //    String qry = Server.UrlDecode(Request.QueryString.ToString());

        //if (qry != null && qry.Length > 0 && qry.ToString() != string.Empty)
        //{
        //    prm = qry.ToString().IndexOf("prm=") == -1 ? "0" : qry.Substring(qry.ToString().IndexOf("prm=") + 4, qry.Length - 4);
        //    id = qry.ToString().IndexOf("id=") == -1 ? "0" : qry.Substring(qry.ToString().IndexOf("id=") + 3, qry.Length - 3);
        //}

        String buyer_email = txtLoginEmail.Text      ;//   (String)Request.Form["orgEmail"] == null ? "0" : (String)Request.Form["orgEmail"].ToString();)
        // String subtype = "";//  ((HtmlInputControl)this.FindControl("orgEmail")).Value;//  (String)Request.Form["subtype"] == null ? "0" : "1";// (String)Request.Form["subtype"] == null ? Request.Form["subtype"].ToString() : Request.Form["subType"].ToString();
        String buyer_Name = "";//  ((HtmlInputControl)this.FindControl("orgTitle")).Value;//  (String)Request.Form["orgTitle"] == null ? (String)Request.Form["orgTitle"].ToString() : (String)Request.Form["orgTitle"].ToString();
        String orgFunct = "";//  ((HtmlInputControl)this.FindControl("orgFucnionality")).Value;//  (String)Request.Form["orgFucnionality"] == null ? (String)Request.Form["orgFucnionality"].ToString() : (String)Request.Form["orgFucnionality"].ToString();
        String orgDesc = "";// ((HtmlInputControl)this.FindControl("orgDescription")).Value;//  (String)Request.Form["orgDescription"] == null ? (String)Request.Form["orgDescription"].ToString() : (String)Request.Form["orgDescription"].ToString();
        String orgTaxID = "";// ((HtmlInputControl)this.FindControl("orgTaxID")).Value;//  (String)Request.Form["orgTaxID"] == null ? (String)Request.Form["orgTaxID"].ToString() : (String)Request.Form["orgTaxID"].ToString();

        String buyer_paypalAccount = "";// ((HtmlInputControl)this.FindControl("orgPayPalAccount")).Value;//   (String)Request.Form["orgPayPalAccount"] == null ? (String)Request.Form["orgPayPalAccount"].ToString() : (String)Request.Form["orgPayPalAccount"].ToString();

        String orgLogo = "";//  ((HtmlInputControl)this.FindControl("orgLogo")).Value;//  (String)Request.Form["orgLogo"] == null ? (String)Request.Form["orgLogo"].ToString() : (String)Request.Form["orgLogo"].ToString();

        String buttonLogo = "";//  ((HtmlInputControl)this.FindControl("buttonLogo")).Value;//   (String)Request.Form["buttonLogo"] == null ? (String)Request.Form["buttonLogo"].ToString() : (String)Request.Form["buttonLogo"].ToString();

        String orgStatus = "pending";// (String)Request.Form["orgStatus"] == null ? (String)Request.Form["orgStatus"].ToString() : (String)Request.Form["orgStatus"].ToString();

        String password = txtLoginPassword.Text;// ((HtmlInputControl)this.FindControl("password")).Value;//   (String)Request.Form["buttonLogo"] == null ? (String)Request.Form["buttonLogo"].ToString() : (String)Request.Form["buttonLogo"].ToString();

        //  String ConfirmImg = (String)Request.Form["ConfirmImg"] == null ? (String)Request.Form["ConfirmImg"].ToString() : (String)Request.Form["ConfirmImg"].ToString();

        //if (ConfirmImg!=null)
        //{
        //    OnSaveClick(buttonLogo);
        //    return;

        //}

        String prm = "P";

        //   String avail_request = Request.Form["avail_request"];

        int buyer_CreditCardInfoID = 0;

        int buyer_BillingAddressID = 0;

        int buyer_ShippingAddressID = 0;
        int Credits = 0;

        //  String id = "0";
        //  int Site = (int)Convert.ToInt16(System.Configuration.ConfigurationManager.AppSettings["SiteID"]);
        //   String status = "pending";

        DataSet ds = new DataSet();
        //status = "";// drplstEmailSts.SelectedValue == "All" ? String.Empty : drplstEmailSts.SelectedValue;
        string commandText = "get_Buyers";
        int idd = 0;

         ds =   r.getBuyers(commandText, prm, idd,
             buyer_Name,
              buyer_email,
              password,
             buyer_CreditCardInfoID,
          buyer_BillingAddressID,
          buyer_ShippingAddressID,
          Credits
        );
        //  grdvSubGmach.AutoGenerateColumns = false;

        if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
        {
            int buyerID = Convert.ToInt16(ds.Tables[0].Rows[0][0].ToString());
          if (custs() == null)
         //// if   (  Session["nonProfit"] == null)

            {

                BLCustomer cust = new BLCustomer(buyerID);
              ///////////  Session["nonProfit"] = cust;
                custs_ = cust;
            }
            else {
                custs().ID = buyerID;

                custs_ = custs();
               /// ((BLCustomer)Session["nonProfit"]).ID = buyerID;
            }

            dvmsg.InnerHtml = "you are now Log in ";
        }
        else
        {
            HtmlContainerControl dvmsg = (HtmlContainerControl)this.FindControl("dvmsg");

            dvmsg.InnerHtml = " Log in failed email & password not found";

        }
    }
Exemple #52
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string qry = Request.QueryString !=null  && Request.QueryString.Count>0 ?   Request.QueryString[0].ToString():  "" ;
        DataSet ds = new DataSet();
        String parm="Z";
             string commandtext="get_Items";
        int id=0;
        int orgid=0;
        int catid=0;
        int itemid =0;
        string status="";
        String auctiontype ="";
        int auctionid=     qry==null || qry == "" ?   0 :    (int) Convert.ToInt16 ( qry ) ;

        if (Application["cust"] == null)
        {

            BLCustomer cust = new BLCustomer(0);

            Application["cust"] = cust;

        }

        //try
        //{
        if (auctionid>0) {

            ds = item().GetAuctionItemt(item(), parm, commandtext, custs().ID, orgid, catid, itemid, status, auctiontype, auctionid);

        DataRow dr = ds.Tables[0].Rows[0];

        String Live =  dr["Live"].ToString();

            DateTime dtFuture = Convert.ToDateTime(dr["endTime"]);

            DateTime dtNow = new DateTime();
            // dtNow = DateTime.Now.AddMilliseconds(-messages.pennysec);
            dtNow = DateTime.Now;
            TimeSpan ts = new TimeSpan();// dtFuture.Subtract(dtNow);
            ts = dtFuture.Subtract(dtNow);
            long amountTime = (long)ts.TotalMilliseconds;
            HtmlContainerControl amount = (HtmlContainerControl)this.FindControl("amount");
            amount.InnerText = amountTime.ToString();// messages.amount_.ToString();
            // return amount;

          String buyerName = dr["buyer_name"].ToString();

          String currentbidPrice = dr["currentbidPrice"].ToString();

          String Credits = custs().Credits.ToString();// dr["Credits"].ToString();

          HtmlContainerControl loginorg = (HtmlContainerControl)this.FindControl("loginorg");
          loginorg.InnerText = custs()  == null || custs().signedinorgid == 0 ? "" : custs().signedinorgname;

          HtmlContainerControl logincust = (HtmlContainerControl)this.FindControl("logincust");
          logincust.InnerText = custs().CustName == null || custs().CustName == "" ? "" : custs().CustName;

        HtmlContainerControl buyer = (HtmlContainerControl)this.FindControl("buyer");
        buyer.InnerText = buyerName == null ? "" : buyerName.ToString();

        HtmlContainerControl price = (HtmlContainerControl)this.FindControl("price");
        price.InnerText = currentbidPrice.ToString();   //messages.currentBidAmount.ToString();

        HtmlContainerControl credits = (HtmlContainerControl)this.FindControl("credits");
        credits.InnerText =   Credits.ToString();   //messages.currentBidAmount.ToString();

        HtmlContainerControl live = (HtmlContainerControl)this.FindControl("live");
        live.InnerText = Live.ToString();   //messages.currentBidAmount.ToString();

        if (custs().ID == 0)
        {
            live.InnerText += "Register";
            //live.InnerText = "Sold";
        }

        }
        //}
        //catch (Exception) { }
    }