Exemplo n.º 1
0
    protected void gvData_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        string commandName = e.CommandName;
        int    id          = e.CommandArgument.ToArrowInt();

        if (e.CommandName == "UpdateData")
        {
            Response.Redirect("GroupEdit.aspx?LineID=" + MyLine.ID + "&id=" + id + CreateReturnUrl("&"));
        }
        else if (e.CommandName == "DelData")
        {
            //删除
            GroupBLL.SetGroupIsDel(id, 1);
            BindData();
            MessageBox.Show("删除成功!");
        }
        else if (e.CommandName == "AddData")
        {
            var model = GroupBLL.SelectGroup(id);
            if (model != null)
            {
                model.GoDate          = model.GoDate.AddDays(1);
                model.BackDate        = model.BackDate.AddDays(1);
                model.JoinNum         = 0;
                model.AddTime         = DateTime.Now;
                model.AddUserName     = CurrentAdmin.UserName;
                model.AddUserRealName = CurrentAdmin.RealName;

                GroupBLL.AddGroup(model);
                BindData();
            }
        }
    }
Exemplo n.º 2
0
        private void Bind()
        {
            var homePageRecommList = new GroupBLL().GetHomePageRecommend(this.GroupTypeID, this.SchemeID);

            DataList.DataSource = homePageRecommList.Where(p => p.PosID == 1).ToList();
            DataList.DataBind();
        }
Exemplo n.º 3
0
        private void Complete_Click(object sender, RoutedEventArgs e)
        {
            List <string> users = new List <string>();

            foreach (TreeViewItem b in departmentTree.Items)
            {
                foreach (CheckBox d in b.Items)
                {
                    if (d.IsChecked == true)
                    {
                        users.Add(d.Name);
                    }
                }
            }
            users.Add(selfusername);
            GroupBLL bll   = new GroupBLL();
            int      id    = bll.CreatGroup(users, GroupName.Text);
            Group    group = null;

            bll.GetGroupByID(id, out group);
            if (group != null)
            {
                OneToManyWindow onetomany = new OneToManyWindow(group, user);
                onetomany.Show();
                this.Close();
            }
            else
            {
                MessageBox.Show("系统异常,建群失败");
            }
        }
Exemplo n.º 4
0
        private void Bind()
        {
            if (GroupElementID > 0)
            {
                _CurrentEntity = new GroupBLL().GetGroupElemByID(GroupElementID);
                if (_CurrentEntity != null)
                {
                    hfAppID.Value           = _CurrentEntity.ElemID.ToString();
                    hfIconUrl.Value         = _CurrentEntity.RecommPicUrl;
                    txtShowName.Text        = _CurrentEntity.RecommTitle;
                    txtRecommWord.Text      = _CurrentEntity.RecommWord;
                    txtStartTime.Text       = _CurrentEntity.StartTime.ToString("yyyy-MM-dd HH:mm");
                    txtEndTime.Text         = _CurrentEntity.EndTime.ToString("yyyy-MM-dd HH:mm");
                    ddlStatus.SelectedValue = _CurrentEntity.Status.ToString();
                    txtPosID.Text           = _CurrentEntity.PosID.ToString();
                }
            }

            // 绑定最大位置id Tips
            var currentEntity = new GroupElemsEntity();

            currentEntity.GroupID = GroupID;
            int posid = new GroupBLL().GetMaxPosID(currentEntity);
            //todo:
        }
Exemplo n.º 5
0
        public GroupBLL checkGroupAvailableOrNot(string keyword)
        {
            GroupBLL g = new GroupBLL();

            SqlConnection con = new SqlConnection(myconnstrng);

            DataTable dt = new DataTable();

            //fdfd
            try
            {
                string sql = "SELECT Group_Name from Group_Master WHERE Group_Name LIKE '%" + keyword + "%'";

                SqlDataAdapter adapter = new SqlDataAdapter(sql, con);

                con.Open();

                adapter.Fill(dt);

                if (dt.Rows.Count > 0)
                {
                    g.Group_Name = dt.Rows[0]["Group_Name"].ToString();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
            }
            return(g);
        }
Exemplo n.º 6
0
        private void RefreshGroup()
        {
            for (int i = GroupList.Items.Count - 1; i > 0; i--)
            {
                GroupList.Items.RemoveAt(i);
            }
            GroupBLL groupbll = new GroupBLL();

            GroupsList = groupbll.GetGroupListByUserId(user.Id);
            foreach (Group p in GroupsList)
            {
                Image groupimage = new Image();
                groupimage.Source = new BitmapImage(new Uri("images\\214743981.jpg", UriKind.Relative));
                Label      grouplabel = new Label();
                StackPanel groupstack = new StackPanel();
                groupimage.MaxHeight = 50;
                groupimage.MaxWidth  = 50;
                grouplabel.VerticalContentAlignment = VerticalAlignment.Center;
                grouplabel.Content     = p.Name;
                groupstack.Orientation = Orientation.Horizontal;
                groupstack.Children.Add(groupimage);
                groupstack.Children.Add(grouplabel);
                Button groupbutton = new Button();
                groupbutton.Background        = Brushes.White;
                groupbutton.Content           = groupstack;
                groupbutton.Margin            = new Thickness(10);
                groupbutton.Name              = "no_" + p.Id.ToString();
                groupbutton.BorderThickness   = new Thickness(0);
                groupbutton.MouseDoubleClick += GroupChat_Click;
                GroupList.Items.Add(groupbutton);
            }
        }
 private void Bind()
 {
     if (_Id > 0)
     {
         _CurrentEntity = new GroupBLL().GetGroupElemByID(_Id);
         if (_CurrentEntity != null)
         {
             hfAppID.Value           = _CurrentEntity.ElemID.ToString();
             hfIconUrl.Value         = _CurrentEntity.RecommPicUrl;
             txtShowName.Text        = _CurrentEntity.RecommTitle;
             txtRecommWord.Text      = _CurrentEntity.RecommWord;
             txtStartTime.Text       = _CurrentEntity.StartTime.ToString("yyyy-MM-dd HH:mm");
             txtEndTime.Text         = _CurrentEntity.EndTime.ToString("yyyy-MM-dd HH:mm");
             ddlStatus.SelectedValue = _CurrentEntity.Status.ToString();
             txtPosID.Text           = _CurrentEntity.PosID.ToString();
         }
     }
     else
     {
         // 绑定最大位置id Tips
         var currentEntity = new GroupElemsEntity();
         currentEntity.GroupID = new GroupBLL().BeginnerRecommendGetGroupId(this.GroupTypeID, this.SchemeID);
         int posid = new GroupBLL().GetMaxPosID(currentEntity);
         txtStartTime.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
         txtEndTime.Text   = DateTime.Now.AddYears(10).ToString("yyyy-MM-dd HH:mm");
         if (posid > 0)
         {
             labelPosIDTips.Text = "目前已设置的最大位置id:" + posid.ToString();
         }
         txtPosID.Text = Tools.GetStr(posid + 1, "0");
     }
 }
Exemplo n.º 8
0
    protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)
    {
        UserBLL  userBLL  = new UserBLL();
        RoleBLL  roleBLL  = new RoleBLL();
        GroupBLL groupBLL = new GroupBLL();

        string UserName = ((TextBox)CreateUserWizardStep1.ContentTemplateContainer.FindControl("UserName")).Text;
        int    roleID   = Convert.ToInt32(((DropDownList)CreateUserWizardStep1.ContentTemplateContainer.FindControl("ddlRoles")).SelectedValue);
        int    groupID  = Convert.ToInt32(((DropDownList)CreateUserWizardStep1.ContentTemplateContainer.FindControl("ddlGroups")).SelectedValue);

        Role  role  = roleBLL.GetRoleByRoleID(roleID);
        User  user  = userBLL.GetUserByUserName_WithoutApplication(UserName);
        Group group = groupBLL.GetGroupByGroupID(groupID);

        roleBLL.AddUserToRole(user, role);
        groupBLL.AddUserToGroup(user, group);

        Label lblEmail    = (Label)CompleteWizardStep1.ContentTemplateContainer.FindControl("lblEmail");
        Label lblUserType = (Label)CompleteWizardStep1.ContentTemplateContainer.FindControl("lblUserType");
        Label lblGroup    = (Label)CompleteWizardStep1.ContentTemplateContainer.FindControl("lblGroup");

        lblEmail.Text    = UserName;
        lblUserType.Text = ((DropDownList)CreateUserWizardStep1.ContentTemplateContainer.FindControl("ddlRoles")).SelectedItem.Text;
        lblGroup.Text    = ((DropDownList)CreateUserWizardStep1.ContentTemplateContainer.FindControl("ddlGroups")).SelectedItem.Text;

        Response.Redirect("~/secured/admin/users.aspx", true);
    }
Exemplo n.º 9
0
    protected void FormViewCommonName_ItemInserting(object sender, FormViewInsertEventArgs e)
    {
        TextBox txtCommonName         = (TextBox)formViewCommonName.FindControl("txtCommonName");
        TextBox txtScientificName     = (TextBox)formViewCommonName.FindControl("txtScientificName");
        CommonNameActionStatus status = Validate(txtCommonName.Text, txtScientificName.Text, actionType.insert);

        if (status == CommonNameActionStatus.Success)
        {
            User user = new UserBLL().GetUserByUserName((HttpContext.Current.User.Identity).Name);

            int groupID = new Group_UsersBLL().GetGroup_UsersByUserID(user.UserID)[0].GroupID;

            CommonName     commonName     = new CommonNameBLL().GetOrCreateCommonName(txtCommonName.Text, user);
            ScientificName scientificName = new ScientificNameBLL().GetScientificNameByScientificNameID(Convert.ToInt32(Page.RouteData.Values["scientificname_id"] as string));
            OrganismType   organismType   = new OrganismTypeBLL().GetOrganismTypeByOrganismTypeID(2);
            Group          group          = new GroupBLL().GetGroupByGroupID(groupID);

            e.Values["CommonNameID"]     = commonName.CommonNameID;
            e.Values["ScientificNameID"] = scientificName.ScientificNameID;
            e.Values["OrganismTypeID"]   = organismType.OrganismTypeID;
            e.Values["GroupID"]          = group.GroupID;

            e.Values["CreatedDate"]   = DateTime.Now;
            e.Values["CreatorUserID"] = user.UserID;
            e.Values["EditedDate"]    = DateTime.Now;
            e.Values["EditorUserID"]  = user.UserID;
        }
        else
        {
            ltlMessage.Text = MessageFormatter.GetFormattedErrorMessage(GetErrorMessage(status));
            e.Cancel        = true;
        }
    }
Exemplo n.º 10
0
        private void LoadGroupsJoin(TourStatisticBinding tourStatisticBinding)
        {
            //Back to main thread update UI
            if (InvokeRequired)
            {
                BeginInvoke(new Action(() =>
                {
                    dgvStatisticGroupDetail.ShowLoading(true);
                }));
            }

            //Fill DataTable
            var           groups = _tourWithGroups.FirstOrDefault(t => t.Tour.Id == tourStatisticBinding.TourId).Groups;
            List <object> data   = new List <object>();

            foreach (var group in groups)
            {
                data.Add(new
                {
                    group.Id,
                    group.Name,
                    Tour = group.Tour.Name,
                    group.StartDate,
                    group.EndDate,
                    PriceTour = GroupBLL.GetPriceTourOfGroup(group),
                    Revenue   = GroupBLL.GetRevenueOfGroup(group),
                    Cost      = GroupBLL.GetTotalCostOfGroup(group),
                });
            }

            //Back to main thread update UI
            if (InvokeRequired)
            {
                BeginInvoke(new Action(() =>
                {
                    //Clear loading column
                    dgvStatisticGroupDetail.Columns.Clear();

                    dgvStatisticGroupDetail.Columns.Add("Id", "Mã");
                    dgvStatisticGroupDetail.Columns.Add("Name", "Tên đoàn");
                    dgvStatisticGroupDetail.Columns.Add("Tour", "Tour");
                    dgvStatisticGroupDetail.Columns.Add("StartDate", "Ngày đi");
                    dgvStatisticGroupDetail.Columns.Add("EndDate", "Ngày về");
                    dgvStatisticGroupDetail.Columns.Add("PriceTour", "Giá vé");
                    dgvStatisticGroupDetail.Columns.Add("Revenue", "Doanh Thu");
                    dgvStatisticGroupDetail.Columns.Add("Cost", "Chi phí");

                    dgvStatisticGroupDetail.Columns["StartDate"].DefaultCellStyle.Format = "dd/MM/yyyy";
                    dgvStatisticGroupDetail.Columns["EndDate"].DefaultCellStyle.Format   = "dd/MM/yyyy";

                    foreach (DataGridViewColumn column in dgvStatisticGroupDetail.Columns)
                    {
                        column.DataPropertyName = column.Name;
                    }

                    dgvStatisticGroupDetail.DataSource = data;
                }));
            }
        }
Exemplo n.º 11
0
        public ActionResult Getdate()
        {
            GroupBLL   grBLL  = new GroupBLL();
            SelectList listGr = new SelectList(grBLL.Getall(), "IdGroup", "Name");

            ViewBag.ListGroup = listGr;
            return(View());
        }
Exemplo n.º 12
0
        protected void OnDel(object s, CommandEventArgs e)
        {
            int id = nwbase_sdk.Tools.GetInt(e.CommandArgument, 0);

            if (id > 0)
            {
                var result = new GroupBLL().DeleteElem(id);
                if (result)
                {
                    if (SchemeID == 104)
                    {
                        OperateRecordEntity info = new OperateRecordEntity()
                        {
                            ElemId         = id,
                            reason         = "",
                            Status         = 1,
                            OperateFlag    = "3",
                            OperateContent = new GroupBLL().GetGroupElemByID(id).RecommTitle,
                            UserName       = GetUserName(),
                        };
                        if (GroupID != 93 && GroupID != 94)
                        {
                            info.SourcePage     = 62;
                            info.OperateType    = "6";
                            info.OperateExplain = GroupName + ": 删除游戏";
                        }
                        else
                        {
                            if (GroupID == 93)
                            {
                                info.SourcePage     = 63;
                                info.OperateType    = "7";
                                info.OperateExplain = "游戏排行: 删除游戏";
                            }
                            else if (GroupID == 94)
                            {
                                info.SourcePage     = 64;
                                info.OperateType    = "8";
                                info.OperateExplain = "最新游戏: 删除游戏";
                            }
                        }
                        new OperateRecordBLL().Insert(info);
                    }
                    this.Alert("删除成功");
                    Bind();
                    BindDataLog();
                }
                else
                {
                    this.Alert("删除失败");
                }
            }
            else
            {
                this.Alert("删除参数无效");
            }
        }
Exemplo n.º 13
0
    protected string JsonInfo()
    {
        List <GroupCurtInfo> list = new List <GroupCurtInfo>();

        foreach (TravelGroupInfo group in Groups)
        {
            list.Add(GroupBLL.GroupToCurt(group));
        }
        return(Arrow.Framework.JsonHelper.JsonSerializer(list));
    }
Exemplo n.º 14
0
        private void btnGroupAdd_Click(object sender, EventArgs e)
        {
            if (groupMode != OperationType.Add)
            {
                groupMode              = OperationType.Add;
                btnCancel.Visible      = true;
                btnGroupAdd.Text       = "Lưu";
                btnGroupEdit.Visible   = false;
                btnGroupDelete.Visible = false;

                tbGroupName.Enabled       = true;
                cbGroupTour.Enabled       = true;
                dtpGroupStartDate.Enabled = true;
                dtpGroupEndDate.Enabled   = true;
            }
            else
            {
                var      name      = tbGroupName.Text;
                int      tourId    = (int)cbGroupTour.SelectedValue;
                DateTime startDate = dtpGroupStartDate.Value;
                DateTime endDate   = dtpGroupEndDate.Value;
                try
                {
                    GroupBLL.CreateGroup(name, startDate, endDate, tourId);
                    Thread loadGroupsThread = new Thread(() => LoadGroups());
                    loadGroupsThread.Start();
                    MessageBox.Show("Thêm thành công");
                }
                catch (Exception ex)
                {
                    string message = "";
                    foreach (DictionaryEntry item in ex.Data)
                    {
                        message += item.Value?.ToString();
                        message += Environment.NewLine;
                    }
                    MessageBox.Show(message);
                    return;
                }

                groupMode              = OperationType.View;
                btnGroupAdd.Text       = "+ Thêm";
                btnGroupEdit.Visible   = true;
                btnGroupDelete.Visible = true;
                btnCancel.Visible      = false;

                tbGroupName.Enabled       = false;
                cbGroupTour.Enabled       = false;
                dtpGroupStartDate.Enabled = false;
                dtpGroupEndDate.Enabled   = false;
            }

            dgvGroupList.ClearSelection();
        }
Exemplo n.º 15
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ShowTitle("线路详细信息");
     MyLine   = LineBLL.SelectLine(GetUrlInt("LineID"));
     MyGroups = GroupBLL.GetLineGroups(GetUrlInt("LineID"));
     if (!Page.IsPostBack)
     {
         BindDropDownList();
         BindData();
     }
 }
        protected void lbtnMoveIndex_Command(object sender, CommandEventArgs e)
        {
            int groupElemID = Convert.ToInt32(e.CommandName);

            if (groupElemID > 0)
            {
                GroupElemsEntity groupElem = new GroupBLL().GetGroupElemByID(groupElemID);
                if (groupElem != null)
                {
                    string strWhere = "";
                    string strOrder = "OrderNo";
                    int    posId    = Tools.GetRequestVal("PosID", -1);
                    string cmd      = e.CommandArgument.ToString();
                    if (cmd == "up") // 上移
                    {
                        strWhere  = string.Format("OrderNo < {0} and status=1", groupElem.OrderNo);
                        strOrder += " desc";
                    }
                    else // 下移
                    {
                        strWhere = string.Format("OrderNo > {0} and status=1", groupElem.OrderNo);
                    }
                    strWhere += string.Format(" and GroupID={0} and PosID={1}", groupElem.GroupID, posId);

                    List <GroupElemsEntity> groupElemList = new GroupBLL().GetList(1, strWhere, strOrder);

                    if (groupElemList != null && groupElemList.Count > 0)
                    {
                        Dictionary <int, int> orderNoDic = new Dictionary <int, int>();
                        orderNoDic.Add(groupElem.GroupElemID, groupElemList[0].OrderNo);
                        orderNoDic.Add(groupElemList[0].GroupElemID, groupElem.OrderNo);
                        new GroupBLL().UpdateElemOrder(orderNoDic);
                        if (SchemeID == 104)
                        {
                            OperateRecordEntity info = new OperateRecordEntity()
                            {
                                ElemId         = 0,
                                reason         = "",
                                Status         = 1,
                                OperateFlag    = "4",
                                OperateType    = "1",
                                OperateExplain = "首页位置排序",
                                OperateContent = "首页位置排序(Banner)",
                                SourcePage     = 60,
                                UserName       = GetUserName(),
                            };
                            new OperateRecordBLL().Insert(info);
                        }
                        Bind(); // 重新绑定页面
                    }
                }
            }
        }
Exemplo n.º 17
0
        public ActionResult Register()
        {
            GroupBLL   grBLL  = new GroupBLL();
            SelectList listGr = new SelectList(grBLL.Getall(), "IdGroup", "Name");

            ViewBag.listGr = listGr;
            RoleBLL    roleBLL  = new RoleBLL();
            SelectList listRole = new SelectList(roleBLL.Getall(), "IdRole", "Name");

            ViewBag.listRole = listRole.Where(p => p.Value == "2").First().Text;
            return(View());
        }
Exemplo n.º 18
0
    protected void formViewGroup_DataBinding(object sender, EventArgs e)
    {
        string groupID = Page.RouteData.Values["Group_id"] as string;

        if (groupID != null && groupID != "0")
        {
            Group group = new GroupBLL().GetGroupByGroupID(Convert.ToInt32(groupID));
            this.editor  = new Eisk.BusinessLogicLayer.UserBLL().GetUserByUserID(group.EditorUserID);
            this.creator = new Eisk.BusinessLogicLayer.UserBLL().GetUserByUserID(group.CreatorUserID);
            this.group   = group;
        }
    }
Exemplo n.º 19
0
        private void btnGroupDelete_Click(object sender, EventArgs e)
        {
            var confirmResult = MessageBox.Show("Bạn có chắc chắn muốn xóa??", "Xác nhận xóa!!", MessageBoxButtons.YesNo);

            if (confirmResult == DialogResult.Yes)
            {
                int id = int.Parse(tbGroupID.Text);
                GroupBLL.RemoveGroup(id);
                Thread loadGroupsThread = new Thread(() => LoadGroups());
                loadGroupsThread.Start();
                MessageBox.Show("Xóa thành công");
            }
        }
Exemplo n.º 20
0
        public bool Insert(GroupBLL g)
        {
            //Creating A Boolean VAriable and set its default value to false
            bool isSucces = false;

            //Connecting to Database
            SqlConnection conn = new SqlConnection(myconnstrng);

            try
            {
                //Writing Query to Add New Category
                string sql = "INSERT INTO Group_Master (Group_Name, Description) VALUES (@Group_Name, @Description)";

                //Creating SQL Command to pass values in our query
                SqlCommand cmd = new SqlCommand(sql, conn);
                //Passing Values through parameter
                cmd.Parameters.AddWithValue("@Group_Name", g.Group_Name);
                cmd.Parameters.AddWithValue("@Description", g.Description);


                //Open Database Connection
                conn.Open();

                //Creating the int variable to execute query
                int rows = cmd.ExecuteNonQuery();

                //If the query is executed successfully then its value will be greater than 0 else it will be less than 0

                if (rows > 0)
                {
                    //Query Executed Succesfully
                    isSucces = true;
                }
                else
                {
                    //Failed to Execute Query
                    isSucces = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                //Closing Database Connection
                conn.Close();
            }

            return(isSucces);
        }
        protected void DelItem(object s, CommandEventArgs e)
        {
            int id = Tools.GetInt(e.CommandArgument, 0);

            GroupElemsEntity entity = new GroupBLL().GetGroupElemByID(id);

            if (new GroupBLL().DeleteElem(id))
            {
                if (SchemeID == 104)
                {
                    OperateRecordEntity info = new OperateRecordEntity()
                    {
                        ElemId         = id,
                        reason         = "",
                        Status         = 1,
                        OperateFlag    = "3",
                        OperateType    = "1",
                        OperateExplain = "首页推荐位删除",
                        SourcePage     = 60,
                        UserName       = GetUserName(),
                    };
                    if (entity.PosID == 1)
                    {
                        info.OperateContent = entity.RecommTitle + "(Bnaner)";
                    }
                    else
                    {
                        if (entity.ShowType == 1)
                        {
                            info.OperateContent = entity.RecommTitle + "(广告位)";
                        }
                        else
                        {
                            info.OperateContent = entity.RecommTitle + "(推荐位)";
                        }
                    }
                    new OperateRecordBLL().Insert(info);
                }
                new SyncManagerBLL().NewRedis();

                this.Alert("删除成功!");
                Response.Redirect("HomePageRecommendByAppCenterList.aspx?acttype=" + GroupTypeID + "," + SchemeID + "&page=" + PageType);
                Response.End();
                Bind();
            }
            else
            {
                this.Alert("删除失败");
            }
        }
Exemplo n.º 22
0
        public bool Update(GroupBLL g)
        {
            //Creating Boolean variable and set its default value to false
            bool isSuccess = false;

            //Creating SQL Connection
            SqlConnection conn = new SqlConnection(myconnstrng);

            try
            {
                //Query to Update Category
                string sql = "UPDATE Group_Master SET Group_Name=@Group_Name, Description=@Description WHERE Group_ID=@Group_ID";

                //SQl Command to Pass the Value on Sql Query
                SqlCommand cmd = new SqlCommand(sql, conn);

                //Passing Value using cmd
                cmd.Parameters.AddWithValue("@Group_Name", g.Group_Name);
                cmd.Parameters.AddWithValue("@Description", g.Description);
                cmd.Parameters.AddWithValue("@Group_ID", g.Group_ID);

                //Open DAtabase Connection
                conn.Open();

                //Create Int Variable to execute query
                int rows = cmd.ExecuteNonQuery();

                //if the query is successfully executed then the value will be grater than zero
                if (rows > 0)
                {
                    //Query Executed Successfully
                    isSuccess = true;
                }
                else
                {
                    //Failed to Execute Query
                    isSuccess = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                conn.Close();
            }

            return(isSuccess);
        }
        protected void OnSave(object sender, EventArgs e)
        {
            var currentEntity = new GroupElemsEntity();

            currentEntity.GroupElemID  = _Id;
            currentEntity.ElemID       = nwbase_sdk.Tools.GetInt(hfAppID.Value, 0);
            currentEntity.ElemType     = 1;
            currentEntity.RecommPicUrl = hfIconUrl.Value;
            currentEntity.RecommTitle  = txtShowName.Text;
            currentEntity.RecommWord   = txtRecommWord.Text;
            currentEntity.StartTime    = DateTime.ParseExact(txtStartTime.Text, "yyyy-MM-dd HH:mm", System.Globalization.CultureInfo.CurrentCulture);
            currentEntity.EndTime      = DateTime.ParseExact(txtEndTime.Text, "yyyy-MM-dd HH:mm", System.Globalization.CultureInfo.CurrentCulture);
            currentEntity.Status       = nwbase_sdk.Tools.GetInt(ddlStatus.SelectedValue, 1);
            currentEntity.UpdateTime   = DateTime.Now;
            currentEntity.Remarks      = string.Empty;
            currentEntity.GroupID      = new GroupBLL().BeginnerRecommendGetGroupId(this.GroupTypeID, this.SchemeID);
            currentEntity.OrderNo      = Tools.GetRequestVal("order", 0);
            currentEntity.PosID        = txtPosID.Text.Trim().Convert <int>(0);

            //判断同一分组,位置编号是否重复
            bool answer = new GroupBLL().IsExistPosID(currentEntity);

            if (answer)
            {
                this.Alert("位置编号不能重复");
                return;
            }

            bool result = false;

            if (_Id <= 0)
            {
                //新增
                currentEntity.CreateTime = DateTime.Now;
                result = new GroupBLL().BeginnerRecommendInsert(currentEntity);
            }
            else
            {
                result = new GroupBLL().BeginnerRecommendUpdate(currentEntity);
            }
            if (result)
            {
                this.Alert("保存成功");
                Bind();
            }
            else
            {
                this.Alert("保存失败!");
            }
        }
Exemplo n.º 24
0
        public static int GetCostOfTourWithGroups(TourWithGroups tourWithGroups)
        {
            int total = 0;

            if (tourWithGroups.Groups == null)
            {
                return(0);
            }
            foreach (var group in tourWithGroups.Groups)
            {
                total += GroupBLL.GetTotalCostOfGroup(group);
            }
            return(total);
        }
Exemplo n.º 25
0
        protected void OnDel(object s, CommandEventArgs e)
        {
            int id = nwbase_sdk.Tools.GetInt(e.CommandArgument, 0);

            if (id > 0)
            {
                GroupInfoEntity entity = new GroupBLL().GetGroupInfoByID(id);
                if (entity.GroupTypeID > GroupTypeID)
                {
                    this.Alert("删除操作无效");
                }
                else
                {
                    var result = new GroupBLL().DeleteInfo(id);
                    if (result)
                    {
                        if (SchemeID == 104)
                        {
                            OperateRecordEntity info = new OperateRecordEntity()
                            {
                                ElemId         = entity.GroupID,
                                reason         = "",
                                Status         = 1,
                                OperateFlag    = "3",
                                SourcePage     = 61,
                                OperateType    = "5",
                                OperateExplain = "删除专题",
                                OperateContent = "删除专题(" + entity.GroupName + ")",
                                UserName       = GetUserName(),
                            };
                            new OperateRecordBLL().Insert(info);
                        }
                        this.Alert("删除成功");
                        BindDataLog();
                        Bind();
                    }
                    else
                    {
                        this.Alert("删除失败");
                    }
                }
            }
            else
            {
                this.Alert("删除参数无效");
            }
        }
Exemplo n.º 26
0
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);
        int promotionID = GetUrlInt("PromotionID");
        int groupID     = GetUrlInt("GroupID");
        int lineID      = GetUrlInt("LineID");

        if (promotionID > 0)
        {
            MyPromotion = PromotionBLL.Select(promotionID);
        }
        if (groupID > 0)
        {
            MyGroup = GroupBLL.SelectGroup(groupID);
        }
        if (lineID > 0)
        {
            MyLine = LineBLL.SelectLine(lineID);
        }

        if (MyLine == null || MyGroup == null)
        {
            Arrow.Framework.MessageBox.Jump("-1");
        }
        BindBuyNum();

        if (promotionID == 0)
        {
            ltPrice.Text = MyGroup.InnerPrice.ToString();
            ltTotal.Text = (MyGroup.InnerPrice * ddlBuyNum.SelectedValue.ToArrowInt()).ToString();
        }
        else
        {
            if (MyPromotion.PromotionType == PromotionType.Discount)
            {
                ltPrice.Text = decimal.Round(MyGroup.InnerPrice * MyPromotion.Discount, 2).ToString();
                ltTotal.Text = (ltPrice.Text.ToArrowDecimal() * ddlBuyNum.SelectedValue.ToArrowInt()).ToString();
            }
            else if (MyPromotion.PromotionType == PromotionType.Bundle)
            {
                ltPrice.Text            = MyPromotion.TotalPayOneTime.ToString();
                ddlBuyNum.SelectedValue = MyPromotion.TotalPayOneTimeJoinNum.ToString();
                ddlBuyNum.Enabled       = false;
                ltTotal.Text            = MyPromotion.TotalPayOneTime.ToString();
            }
        }
    }
 private void BindData()
 {
     if (this.Action == "Edit")
     {
         GroupElemsEntity entity = new GroupBLL().GetLauncherRecommendSingle(SchemeID, this.GroupElemID, GroupTypeID);
         this.ElemType.SelectedValue = entity.ElemType.ToString();
         this.GroupType.Value        = entity.GroupType.ToString();
         this.ElemID.Value           = entity.ElemID.ToString();
         this.txtShowName.Text       = entity.ElemID.ToString();
         this.RecommTitle.Value      = entity.RecommTitle;
         this.MainIconPicUrl.Value   = entity.RecommPicUrl;
         this.RecommWord.Text        = entity.RecommWord;
         this.RecommVal.Value        = entity.RecommVal.ToString();
         this.Status.SelectedValue   = entity.Status.ToString();
         this.Remarks.Text           = entity.Remarks;
     }
 }
Exemplo n.º 28
0
        private void GroupChat_Click(object sender, RoutedEventArgs e)
        {
            Button   button = (Button)sender;
            Group    group  = null;
            GroupBLL bll    = new GroupBLL();

            bll.GetGroupByID(Convert.ToInt32(button.Name.Split('_')[1]), out group);
            if (group == null)
            {
                MessageBox.Show("此群已被删除!");
                return;
            }
            OneToManyWindow onetomany = new OneToManyWindow(group, user);

            App.list2.Add(onetomany);
            onetomany.Show();
        }
Exemplo n.º 29
0
        private void Bind()
        {
            int posId   = Tools.GetRequestVal("PosID", -1);
            int orderNo = Tools.GetRequestVal("order", -1);

            PosId   = posId;
            OrderNo = orderNo;
            if (posId < 0)
            {
                return;
            }
            var allList = new GroupBLL().HomePageRecommendGetElemsByPosId(posId, this.GroupTypeID, this.SchemeID);

            var      runningList = new List <GroupElemsEntity>();
            var      toRunList   = new List <GroupElemsEntity>();
            var      expiredList = new List <GroupElemsEntity>();
            DateTime currentTime = DateTime.Now;

            foreach (var eachItem in allList)
            {
                if (eachItem.EndTime < currentTime)
                {
                    //已过期
                    expiredList.Add(eachItem);
                }
                else if (eachItem.StartTime > currentTime)
                {
                    //即将启用
                    toRunList.Add(eachItem);
                }
                else
                {
                    //启用中
                    runningList.Add(eachItem);
                }
            }

            RunningList.DataSource = runningList;
            ToRunList.DataSource   = toRunList;
            ExpiredList.DataSource = expiredList;

            RunningList.DataBind();
            ToRunList.DataBind();
            ExpiredList.DataBind();
        }
        private void Update()
        {
            GroupElemsEntity entity = new GroupElemsEntity();

            entity.GroupElemID  = this.GroupElemID;
            entity.ElemID       = this.ElemID.Value.Convert <int>(0);
            entity.RecommTitle  = this.RecommTitle.Value.Trim();
            entity.RecommPicUrl = this.MainIconPicUrl.Value.Trim();
            entity.RecommWord   = this.RecommWord.Text;
            entity.RecommVal    = this.RecommVal.Value.Convert <int>(0);
            entity.Status       = this.Status.SelectedValue.Convert <int>(0);
            entity.Remarks      = this.Remarks.Text.Trim();



            bool result = new GroupBLL().UpdateLauncherRecommend(entity);

            if (result)
            {
                if (SchemeID == 104)
                {
                    OperateRecordEntity info = new OperateRecordEntity()
                    {
                        ElemId         = entity.ElemID,
                        reason         = "",
                        Status         = 1,
                        OperateFlag    = "2",
                        SourcePage     = 65,
                        OperateType    = "9",
                        OperateExplain = "热门游戏管理:编辑游戏",
                        OperateContent = new AppInfoBLL().GetSingle(entity.ElemID).ShowName,
                        UserName       = GetUserName(),
                    };
                    new OperateRecordBLL().Insert(info);
                }
                //this.Alert("更新成功"); Response.Redirect(string.Format("LauncherRecommendList.aspx?acttype={0}&page={1}", ActType, PageType));
                this.Alert("更新成功", Request.ApplicationPath + string.Format("LauncherRecommendList.aspx?acttype={0}&page={1}", ActType, PageType));
                //Response.Redirect(Request.Url. "/LauncherRecommendList.aspx");
                //Response.Redirect(Request.Url.AbsolutePath + string.Format("?acttype={0}", ActType));
            }
            else
            {
                this.Alert("更新失败");
            }
        }