public static string OperateRecords(string ids, int op)
        {
            string[] array = ids.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            using (BLLSuccessStoriesType bll = new BLLSuccessStoriesType())
            {
                foreach (string id in array)
                {
                    switch (op)
                    {
                    case 7:

                        using (BLLSuccessStories blls1 = new BLLSuccessStories())
                        {
                            SearchSuccessStories con3 = new SearchSuccessStories();
                            con3.SSType = Convert.ToInt32(id);

                            if (blls1.GetList(con3).Count > 0)
                            {
                                return("此成功案例类型下有相应的信息,不能删除!");
                            }
                        }

                        bll.Delete(id);
                        break;
                    }
                }

                if (bll.IsFail)
                {
                    return(ExceptionManager.GetErrorMsg(bll.DevNetException));
                }
            }
            return(string.Empty);
        }
        private void bindList()
        {
            SearchSuccessStoriesType con = new SearchSuccessStoriesType();

            con.SSTypeName = txtSuccessStoriesTypeName.Text.Trim().ToString();
            if (rbtnIsChinese.Checked == true)
            {
                con.IsEnglish = 1;
            }
            else if (rbtnIsEnglish.Checked == true)
            {
                con.IsEnglish = 2;
            }
            Pagination pagina = new Pagination(pager.PageIndex, pager.PageSize, 0);

            using (BLLSuccessStoriesType bll = new BLLSuccessStoriesType())
            {
                List <SuccessStoriesType> lists = bll.GetPageList(con, pagina, SuccessStoriesType.ID_FieldName, ScriptQuery.SortEnum.DESC);

                pager.RecordCount = pagina.RecordCount;
                pager.PageCount   = pagina.PageCount;

                grid_friendlink.DataSource = lists;
                grid_friendlink.DataBind();
            }
        }
Example #3
0
        private void getProtypeList()
        {
            SearchSuccessStoriesType search = new SearchSuccessStoriesType();

            using (BLLSuccessStoriesType bll = new BLLSuccessStoriesType())
            {
                DataTable dt = bll.GetTable(search);//ScriptQuery.SortEnum.DESC
                if (dt != null)
                {
                    ddlSuccessStoriesType.DataSource     = dt;
                    ddlSuccessStoriesType.DataTextField  = SuccessStoriesType.SSTypeName_FieldName;
                    ddlSuccessStoriesType.DataValueField = SuccessStoriesType.ID_FieldName;
                    ddlSuccessStoriesType.DataBind();
                }
            }
        }
 /// <summary>
 /// 获取成功案例类别名称
 /// </summary>
 protected string GetSuccessStoriesTypeName(int proinfotype)
 {
     using (BLLSuccessStoriesType bll = new BLLSuccessStoriesType())
     {
         SuccessStoriesType obj = new SuccessStoriesType();
         if (proinfotype > 0)
         {
             obj = bll.GetSingle(proinfotype);
             if (obj != null)
             {
                 return(obj.SSTypeName.ToString());
             }
         }
         return("");
     }
 }
        private void getProtypeList()
        {
            SearchSuccessStoriesType search = new SearchSuccessStoriesType();

            using (BLLSuccessStoriesType bll = new BLLSuccessStoriesType())
            {
                DataTable dt = bll.GetTable(search);
                if (dt != null)
                {
                    ddlSuccessStoriesType.DataSource     = dt;
                    ddlSuccessStoriesType.DataTextField  = SuccessStoriesType.SSTypeName_FieldName;
                    ddlSuccessStoriesType.DataValueField = SuccessStoriesType.ID_FieldName;
                    ddlSuccessStoriesType.DataBind();
                    ddlSuccessStoriesType.Items.Insert(0, new ListItem("==请选择类型==", "0"));
                }
            }
        }
Example #6
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            using (BLLSuccessStoriesType bll = new BLLSuccessStoriesType())
            {
                SuccessStoriesType obj = new SuccessStoriesType();

                if (id > 0)
                {
                    obj    = bll.GetSingle(id);
                    obj.ID = id;
                }
                obj.SSTypeName = txtSSTypeName.Text.Trim().ToString();
                obj.Remarks    = txtRemarks.Text.ToString();
                obj.AutoSort   = Convert.ToInt32(txtAutoSort.Text);
                if (rbtnIsChinese.Checked == true)
                {
                    obj.IsEnglish = 1;
                }
                else if (rbtnIsEnglish.Checked == true)
                {
                    obj.IsEnglish = 2;
                }
                else
                {
                    ShowMsg("请选择语言类别!");
                    return;
                }

                bll.Save(obj);

                if (bll.IsFail)
                {
                    ExceptionManager.ShowErrorMsg(this, bll.DevNetException);
                }
                else
                {
                    JSMsg.ShowWinRedirect(this, "保存成功", "cpSuccessStoriesTypeList.aspx");
                }
            }
        }
Example #7
0
 private void setInfo()
 {
     if (id > 0)
     {
         using (BLLSuccessStoriesType bll = new BLLSuccessStoriesType())
         {
             SuccessStoriesType cpinfor = bll.GetSingle(id);
             if (cpinfor != null)
             {
                 if (cpinfor.IsEnglish == 1)
                 {
                     rbtnIsChinese.Checked = true;
                 }
                 else if (cpinfor.IsEnglish == 2)
                 {
                     rbtnIsEnglish.Checked = true;
                 }
                 txtSSTypeName.Text = cpinfor.SSTypeName;
                 txtRemarks.Text    = cpinfor.Remarks;
                 txtAutoSort.Text   = cpinfor.AutoSort.ToString();
             }
         }
     }
 }