예제 #1
0
    protected void DataList1_UpdateCommand(object source, DataListCommandEventArgs e)
    {
        // Read in the ProductID from the DataKeys collection
        int productID = Convert.ToInt32(DataList1.DataKeys[e.Item.ItemIndex]);

        // Read in the product name and price values
        TextBox productName = (TextBox)e.Item.FindControl("ProductName");
        TextBox unitPrice = (TextBox)e.Item.FindControl("UnitPrice");

        string productNameValue = null;
        if (productName.Text.Trim().Length > 0)
            productNameValue = productName.Text.Trim();

        decimal? unitPriceValue = null;
        if (unitPrice.Text.Trim().Length > 0)
            unitPriceValue = Decimal.Parse(unitPrice.Text.Trim(), System.Globalization.NumberStyles.Currency);

        // Call the ProductsBLL's UpdateProduct method...
        ProductsBLL productsAPI = new ProductsBLL();
        productsAPI.UpdateProduct(productNameValue, unitPriceValue, productID);

        // Revert the DataList back to its pre-editing state
        DataList1.EditItemIndex = -1;
        DataList1.DataBind();
    }
 protected void dlList_ItemCommand(object source, DataListCommandEventArgs e)
 {
     if (e.CommandName == "btnLook")
     {
         HtmlInputHidden hidden = (HtmlInputHidden)e.Item.FindControl("tbID");
         if (hidden == null)
         {
             this.tbDetail.Text = "读 Log 数据异常 1。";
         }
         else
         {
             long num = _Convert.StrToLong(hidden.Value, -1L);
             if (num < 0L)
             {
                 this.tbDetail.Text = "读 Log 数据异常 2。";
             }
             else
             {
                 DataTable table = new Tables.T_ElectronTicketLog().Open("TransMessage", "[ID] = " + num.ToString(), "");
                 if ((table == null) || (table.Rows.Count < 1))
                 {
                     this.tbDetail.Text = "读 Log 数据异常 3。";
                 }
                 else
                 {
                     this.tbDetail.Text = table.Rows[0]["TransMessage"].ToString();
                 }
             }
         }
     }
 }
 public void AddShopCart(DataListCommandEventArgs e)
 {
     /*If login*/
     ST_check_Login();
     Hashtable hashCar;
     if (Session["ShopCart"] == null)
     {
         //if no shopping cart
         hashCar = new Hashtable();
         hashCar.Add(e.CommandArgument, 1);
         Session["ShopCart"] = hashCar;
     }
     else
     {
         //if has shopping cart
         hashCar = (Hashtable)Session["ShopCart"];//get hash table of cart
         if (hashCar.Contains(e.CommandArgument))//if this item in the cart, add 1
         {
             int count = Convert.ToInt32(hashCar[e.CommandArgument].ToString());//get the number of items
             hashCar[e.CommandArgument] = (count + 1);//add 1 item
         }
         else
             hashCar.Add(e.CommandArgument, 1);
     }
     Response.Redirect("~/Pages/User/ShoppingCart.aspx");
 }
 protected void dlCategory_ItemCommand(object source, DataListCommandEventArgs e)
 {
     if (e.CommandName == "select")
     {
         Response.Redirect("goodsList.aspx?id=" + e.CommandArgument);
     }
 }
예제 #5
0
    //update delete function to update and delete contacts
    protected void subUpDel(object sender, DataListCommandEventArgs e)
    {
        switch (e.CommandName)
        {
            case "Update":
                TextBox txtfname = (TextBox)e.Item.FindControl("txt_fnameU");
                //TextBox txtMessage = (TextBox)e.Item.FindControl("txt_messageU");
                TextBox txtlname = (TextBox)e.Item.FindControl("txt_lnameU");

                //DropDownList ddldept = (DropDownList)e.Item.FindControl("ddl_deptU");
                //ddldept.DataTextField = "ddl_deptU";
                //TextBox txtdept = (TextBox)e.Item.FindControl("txt_deptU");
                TextBox txtemail = (TextBox)e.Item.FindControl("txt_emailU");
                HiddenField hdfID = (HiddenField)e.Item.FindControl("hdf_idU");

                int contactID = int.Parse(hdfID.Value.ToString());
                _strMessage(objContact.commitUpdate(contactID, txtfname.Text, txtlname.Text,txtemail.Text), "update");
                _subRebind();
                break;
            case "Delete":
                int _id = int.Parse(((HiddenField)e.Item.FindControl("hdf_idD")).Value);
                _strMessage(objContact.commitDelete(_id), "delete");
                _subRebind();
                break;
            case "Cancel":
                _subRebind();
                      break;
                
        }
    }
    protected void dlCancellationDetails_ItemCommand(object source, DataListCommandEventArgs e)
    {
        if(e.CommandName.Equals(""))
        {

        }
    }
    protected void dlCancellationDetails_UpdateCommand(object source, DataListCommandEventArgs e)
    {
        DataModel.AdminDM objDataModel = new DataModel.AdminDM();
        BusinessLogic.AdminBL objBusinessLogic = new BusinessLogic.AdminBL();

        TextBox txtCancel = (TextBox)e.Item.FindControl("txtCancellationPercentage");

        objDataModel._id=Convert.ToInt16( dlCancellationDetails.DataKeys[e.Item.ItemIndex]);
        objDataModel._cancellationPercent =Convert.ToInt16( txtCancel.Text.Trim());

        if (Convert.ToBoolean(objBusinessLogic.updateCancellationDetails(objDataModel)))
        {
            dlCancellationDetails.EditItemIndex = -1;
            dlCancellationDetails.DataBind();
            bindCancellationDetails();
            lblMessage.Text = "Updated Succesfully";
            lblMessage.ForeColor = System.Drawing.Color.Green;
            lblMessage.Visible = true;
        }
        else
        {
            lblMessage.Text = "cannot update cancellation Percent";
            lblMessage.ForeColor = System.Drawing.Color.Red;
            lblMessage.Visible = true;
        }
    }
예제 #8
0
    protected void DataListworks_ItemCommand(object source, DataListCommandEventArgs e)
    {
        int Wscore = 0;
        int Wid = Int32.Parse(DataListworks.DataKeys[e.Item.ItemIndex].ToString());
        LearnSite.BLL.Works ws = new LearnSite.BLL.Works();

        if (e.CommandName == "G")
        {
            Wscore = 12;
            ws.WgoodBest(Wid);
        }
        else
        {
            if (e.CommandName == "A")
            {
                Wscore = 10;
            }
            if (e.CommandName == "P")
            {
                Wscore = 6;
            }
            if (e.CommandName == "E")
            {
                Wscore = 2;
            }
            ws.WgoodNormal(Wid);
        }
        ws.ScoreWork(Wid, Wscore);
        System.Threading.Thread.Sleep(500);
        ShowWorks();
    }
예제 #9
0
    EP ep = new EP(); //实例化一个对象

    #endregion Fields

    #region Methods

    protected void dlSoftIntro_ItemCommand(object source, DataListCommandEventArgs e)
    {
        if (e.CommandName == "Xiangxi")
        {
            Response.Redirect("list_softdownload.aspx");//将页面跳转到list_softdownload.aspx页面中
        }
    }
    protected void ddlWomen_ItemCommand(object source, DataListCommandEventArgs e)
    {
        switch (e.CommandName)
        {
            case "cha":
                if (items.BuyTimesAdd(int.Parse(e.CommandArgument.ToString())))
                {
                    Response.Redirect("HotmallDetails.aspx?ProductID=" + e.CommandArgument.ToString() + "");
                }
                break;
            case "buy":
                if (Session["UID"] == null || Session["UID"] == "")
                {
                    Response.Write("<script language=javascript> alert('请先登录!'); </script> ");
                }
                else
                {
                    if (car.Buy(int.Parse(e.CommandArgument.ToString()), int.Parse(Session["UID"].ToString())))
                    {
                        items.ViewTimesAdd(int.Parse(e.CommandArgument.ToString()));
                        Response.Write("<script language=javascript> alert('购买一件成功!请到个人中心继续付款!'); </script> ");

                    }
                    else
                    {
                        Response.Write("<script language=javascript> alert('购买失败!'); </script> ");
                    }
                }
                break;
        }
    }
 public void gridManage_ItemCommand(object sender, DataListCommandEventArgs e)
 {
     switch (e.CommandName)
     {
         case "Delete":
             {
                 int id = int.Parse(e.CommandArgument.ToString());
                 SessionManager.Delete<TransitAccountStoryPicture>(id, SessionManager.StoryService.DeleteAccountStoryPicture);
                 ReportInfo("Picture deleted.");
                 GetData(sender, e);
             }
             break;
         case "Right":
             {
                 int id = int.Parse(e.CommandArgument.ToString());
                 SessionManager.StoryService.MoveAccountStoryPicture(SessionManager.Ticket, id, 1);
                 if (e.Item.ItemIndex + 1 == gridManage.Items.Count && gridManage.CurrentPageIndex + 1 < gridManage.PagedDataSource.PageCount)
                     gridManage.CurrentPageIndex++;
                 SessionManager.InvalidateCache<TransitAccountStoryPicture>();
                 gridManage_OnGetDataSource(sender, e);
                 gridManage.DataBind();
             }
             break;
         case "Left":
             {
                 int id = int.Parse(e.CommandArgument.ToString());
                 SessionManager.StoryService.MoveAccountStoryPicture(SessionManager.Ticket, id, -1);
                 if (e.Item.ItemIndex == 0 && gridManage.CurrentPageIndex > 0) gridManage.CurrentPageIndex--;
                 SessionManager.InvalidateCache<TransitAccountStoryPicture>();
                 gridManage_OnGetDataSource(sender, e);
                 gridManage.DataBind();
             }
             break;
     }
 }
예제 #12
0
    public void gridManage_ItemCommand(object source, DataListCommandEventArgs e)
    {
        int id = int.Parse(e.CommandArgument.ToString());

        switch (e.CommandName)
        {
            case "Delete":
                SessionManager.Delete<TransitAccountStoryPicture>(id, SessionManager.StoryService.DeleteAccountStoryPicture);
                ReportInfo("Image deleted.");
                GetImagesData(source, e);
                break;
            case "Up":
                SessionManager.StoryService.MoveAccountStoryPicture(SessionManager.Ticket, id, -1);
                GetImagesData(source, e);
                break;
            case "Down":
                SessionManager.StoryService.MoveAccountStoryPicture(SessionManager.Ticket, id, 1);
                GetImagesData(source, e);
                break;
            case "Insert":
                inputSummary.Content = inputSummary.Content +
                        string.Format("<P><IMG SRC=\"AccountStoryPicture.aspx?id={0}\" WIDTH=\"250\" /></P>", id);
                break;
        }
    }
예제 #13
0
 protected void DataList1_DeleteCommand(object source, DataListCommandEventArgs e)
 {
     string strid = this.DataList1.DataKeys[e.Item.ItemIndex].ToString(); //获取当前DataList控件列
     string strSql = "Delete from tb_Reply where ID='" + Convert.ToInt32(strid) + "'";
     dbObj.ExecNonQuery(dbObj.GetCommandStr(strSql));
     Page.Response.Redirect("LeaveWordView.aspx?ID=" + Request["ID"].ToString() + "");
 }
예제 #14
0
 protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
 {
     switch (e.CommandName)
     {
         case "first": pds1.CurrentPageIndex = 0;
             BindDataList(pds1.CurrentPageIndex, pds2.CurrentPageIndex);
             break;
         case "last": pds1.CurrentPageIndex = pds1.PageCount - 1;
             BindDataList(pds1.CurrentPageIndex, pds2.CurrentPageIndex);
             break;
         case "pre": pds1.CurrentPageIndex = pds1.CurrentPageIndex - 1;
             BindDataList(pds1.CurrentPageIndex, pds2.CurrentPageIndex);
             break;
         case "next": pds1.CurrentPageIndex = pds1.CurrentPageIndex + 1;
             BindDataList(pds1.CurrentPageIndex, pds2.CurrentPageIndex);
             break;
         case "search":
             if (e.Item.ItemType == ListItemType.Footer)
             {
                 int pageCount = int.Parse(pds1.PageCount.ToString());
                 TextBox txtpage = e.Item.FindControl("txtPage") as TextBox;
                 int myPageNum = 0;
                 if (!txtpage.Text.Equals(""))
                 {
                     myPageNum = Convert.ToInt32(txtpage.Text.ToString());
                     if (myPageNum <= 0 || myPageNum > pageCount)
                     {
                         Response.Write("<Script>alert('请重新输入页码!')</Script>");
                     }
                     else BindDataList((myPageNum - 1), pds2.CurrentPageIndex);
                 }
             }
             break;
     }
 }
    protected void dlTourArea_ItemCommand(object source, DataListCommandEventArgs e)
    {
        if (e.CommandName == "Select")
        {
            Label lblLine = (Label)e.Item.FindControl("lblLine");

            if (!string.IsNullOrEmpty(lblLine.Text.Trim()))
            {
                string citys = lblLine.Text.Trim().Replace(@",", @";");

                string[] Citys = citys.Split(new char[] { ';' });

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

                for (int i = 0; i < Citys.Length; i++)
                {
                    listCity.Add(Citys[i]);
                }

                string city = listCity[0];

                Terms.Common.Domain.City City = m_CommonService.FindCityByCityCode(city);

                if (City != null)
                {
                    Label lblID = (Label)e.Item.FindControl("lblID");

                    Utility.TourCitys = listCity;
                    Utility.IsTourMain = true;
                    Utility.IsTourMore = true;

                    TourSearchCondition tourSearchCondition = new TourSearchCondition();

                    if (City.CountryCode == "US")
                    {
                        tourSearchCondition.Region = "U.S.";
                    }
                    else
                    {
                        tourSearchCondition.Region = City.CountryCode;
                    }
                    tourSearchCondition.Counrty = City.CountryCode ;
                    tourSearchCondition.CityList = listCity;
                    tourSearchCondition.City = city;
                    tourSearchCondition.DeptCity = city;
                    tourSearchCondition.IsLandOnly = true;
                    tourSearchCondition.PriceType = TERMS.Common.TourPriceType.All;
                    tourSearchCondition.TravelBeginDate = DateTime.Now.Date.AddDays(7);
                    tourSearchCondition.TravelDaysFrom = 1;
                    tourSearchCondition.TravelDaysTo = 800;
                    this.Transaction.IntKey = tourSearchCondition.GetHashCode();
                    this.Transaction.CurrentSearchConditions = tourSearchCondition;
                    this.Transaction.CurrentTransactionObject = new TERMS.Business.Centers.SalesCenter.TransactionObject();
                    //��¼Search More�¼�
                    OperaterAdvice.DoAdvice(Terms.Configuration.Utility.ConfigurationConst.OperateType.MV_SearchMoreTour, this);
                    this.Response.Redirect("~/Page/Common/Searching1.aspx?TourArea=" + Server.UrlEncode("U.S.") + "&ConditionID=" + Utility.Transaction.IntKey.ToString() + "&Type=More&target=~/Page/Tour/NewTourMoreSearchResultForm" + "&TopDestinations=" + lblID.Text);
                }
            }
        }
    }
 protected void g_ItemCommand(object source, DataListCommandEventArgs e)
 {
     if (e.CommandName == "btnQuash")
     {
         long siteid = _Convert.StrToLong(((HtmlInputHidden)e.Item.FindControl("tbSiteID")).Value, -1L);
         long num2 = _Convert.StrToLong(((HtmlInputHidden)e.Item.FindControl("tbInitiateUserID")).Value, -1L);
         long schemeID = _Convert.StrToLong(((HtmlInputHidden)e.Item.FindControl("tbSchemeID")).Value, -1L);
         if (((siteid < 0L) || (num2 < 0L)) || (schemeID < 0L))
         {
             PF.GoError(1, "参数错误", "Admin_SchemeQuash");
         }
         else
         {
             Users users = new Users(siteid)[siteid, num2];
             if (users == null)
             {
                 PF.GoError(4, "数据库繁忙,请重试", "Admin_SchemeQuash");
             }
             else
             {
                 string returnDescription = "";
                 if (users.QuashScheme(schemeID, true, ref returnDescription) < 0)
                 {
                     PF.GoError(1, returnDescription, "Admin_SchemeQuash");
                 }
                 else
                 {
                     new Tables.T_UserDetails { Memo = { Value = "投注通讯故障撤单" } }.Update("SchemeID = " + schemeID.ToString() + " and OperatorType = 9");
                     this.BindData();
                 }
             }
         }
     }
 }
예제 #17
0
 protected void subUpDel(object sender, DataListCommandEventArgs e)
 {
     switch (e.CommandName)
     {
         case "Update":
             TextBox txtTitle = (TextBox)e.Item.FindControl("txt_titleU");
             TextBox txtLocation = (TextBox)e.Item.FindControl("txt_locationU");
             TextBox txtDate = (TextBox)e.Item.FindControl("txt_dateU");
             TextBox txtDepartment = (TextBox)e.Item.FindControl("txt_departmentU");
             TextBox txtShift = (TextBox)e.Item.FindControl("txt_shiftU");
             TextBox txtHours = (TextBox)e.Item.FindControl("txt_hoursU");
             TextBox txtDescription = (TextBox)e.Item.FindControl("txt_descriptionU");
             TextBox txtWage = (TextBox)e.Item.FindControl("txt_wageU");
             HiddenField hdfID = (HiddenField)e.Item.FindControl("hdf_id");
             int postID = int.Parse(hdfID.Value.ToString());
             _strMessage(objLinq.commitUpdate(postID, txtTitle.Text, txtLocation.Text, txtDate.Text, txtDepartment.Text, txtShift.Text, txtHours.Text, txtDescription.Text, decimal.Parse(txtWage.Text.ToString())), "update");
             _subRebind();
             break;
         case "Delete":
             int _id = int.Parse(((HiddenField)e.Item.FindControl("hdf_id")).Value);
             _strMessage(objLinq.commitDelete(_id), "delete");
             _subRebind();
             break;
         case "Cancel":
             _subRebind();
             break;
     }
 }
예제 #18
0
 protected void employeesList_ItemCommand(object source, DataListCommandEventArgs e)
 {
     // Which button was clicked?
     if (e.CommandName == "MoreDetailsPlease")
     {
       // Find the Literal control in the DataList item
       Literal li;
       li = (Literal)e.Item.FindControl("extraDetailsLiteral");
       // Add content to the Literal control
       li.Text = "Employee ID: <strong>" + e.CommandArgument +
       "</strong><br />";
     }
     else if (e.CommandName == "EditItem")
     {
       // Set the index of the item being edited
       employeesList.EditItemIndex = e.Item.ItemIndex;
       // update the DataList
       BindList();
     }
     else if (e.CommandName == "CancelEditing")
     {
       // Cancel edit mode
       employeesList.EditItemIndex = -1;
       // Refresh the DataList
       BindList();
     }
 }
예제 #19
0
 // fires when an Add to Cart button is clicked
 protected void list_ItemCommand(object source, DataListCommandEventArgs e)
 {
     // The CommandArgument of the clicked Button contains the ProductID
     string productId = e.CommandArgument.ToString();
     // Add the product to the shopping cart
     ShoppingCartAccess.AddItem(productId);
 }
예제 #20
0
 /// <summary>
 /// 向购物车中添加新商品
 /// </summary>
 /// <param name="e">
 /// 获取或设置可选参数,
 /// 该参数与关联的 CommandName 
 /// 一起被传递到 Command 事件。
 /// </param> 
 public void AddShopCart(DataListCommandEventArgs e)
 {
     //if (Session["UserName"] == null)
     //{
     //    Response.Redirect("Default.aspx");
     //}
     /*判断是否登录*/
     ST_check_Login();
     Hashtable hashCar;
     if (Session["ShopCart"] == null)
     {
         //如果用户没有分配购物车
         hashCar = new Hashtable();         //新生成一个
         hashCar.Add(e.CommandArgument, 1); //添加一个商品
         Session["ShopCart"] = hashCar;     //分配给用户
     }
     else
     {
         //用户已经有购物车
         hashCar = (Hashtable)Session["ShopCart"];//得到购物车的hash表
         if (hashCar.Contains(e.CommandArgument))//购物车中已有此商品,商品数量加1
         {
             int count = Convert.ToInt32(hashCar[e.CommandArgument].ToString());//得到该商品的数量
             hashCar[e.CommandArgument] = (count + 1);//商品数量加1
         }
         else
             hashCar.Add(e.CommandArgument, 1);//如果没有此商品,则新添加一个项
     }
 }
예제 #21
0
 void gvCreditCards_EditCommand(object source, DataListCommandEventArgs e)
 {
     string id = (string)e.CommandArgument;
     CreditCardDetails1.Visible = true;
     CreditCardDetails1.ShowDetails(id);
     gvCreditCards.Visible = false;
 }
예제 #22
0
    protected void dlCities_UpdateCommand(object source, DataListCommandEventArgs e)
    {
        BusinessLogic.AdminBL objBusinesslogic = new BusinessLogic.AdminBL();
        DataModel.AdminDM objDataModel = new DataModel.AdminDM();

        TextBox txtCityId = (TextBox)e.Item.FindControl("txtCityId");
        TextBox txtCityName = (TextBox)e.Item.FindControl("txtCityName");

        objDataModel._id =Convert.ToInt16( dlCities.DataKeys[e.Item.ItemIndex]);
        objDataModel._cityId = txtCityId.Text.Trim();
        objDataModel._cityName = txtCityName.Text.Trim();

        if (Convert.ToBoolean(objBusinesslogic.UpdateCity(objDataModel)))
        {
            dlCities.EditItemIndex = -1;
            lblErrorMessage.Text = "Updated Succesfully";
            lblErrorMessage.ForeColor = System.Drawing.Color.Green;
            Bindcities();
        }
        else
        {
            lblErrorMessage.Text = "cannot update city";
            lblErrorMessage.ForeColor = System.Drawing.Color.Green;
        }
    }
예제 #23
0
    protected void dlTourProduct_ItemCommand(object source, DataListCommandEventArgs e)
    {
        int index = 0;//e.Item.ItemIndex + PageNumber1.PageSize * PageNumber1.CurrentPageIndex;
        Label lkTourName = (Label)e.Item.FindControl("lblTourName");
        for (int i = 0; i < tourMerchandise.Items.Count; i++)
        {
            TourMaterial tm = (TourMaterial)tourMerchandise.Items[i];
            if (tm.Profile.Name.Equals(lkTourName.Text))
            {
                index = i;
                break;
            }
        }

         if (e.CommandName == "Select")
         {
             TourSearchCondition tourSearchCondition = (TourSearchCondition)Utility.Transaction.CurrentSearchConditions;
             tourSearchCondition.Counrty = ((Terms.Product.Business.MVTourProfile)((TourMaterial)tourMerchandise.Items[index]).Profile).StartCity.Country.Code;
             tourSearchCondition.City = ((Terms.Product.Business.MVTourProfile)((TourMaterial)tourMerchandise.Items[index]).Profile).StartCity.Code;
             tourSearchCondition.DeptCity = ((Terms.Product.Business.MVTourProfile)((TourMaterial)tourMerchandise.Items[index]).Profile).DefaultDepartureCity.Code;
             this.Transaction.IntKey = tourSearchCondition.GetHashCode();
             this.Transaction.CurrentSearchConditions = tourSearchCondition;
             this.Response.Redirect("TourSelectTourForm.aspx?ReturnURL=TourSearchResultForm.aspx");
         }
    }
예제 #24
0
    protected void DlNewGoods_UpdateCommand(object source, DataListCommandEventArgs e)
    {
        //*** CategoryID ***//
        Label lblCateID = (Label)(e.Item.FindControl("lblCateID"));
        //*** Category ***//
        TextBox txtCategory = (TextBox)(e.Item.FindControl("txtCategory"));

        strSQL = "UPDATE category SET CategoryName = '" + txtCategory.Text + "' " +
            " WHERE CategoryID = " + lblCateID.Text + " ";
        objCmd = new MySqlCommand(strSQL, objConn);
        objCmd.ExecuteNonQuery();

        //*** If Select File Upload ***//
        HtmlInputFile filPicture = (HtmlInputFile)(e.Item.FindControl("filPicture"));
        String strFileName;
        if (filPicture.PostedFile.FileName != "")
        {
            strFileName = System.IO.Path.GetFileName(filPicture.Value);
            filPicture.PostedFile.SaveAs(Server.MapPath("images/" + strFileName));
            strSQL = "UPDATE category SET Picture = 'images/" + strFileName + "' " +
                " WHERE CategoryID = " + lblCateID.Text + " ";
            objCmd = new MySqlCommand(strSQL, objConn);
            objCmd.ExecuteNonQuery();
        }

        DlNewGoods.EditItemIndex = -1;
        BindData();
    }
    public void AddShopCart(DataListCommandEventArgs e, DataList DLName)
    {
        if (Session["UID"] != null)
        {
            SaveSubGoodsClass Goods = null;
            Goods = GetSubGoodsInformation(e, DLName);
            if (Goods == null)
            {
                //Show wrong information
                Response.Write("<script>alert('No useful data');</script>");
                return;
            }
            else
            {
                ucObj.AddShopCart(Goods.GoodsID, Goods.MemberPrice, Convert.ToInt32(Session["UID"].ToString()), Goods.GoodsWeight);
                Response.Write("<script>alert('Congratulations! Add Item Successfully!')</script>");

            }
        }
        else
        {
            Response.Write("<script>alert('Please Log in First!');</script>");

        }
    }
    public void listPending_ItemCommand(object sender, DataListCommandEventArgs e)
    {
        switch (e.CommandName)
        {
            case "Accept":
                {
                    int id = int.Parse(e.CommandArgument.ToString());
                    SessionManager.SocialService.AcceptAccountFriendRequest(SessionManager.Ticket, id, inputReason.Text);
                    GetData(sender, e);
                    ReportInfo("Friend request accepted." +
                        (string.IsNullOrEmpty(inputReason.Text) ? string.Empty : " An e-mail was sent."));
                    break;
                }
            case "Reject":
                {
                    int id = int.Parse(e.CommandArgument.ToString());
                    SessionManager.SocialService.RejectAccountFriendRequest(SessionManager.Ticket, id, inputReason.Text);
                    GetData(sender, e);
                    ReportInfo("Friend request rejected." +
                        (string.IsNullOrEmpty(inputReason.Text) ? string.Empty : " An e-mail was sent."));
                    break;
                }
        }

        SessionManager.InvalidateCache<TransitAccountFriendRequest>();
    }
예제 #27
0
    EP ep = new EP(); //实例化对象

    #endregion Fields

    #region Methods

    protected void DlLeibie_UpdateCommand(object source, DataListCommandEventArgs e)
    {
        //声明一个string类型的变量id,并且将主键的值赋值给id
        string id = this.DlLeibie.DataKeys[e.Item.ItemIndex].ToString();
        //跳转到softleibie.aspx页面中,并将id的值传递到softleibie.aspx页面中去
        Response.Redirect("softleibie.aspx?id=" + id + "");
    }
예제 #28
0
 protected void DataList1_DeleteCommand(object source, DataListCommandEventArgs e)
 {
     SqlDataSource3.DeleteParameters["code"].DefaultValue = DataList1.DataKeys[e.Item.ItemIndex].ToString();
     SqlDataSource3.Delete();
     DataList1.DataBind();
     DropDownList2.DataBind();
 }
예제 #29
0
    protected void DataList1_DeleteCommand(object source, DataListCommandEventArgs e)
    {
        if (CartView.Table.Rows.Count > e.Item.ItemIndex)
            CartView.Table.Rows.RemoveAt(e.Item.ItemIndex);

        BindList();
    }
예제 #30
0
    protected void dlList_ItemCommand(object source, DataListCommandEventArgs e)
    {
        if (e.CommandName == "breaker")
        {
            BreakerModel breakerModel	= new BreakerModel();
            breakerModel.UserIP			= e.CommandArgument.ToString();

            if (BreakerManager.GetInstance().InsertBreaker(breakerModel) == -1)
            {
                Umc.Core.Util.Utility.JS_Alert(this, BreakerConst.MESSAGE_BREAKER_ALREADY_INSERT);
            }
            else
            {
                Umc.Core.Util.Utility.JS_Alert(this, BreakerConst.MESSAGE_BREAKER_INSERT);
            }
        }
        else if (e.CommandName == "unbreaker")
        {
            if (BreakerManager.GetInstance().RemoveBreaker(e.CommandArgument.ToString()))
            {
                Umc.Core.Util.Utility.JS_Alert(this, BreakerConst.MESSAGE_BREAKER_REMOVE);
            }
            else
            {
                Umc.Core.Util.Utility.JS_Alert(this, BreakerConst.MESSAGE_BREAKER_CAN_NOT_REMOVE);
            }
        }
        bind();
    }
    // silver //

    protected void DataList3_ItemCommand(object source, DataListCommandEventArgs e)
    {
        DataList8.SelectedIndex = e.Item.ItemIndex;


        int seatid = Convert.ToInt16(e.CommandArgument);



        LinkButton l5;

        l5 = (LinkButton)DataList8.Items[DataList8.SelectedIndex].FindControl("l5");


        //a11.Add(l1.Text);

        //Session["a1"] = a11;



        if (l5.Text != " ")
        {
            if (l5.BackColor.Name == "CornflowerBlue")
            {
                l5.BackColor = System.Drawing.Color.LightGreen;
            }
            else
            {
                l5.BackColor = System.Drawing.Color.FromName("CornflowerBlue");
            }
        }



        //class       obj       class
        SqlConnection con2 = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\userside.mdf;Integrated Security=True;User Instance=True");

        string str2;

        str2 = "update Seat_Master set status='Book' where Seatid=" + seatid + "";

        SqlCommand cmd2 = new SqlCommand(str2, con2);

        con2.Open();

        cmd2.ExecuteNonQuery();



        SqlConnection con1 = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\userside.mdf;Integrated Security=True;User Instance=True");

        string str1 = "insert into Booking_master(userid,movieid,TheatreId,Seatid,username,moviename,bookedticket,price,bookingdate,category,Screenname,timing,seatno)values(" + Session["userid"] + "," + Session["movieid"] + "," + ViewState["TheatreId"] + "," + seatid + ",'" + Session["UserName"] + "','" + lblMoviName.Text + "','" + DropDownList2.SelectedItem.Text + "','" + lblRate.Text + "','" + lblMoviesDate.Text + "','" + DropDownList1.SelectedItem.Text + "','" + lblSid.Text + "','" + lblShowtime.Text + "','" + l5.Text + "')";

        con1.Open();

        SqlCommand cmd1 = new SqlCommand(str1, con1);

        cmd1.ExecuteNonQuery();
        m.ExecuteNonQuery1("insert into Total_Seat values(" + seatid + "," + ViewState["TheatreId"] + ",'" + lblScreen.Text + "','" + lblShowtime.Text + "','Book','" + lblMoviesDate.Text + "')");

        Label2.Text = "Seat Booked.";
        //Response.Redirect ( "Seeticket.aspx");

        con1.Close();
    }
예제 #32
0
 protected void sd(object source, DataListCommandEventArgs e)
 {
 }
예제 #33
0
 protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
 {
     txtCounties.Text += e.CommandArgument.ToString();
 }
예제 #34
0
 protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
 {
     string a = e.ToString();
 }
예제 #35
0
        protected void DataList1_UpdateCommand(object source, DataListCommandEventArgs e)
        {
            string prodID     = "";
            Label  tempProdID = DataList1.Items[e.Item.ItemIndex].FindControl("productId1") as Label;

            prodID = tempProdID.Text;

            DataContextDataContext db = new DataContextDataContext();
            ArtistUpload           currentArtistUpload = db.ArtistUploads.Single(pId => pId.productID == int.Parse(prodID));

            // Get updated image
            FileUpload updateImage = (FileUpload)DataList1.Items[DataList1.EditItemIndex].FindControl("FileUpload1");

            byte[] img = new byte[updateImage.PostedFile.ContentLength];
            updateImage.PostedFile.InputStream.Read(img, 0, img.Length);

            // If have update image then save into the database
            if (updateImage.HasFile)
            {
                // Validate only allows the seller to upload image of type
                // jpg, JPG, jpeg, JPEG, png, PNG, gif, GIF, bmp, BMP
                Regex regex = new Regex(@"(.*?)\.(jpg|JPG|jpeg|JPEG|png|PNG|gif|GIF|bmp|BMP)$");
                if (regex.IsMatch(updateImage.FileName))
                {
                    currentArtistUpload.artImage = img;
                }
                else
                {
                    Response.Write("<script>alert('Upload can only be image of type jpg, JPG, jpeg, JPEG, png, PNG, gif, GIF, bmp, BMP, your changes made to this image has been rejected!')</script>");
                }
            }

            TextBox txtTemp = DataList1.Items[e.Item.ItemIndex].FindControl("TextBox1") as TextBox;

            if (txtTemp != null)
            {
                currentArtistUpload.productname = txtTemp.Text;
            }

            txtTemp = DataList1.Items[e.Item.ItemIndex].FindControl("TextBox2") as TextBox;
            if (txtTemp != null)
            {
                currentArtistUpload.description = txtTemp.Text;
            }

            txtTemp = DataList1.Items[e.Item.ItemIndex].FindControl("TextBox3") as TextBox;
            if (txtTemp != null)
            {
                currentArtistUpload.quantity = int.Parse(txtTemp.Text);
            }

            txtTemp = DataList1.Items[e.Item.ItemIndex].FindControl("TextBox4") as TextBox;
            if (txtTemp != null)
            {
                currentArtistUpload.productPrice = decimal.Parse(txtTemp.Text);
            }

            db.SubmitChanges();
            DataList1.EditItemIndex = -1;
            BindUploadProduct();
        }
예제 #36
0
 protected void DataList1_EditCommand(object source, DataListCommandEventArgs e)
 {
     DataList1.EditItemIndex = e.Item.ItemIndex;
     BindUploadProduct();
 }
예제 #37
0
    //the item command event is to be raised when any button is clicked in the DataList control.
    protected void Datalist1_ItemCommand(object source, DataListCommandEventArgs e)
    {
        int    quantityInBasket  = 0;
        String qtyToUpdate       = "";
        int    quantityToUpdate  = 0;
        int    availableQuantity = 0;
        String productID         = "";
        double totalPrice        = 0;
        double newTotalPrice     = 0;
        double grandTotal        = 0;


        //if the command name of the control(button) is the updateQuantity, then do the following operation..
        if (e.CommandName == "updateQuantity")
        {
            TextBox qtyTxt = (TextBox)e.Item.FindControl("quantityToUpdateTxt");    //gets the quantity for the selected item in the datalist.
            if (!qtyTxt.Text.Equals(null))
            {
                if (DataList1.Items.Count > 0)
                {
                    qtyToUpdate      = qtyTxt.Text;
                    quantityToUpdate = System.Convert.ToInt32(qtyToUpdate);
                }
            }

            Label productIDLbl = (Label)e.Item.FindControl("bookIDLbl");
            productID = productIDLbl.Text;

            Label  priceLbl  = (Label)e.Item.FindControl("priceLbl");
            String tempPrice = priceLbl.Text;
            totalPrice = System.Convert.ToDouble(tempPrice);

            Label  availableQtyLbl = (Label)e.Item.FindControl("availableQtyLbl");
            String availableQty    = availableQtyLbl.Text;
            availableQuantity = System.Convert.ToInt32(availableQty);

            Label  qtyInBasketLbl = (Label)e.Item.FindControl("qtyInBasketLbl");
            String qtyInBasket    = qtyInBasketLbl.Text;
            quantityInBasket = System.Convert.ToInt32(qtyInBasket);

            //the total price for one particular item in the basket is the price per quantity plus quantity to be updated.
            newTotalPrice = totalPrice * quantityToUpdate;

            //incrementing the grand total price eveytime customer updates the quantity in the basket.
            grandTotal += newTotalPrice;

            //checking to make sure if the quantity customer wants to update is more or less than the available quantity
            if (quantityToUpdate > availableQuantity)
            {
                messageLbl.ForeColor = System.Drawing.Color.Black;
                messageLbl.BackColor = System.Drawing.Color.Yellow;
                messageLbl.Text      = "Quantity Limit Exceeded!" + "<br />" + "You want: " + qtyToUpdate + "<br />" + "Available: " + availableQuantity;
            }
            else
            {
                //if the quanity to update is less than or equal to available quantity, then do the following..

                string updateQtyQuery;
                //an SQL query for updating the quantity in the basket for a specified product and customer.
                updateQtyQuery = "update Basket set quantity=" + quantityToUpdate + ", totalPrice=" + grandTotal + "where customerID =" + customerID + "and productID='" + productID + "'";
                basketDataSource.SelectCommand = updateQtyQuery;
                basketDataList.DataBind();
                Response.Redirect("basket.aspx");

                grandTotalLbl.Text = "Total Price: £" + grandTotal;     //displaying the grand total price after a successful quantity updation.
            }
        }

        //if the command name of the control(button) is the deleteItem, then do the following operation..
        if (e.CommandName == "deleteItem")
        {
            //get the productID of item that needs to be deleted.
            Label productIDLbl = (Label)e.Item.FindControl("bookIDLbl");
            productID = productIDLbl.Text;

            string deleteItemQuery;
            //an SQL query for deleting the product from the basket for a specified product and a customer.
            deleteItemQuery = "delete from Basket where customerID=" + customerID + "and productID='" + productID + "'";
            basketDataSource.SelectCommand = deleteItemQuery;
            basketDataList.DataBind();
            Response.Redirect("basket.aspx");
        }
    }
예제 #38
0
        protected void dlItem_ItemCommand(object sender, DataListCommandEventArgs e)
        {
            int          attributeId           = e.Item.ItemIndex > -1 ? (int)dlAttributes.DataKeys[e.Item.ItemIndex] : -1;
            TextBox      txtAttributeName      = e.Item.FindControl("txtAttributeName") as TextBox;
            TextBox      txtDescription        = e.Item.FindControl("txtDescription") as TextBox;
            DropDownList ddlAttributeValueType = e.Item.FindControl("ddlAttributeValueType") as DropDownList;
            Literal      litAttributeName      = e.Item.FindControl("litAttributeName") as Literal;
            bool         success = false;

            ShowMessage(string.Empty);

            switch (e.CommandName)
            {
            case "Add":
                dlAttributes.EditItemIndex = -1;
                HtmlTableRow addNewContainer = e.Item.FindControl("addNewContainer") as HtmlTableRow;
                addNewContainer.Visible             = true;
                txtAttributeName.Text               = "";
                txtDescription.Text                 = "";
                ddlAttributeValueType.SelectedIndex = 0;
                ShowError(string.Empty);
                break;

            case "Insert":
                if (!ValidateAttributeEntry(e))
                {
                    txtAttributeName.Focus();
                    return;
                }

                ShowError(string.Empty);

                ObjectAttribute.SaveAttribute(txtAttributeName.Text.Trim(), txtDescription.Text.Trim());

                ShowMessage(string.Format("Attribubute '{0}' successfully created.", txtAttributeName.Text.Trim()));

                dlAttributes.EditItemIndex = -1;
                PopulateAttributes();
                break;

            case "Edit":
                dlAttributes.EditItemIndex = e.Item.ItemIndex;
                PopulateAttributes();
                break;

            case "Update":
                if (!ValidateAttributeEntry(e))
                {
                    txtAttributeName.Focus();
                    return;
                }

                ShowError(string.Empty);

                // save attribute
                ObjectAttribute.SaveAttributeById(attributeId, txtAttributeName.Text.Trim(), txtDescription.Text.Trim(), ddlAttributeValueType.SelectedItem.Text);

                ShowMessage(string.Format("Attribubute '{0}' successfully updated.", txtAttributeName.Text.Trim()));

                dlAttributes.EditItemIndex = -1;
                PopulateAttributes();
                break;

            case "Delete":

                success = true;

                try
                {
                    ObjectAttribute.DeleteAttribute(litAttributeName.Text);
                }
                catch (Exception ex)
                {
                    success = false;
                    ShowError(string.Format("Errors encountered while deleting attribute '{0}' (possibly due associated values): <br/>" + ex.Message, litAttributeName.Text));
                }

                if (success)
                {
                    ShowMessage(string.Format("Attribute '{0}' successfully deleted.", litAttributeName.Text));
                }

                PopulateAttributes();

                break;

            case "Cancel":
                dlAttributes.EditItemIndex = -1;
                ShowError(string.Empty);
                PopulateAttributes();
                mpePopup.Hide();
                break;
            }
        }
예제 #39
0
 protected void DataList1_CancelCommand(object source, DataListCommandEventArgs e)
 {
     DataList1.EditItemIndex = -1;
     DataList1.DataBind();
 }
예제 #40
0
 protected void DLOfferList_ItemCommand(object source, DataListCommandEventArgs e)
 {
 }
예제 #41
0
 protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
 {
     Response.Redirect("View.aspx?idd=" + e.CommandArgument.ToString());
 }
예제 #42
0
        protected void DataList2_ItemCommand(object source, DataListCommandEventArgs e)
        {
            if (Email.Text.Trim() != "")
            {
                if (e.CommandName == "detail")
                {
                    int id = Convert.ToInt32(e.CommandArgument);

                    //try
                    SqlCommand cmd = new SqlCommand("Select * from Products where id='" + id + "' and Stock>0", con);
                    con.Open();



                    SqlDataAdapter sda = new SqlDataAdapter(cmd);

                    DataSet ds = new DataSet();

                    sda.Fill(ds);
                    con.Close();
                    int count = ds.Tables[0].Rows.Count;

                    if (count >= 1)
                    {
                        {
                            SqlCommand cmd1 = new SqlCommand("SELECT * fROM Products where id='" + id + "'", con);



                            con.Open();

                            SqlCommand    cmd2;
                            SqlDataReader reader = cmd1.ExecuteReader();
                            while (reader.Read())
                            {
                                productname = reader[1].ToString();

                                pricep = reader[3].ToString();
                            }
                            reader.Close();

                            con.Close();
                            cmd2 = new SqlCommand("insert into cart (name,price,itemid,email) values(@name,@price,@id,@email)", con);
                            con.Open();
                            cmd2.Parameters.Add("name", SqlDbType.NVarChar).Value = productname;

                            cmd2.Parameters.Add("price", SqlDbType.NVarChar).Value = pricep;
                            cmd2.Parameters.Add("id", SqlDbType.NVarChar).Value    = id;
                            cmd2.Parameters.Add("email", SqlDbType.NVarChar).Value = Email.Text;
                            cmd2.ExecuteNonQuery();
                            con.Close();
                            Label3.Text = "added in cart";


                            {
                                con.Open();
                                cmd = new SqlCommand("update products set stock=stock-1 where id=@id", con);
                                cmd.Parameters.Add("id", SqlDbType.Int).Value = Convert.ToInt32(id);

                                cmd.ExecuteNonQuery();
                                con.Close();
                                Response.Redirect("Sellpage.aspx");
                            }
                            // ind++;
                        }
                    }

                    else
                    {
                        Label3.ForeColor = System.Drawing.Color.Red;
                        Label3.Text      = "Item Not Available";
                    }


                    //catch (Exception ex)
                    //{
                    //    Label3.Text = ex.Message;


                    //}
                }
            }
            else
            {
            }
        }
예제 #43
0
        protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
        {
            if (e.CommandName == "addToShoppingCart")
            {
                // Get Product ID
                int prodID = Convert.ToInt32(e.CommandArgument);

                // Get products from ArtistUpload Table with this prodID
                DataContextDataContext db1             = new DataContextDataContext();
                ArtistUpload           objArtistUpload = db1.ArtistUploads.Single(proID => proID.productID == prodID);


                //Validation if current quantity = 0, don't allow user to add to cart
                // Get Product quantity from seller and deduct it to see if it is 0
                DataContextDataContext dba = new DataContextDataContext();
                var deductProductQty       = from p in dba.ArtistUploads
                                             join o in dba.WishLists on p.productID equals o.productID
                                             where p.productID == o.productID && p.productID == prodID
                                             select p;

                if (deductProductQty != null)
                {
                    foreach (var deductQty in deductProductQty)
                    {
                        if (deductQty.quantity >= 1)
                        {
                            // If the item has already been added to the Shopping Cart then
                            // Prompt the item has already been added to Shopping Cart
                            // And remove the item from Wish List
                            Boolean productAlreadyInCart = false;
                            DataContextDataContext dbCheckShoppingCart = new DataContextDataContext();
                            var checkCShoppingCart = from p in dbCheckShoppingCart.ShoppingCarts
                                                     where p.productID == prodID && p.customerEmail == (string)Session["user"]
                                                     select p;

                            foreach (var checkCart in checkCShoppingCart)
                            {
                                if (checkCart.productID == prodID)
                                {
                                    productAlreadyInCart = true;
                                }
                            }

                            if (productAlreadyInCart == true)
                            {
                                Response.Write("<script>alert('" + "This item " + deductQty.productname + " has already been added to the Shopping Cart! And will be romove from your Wish List!" + "')</script>");

                                // Delete this product from wish list
                                DataContextDataContext dbDelete = new DataContextDataContext();
                                WishList deleteWishList         = new WishList();
                                var      query = dbDelete.WishLists.Where(wList => wList.productID == prodID).FirstOrDefault();
                                dbDelete.WishLists.DeleteOnSubmit(query);
                                dbDelete.SubmitChanges();

                                HtmlMeta oScript = new HtmlMeta();
                                oScript.Attributes.Add("http-equiv", "REFRESH");
                                oScript.Attributes.Add("content", "0; url='CustomerWishList.aspx'");
                                Page.Header.Controls.Add(oScript);
                            }

                            if (productAlreadyInCart == false)
                            {
                                // Add this product to shopping cart
                                DataContextDataContext db2             = new DataContextDataContext();
                                ShoppingCart           newShoppingCart = new ShoppingCart();
                                newShoppingCart.productID     = prodID;
                                newShoppingCart.productName   = objArtistUpload.productname;
                                newShoppingCart.quantity      = 1;
                                newShoppingCart.unitPrice     = objArtistUpload.productPrice;
                                newShoppingCart.customerEmail = (string)Session["user"];
                                db2.ShoppingCarts.InsertOnSubmit(newShoppingCart);
                                db2.SubmitChanges();

                                // Delete this product from wish list
                                DataContextDataContext db3 = new DataContextDataContext();
                                WishList deleteWishList    = new WishList();
                                var      query             = db3.WishLists.Where(wList => wList.productID == prodID).FirstOrDefault();
                                db3.WishLists.DeleteOnSubmit(query);
                                db3.SubmitChanges();

                                // Send user back to this page
                                Response.Write("<script>alert('" + "This item " + deductQty.productname + " has successfully been added to the Shopping Cart! And will be romove from your Wish List!" + "')</script>");
                                HtmlMeta oScript = new HtmlMeta();
                                oScript.Attributes.Add("http-equiv", "REFRESH");
                                oScript.Attributes.Add("content", "0; url='CustomerWishList.aspx'");
                                Page.Header.Controls.Add(oScript);
                            }
                        }
                        else
                        {
                            Response.Write("<script>alert('" + "This item " + deductQty.productname + " is currently out of stock, please email the seller for more inquiry!" + "')</script>");
                        }
                    }
                }
            }

            if (e.CommandName == "removeFromWishList")
            {
                // Get Wish list ID
                int wListID = Convert.ToInt32(e.CommandArgument);

                // Delete this product from wish list
                DataContextDataContext db = new DataContextDataContext();
                WishList deleteWishList   = new WishList();
                var      query            = db.WishLists.Where(wList => wList.wishListID == wListID).FirstOrDefault();
                db.WishLists.DeleteOnSubmit(query);
                db.SubmitChanges();

                // Send user back to this page
                Response.Redirect("CustomerWishList.aspx");
            }
        }
예제 #44
0
 protected void DataList1_EditCommand(object source, DataListCommandEventArgs e)
 {
     DataList1.EditItemIndex = e.Item.ItemIndex;
     DataList1.DataBind();
 }
예제 #45
0
    protected void dlphonecomp_EditCommand(object source, DataListCommandEventArgs e)
    {
        string id = dlphonecomp.DataKeys[e.Item.ItemIndex].ToString();

        Response.Redirect("~/Admin/Colormanage.aspx?id=" + id);
    }
예제 #46
0
        protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
        {
            int id = Convert.ToInt32(e.CommandArgument.ToString());

            Response.Redirect("View2.aspx?id=" + id);
        }
 protected void dtlProducts_ItemCommand(object source, DataListCommandEventArgs e)
 {
 }
예제 #48
0
 protected void dlManage_ItemCommand(object source, DataListCommandEventArgs e)
 {
     Bmessage.Delete("messageNo=" + e.CommandArgument);
 }
예제 #49
0
        protected void dlInfo_EditCommand(object source, DataListCommandEventArgs e)
        {
            string cardid = dlInfo.DataKeys[e.Item.ItemIndex].ToString();

            Page.Response.Redirect("RevertCard.aspx?CardID=" + cardid + "");
        }
예제 #50
0
 protected void DataList1_ItemCommand1(object source, DataListCommandEventArgs e)
 {
 }
예제 #51
0
 protected void datalistpics_EditCommand(object source, DataListCommandEventArgs e)
 {
     datalistpics.EditItemIndex = e.Item.ItemIndex;
     datalstbind();
 }
예제 #52
0
파일: index2.aspx.cs 프로젝트: vizualz/BH3
/*
 */
        public void View_ItemDetail(object sender, DataListCommandEventArgs e)
        {
        }
예제 #53
0
 protected void DataList1_DeleteCommand(object source, DataListCommandEventArgs e)
 {
 }
예제 #54
0
    protected void DataListFullPG_ItemCommand(object source, DataListCommandEventArgs e)
    {
        if (e.CommandName == "readMore")
        {
            int    index      = e.Item.ItemIndex;
            Table  allDetails = (Table)DataListFullPG.Items[index].FindControl("infoTable");
            Button view       = (Button)DataListFullPG.Items[index].FindControl("btnExpand");
            if (view.Text == "Read More...")
            {
                view.Text          = "See Less...";
                allDetails.Visible = true;
            }
            else
            {
                view.Text          = "Read More...";
                allDetails.Visible = false;
            }
        }

        else if (e.CommandName == "remInterest")
        {
            int   index = e.Item.ItemIndex;
            Label pid   = (Label)DataListFullPG.Items[index].FindControl("lblID");
            //Button intr = (Button)DataListFullPG.Items[index].FindControl("btnInterest");

            Label init      = (Label)DataListFullPG.Items[index].FindControl("lblInterests");
            int   interests = Int32.Parse(init.Text);

            String        myConn = ConfigurationManager.ConnectionStrings["StayHubDBConnection"].ConnectionString;
            SqlConnection con    = new SqlConnection(myConn);

            String     addIntr = "delete from Interests where UID = @uid and PID = @pid;";
            SqlCommand cmd     = new SqlCommand(addIntr, con);
            cmd.Parameters.AddWithValue("uid", Session["userid"].ToString());
            cmd.Parameters.AddWithValue("pid", pid.Text);

            String     decnum = "update PG set Interests = @interests where ID = @pid;";
            SqlCommand cmd2   = new SqlCommand(decnum, con);
            cmd2.Parameters.AddWithValue("interests", interests - 1);
            cmd2.Parameters.AddWithValue("pid", pid.Text);

            con.Open();
            int i = cmd.ExecuteNonQuery();
            cmd2.ExecuteNonQuery();

            con.Close();
            //if (i > 0)
            //{
            //    int1.Visible = true;
            //    int2.Visible = false;
            //}
            //else
            //{
            //    int1.Visible = false;
            //    int2.Visible = true;
            //}
            DataListFullPG.DataBind();
        }
        else if (e.CommandName == "reqVisit")
        {
            int    index = e.Item.ItemIndex;
            String pid   = e.CommandArgument.ToString();
            //Label pid = (Label)DataListFullPG.Items[index].FindControl("lblID");
            Button req = (Button)DataListFullPG.Items[index].FindControl("btnVisit");
            Label  oid = (Label)DataListFullPG.Items[index].FindControl("lblOID");

            if (req.Text == "Request A Visit")
            {
                String        myConn = ConfigurationManager.ConnectionStrings["StayHubDBConnection"].ConnectionString;
                SqlConnection con    = new SqlConnection(myConn);


                String     query = "insert into SiteVisits(PID, SID, OID) values (@pid, @sid, @oid);";
                SqlCommand cmd   = new SqlCommand(query, con);
                cmd.Parameters.AddWithValue("pid", pid);
                cmd.Parameters.AddWithValue("sid", Session["userid"].ToString());
                cmd.Parameters.AddWithValue("oid", oid.Text);


                con.Open();
                int i = cmd.ExecuteNonQuery();
                con.Close();
                if (i > 0)
                {
                    req.Text    = "Visit Requested!";
                    req.Enabled = false;
                }
                else
                {
                    req.Text    = "Request A Visit";
                    req.Enabled = true;
                }
                DataListFullPG.DataBind();
            }
            else
            {
                req.Enabled = false;
            }
        }
        else if (e.CommandName == "pgImg")
        {
            String arg    = e.CommandArgument.ToString();
            String a      = arg.Substring(2);
            String script = "window.open('" + a + "')";
            ScriptManager.RegisterStartupScript(this, GetType(), "openImage", script, true);
        }
    }
예제 #55
0
        protected void DataList1_DeleteCommand(object source, DataListCommandEventArgs e)
        {
            string Tempstr = DataList1.DataKeys[e.Item.ItemIndex].ToString();

            Response.Redirect("../GoodDisplay/ThirdClass.aspx?ThirdName=" + Tempstr + "");
        }
예제 #56
0
 protected void dlApplications_ItemCommand(object source, DataListCommandEventArgs e)
 {
     _user.CurrentApplicationID = int.Parse(e.CommandArgument.ToString());
     //((leftMenu)this.Page.Master.FindControl("leftMenu1")).RenderMenus();
 }
예제 #57
0
    protected void DataListSubOrder_ItemCommand(object source, DataListCommandEventArgs e)
    {
        if (e.CommandArgument.ToString() != "")
        {
            if (e.CommandName == "ReturnAddress")
            {
                hdnReturnOrderID.Value = e.CommandArgument.ToString();
                tblReturnOrder objReturnOrder = new tblReturnOrder();
                if (objReturnOrder.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())))
                {
                    if (objReturnOrder.AppReturnStatus == Convert.ToInt32(Enums.Enum_ReturnStatus.Slip) && objReturnOrder.s_AppDocketNo != "")
                    {
                        if (objReturnOrder.AppReturnStatus == Convert.ToInt32(Enums.Enum_ReturnStatus.Approved))
                        {
                            objReturnOrder.AppReturnStatus = Convert.ToInt32(Enums.Enum_ReturnStatus.Slip);
                            objReturnOrder.Save();
                        }
                        objEncrypt             = new clsEncryption();
                        hdnReturnOrderID.Value = GetAlias("Productslip.aspx") + objEncrypt.Encrypt(objReturnOrder.s_AppReturnOrderID, appFunctions.strKey);
                        objEncrypt             = null;
                        ScriptManager.RegisterStartupScript(UpMain, UpMain.GetType(), "myFunction", "CallProductInvoice();", true);
                    }
                    else
                    {
                        if (objReturnOrder.s_AppDocketNo != "")
                        {
                            txtDocketNo.Text    = objReturnOrder.s_AppDocketNo;
                            txtDocketNo.Enabled = false;
                        }
                        else
                        {
                            ddlCourierCompany.SelectedIndex = 0;
                            txtCourierContactNo.Text        = "";
                            txtSiteName.Text    = "";
                            txtDocketNo.Text    = "";
                            txtDocketNo.Enabled = true;
                        }

                        Mpeslip.Show();
                    }
                    //  Mpeslip.Show();
                }
                objReturnOrder = null;
            }
            if (e.CommandName == "ReturnRequest")
            {
                tblSubOrder objTempSubOrder = new tblSubOrder();
                objDataTable = objTempSubOrder.GetProductInvoiceInfo(e.CommandArgument.ToString());
                if (objDataTable.Rows.Count > 0)
                {
                    hdnPrevStatus.Value   = objDataTable.Rows[0][tblSubOrder.ColumnNames.AppSubOrderStatusID].ToString();
                    txtPickupName.Text    = objDataTable.Rows[0][tblOrder.ColumnNames.AppReceiverName].ToString();
                    txtPickupAddress.Text = objDataTable.Rows[0][tblOrder.ColumnNames.AppReceiverAddress].ToString();
                    txPickupMobile1.Text  = objDataTable.Rows[0][tblOrder.ColumnNames.AppReceiverContactNo1].ToString();
                    txtPickupMobile2.Text = objDataTable.Rows[0][tblOrder.ColumnNames.AppReceiverContactNo2].ToString();
                    txtPickupPIN.Text     = objDataTable.Rows[0][tblOrder.ColumnNames.AppReceiverPIN].ToString();
                }
                objTempSubOrder = null;

                MpeReturnRequest.Show();
            }
            if (e.CommandName == "Dispatch")
            {
                tblReturnOrder objReturnOrder = new tblReturnOrder();
                if (objReturnOrder.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())))
                {
                    objReturnOrder.AppReturnStatus = Convert.ToInt32(Enums.Enum_ReturnStatus.Dispatched);
                    objReturnOrder.Save();
                    objReturnOrder = null;
                }
                LoadMyorderList();
            }
        }
    }
예제 #58
0
 protected void adminlist_ItemCommand(object source, DataListCommandEventArgs e)
 {
 }
예제 #59
0
 // rebinds tables when user clicks cancel
 protected void dtl_contentCancel(object sender, DataListCommandEventArgs e)
 {
     dtl_content.EditItemIndex = -1;
     _subBind();
     _subBindDataList();
 }
    protected void Repeater_ItemCommand(object source, DataListCommandEventArgs e)
    {
        Button b = (Button)e.CommandSource;



        if (b.ID.Equals("Edit"))
        {
            Repeater.EditItemIndex = e.Item.ItemIndex;
            view = loadData(info, db, Repeater);
            WebUtils.SetEnabledControlSection(TaxEmpPaymentAddPanel, false);
        }
        else if (b.ID.Equals("Cancel"))
        {
            Repeater.EditItemIndex = -1;
            view = loadData(info, db, Repeater);
            WebUtils.SetEnabledControlSection(TaxEmpPaymentAddPanel, true);
        }
        else if (b.ID.Equals("Save"))
        {
            ETaxEmpPayment obj = new ETaxEmpPayment();
            //db.toObject(((DataRowView)e.Item.DataItem).Row, obj);

            OR orTerms = new OR();
            orTerms.add(inPaymentFilter);
            orTerms.add(new Match("TaxPayID", ((DropDownList)e.Item.FindControl("TaxPayID")).SelectedValue));

            DBFilter taxPaymentSelectedFilter = new DBFilter();
            taxPaymentSelectedFilter.add(orTerms);
            taxPaymentSelectedFilter.add(new Match("TaxFormType", TaxFormType.Value));

            ebinding = new Binding(dbConn, db);
            ebinding.add(TaxEmpID);
            ebinding.add((HtmlInputHidden)e.Item.FindControl("TaxEmpPayID"));
            ebinding.add(new DropDownVLBinder(db, (DropDownList)e.Item.FindControl("TaxPayID"), ETaxPayment.VLTaxPayment, taxPaymentSelectedFilter));
            ebinding.add(new TextBoxBinder(db, ((WebDatePicker)e.Item.FindControl("TaxEmpPayPeriodFr")).TextBox, "TaxEmpPayPeriodFr"));
            ebinding.add(new TextBoxBinder(db, ((WebDatePicker)e.Item.FindControl("TaxEmpPayPeriodTo")).TextBox, "TaxEmpPayPeriodTo"));
            ebinding.add((TextBox)e.Item.FindControl("TaxEmpPayAmount"));
            ebinding.add((TextBox)e.Item.FindControl("TaxEmpPayNature"));

            ebinding.init(Request, Session);


            //            ETaxEmpPayment obj = new ETaxEmpPayment();
            Hashtable values = new Hashtable();

            PageErrors errors = PageErrors.getErrors(db, Page.Master);
            errors.clear();


            ebinding.toValues(values);
            db.validate(errors, values);

            if (!errors.isEmpty())
            {
                return;
            }

            db.parse(values, obj);

            ValidateData(obj, errors);

            if (!errors.isEmpty())
            {
                return;
            }

            ETaxPayment taxPay = new ETaxPayment();
            taxPay.TaxPayID = obj.TaxPayID;
            ETaxPayment.db.select(dbConn, taxPay);
            if (!taxPay.TaxPayIsShowNature.Equals("Y"))
            {
                obj.TaxEmpPayNature = string.Empty;
            }
            else if (obj.TaxEmpPayNature.Equals(string.Empty))
            {
                obj.TaxEmpPayNature = taxPay.TaxPayNature;
            }


            ETaxEmp taxEmp = new ETaxEmp();
            taxEmp.TaxEmpID = obj.TaxEmpID;
            if (ETaxEmp.db.select(dbConn, taxEmp))
            {
                WebUtils.StartFunction(Session, FUNCTION_CODE, taxEmp.EmpID);
                db.update(dbConn, obj);
                WebUtils.EndFunction(dbConn);

                Repeater.EditItemIndex = -1;
                view = loadData(info, db, Repeater);
                WebUtils.SetEnabledControlSection(TaxEmpPaymentAddPanel, true);
            }
        }
    }