Esempio n. 1
0
        private void TreeBind()
        {
            BLL.xiehui bll = new BLL.xiehui();
            DataTable  dt  = bll.GetList("").Tables[0];

            for (int i = 0; i < 10; i++)
            {
                DropDownList ddlXiehui = FindControl("ddlXiehui" + i) as DropDownList;
                ddlXiehui.Items.Clear();
                ddlXiehui.Items.Add(new ListItem("请选择协会", "0"));
                foreach (DataRow dr in dt.Rows)
                {
                    string Id    = dr["id"].ToString();
                    string Title = dr["name"].ToString().Trim();
                    ddlXiehui.Items.Add(new ListItem(Title, Id));
                }

                BLL.subject subjectBll = new BLL.subject();
                DataTable   dtSubject  = subjectBll.GetParentList(0);

                DropDownList ddlBSubject = FindControl("ddlBSubject" + i) as DropDownList;
                ddlBSubject.Items.Clear();
                ddlBSubject.Items.Add(new ListItem("请选择科目大类", "0"));
                foreach (DataRow dr in dtSubject.Rows)
                {
                    string Id    = dr["id"].ToString();
                    string Title = dr["name"].ToString().Trim();
                    ddlBSubject.Items.Add(new ListItem(Title, Id));
                }
            }
        }
Esempio n. 2
0
        private void TreeBind()
        {
            BLL.subject bll = new BLL.subject();
            DataTable   dt  = bll.GetList(0);

            this.ddlParentId.Items.Clear();
            this.ddlParentId.Items.Add(new ListItem("无父级分类", "0"));
            foreach (DataRow dr in dt.Rows)
            {
                string Id         = dr["id"].ToString();
                int    ClassLayer = int.Parse(dr["class_layer"].ToString());
                string Title      = dr["name"].ToString().Trim();

                if (ClassLayer == 1)
                {
                    this.ddlParentId.Items.Add(new ListItem(Title, Id));
                }
                else
                {
                    Title = "├ " + Title;
                    Title = Utils.StringOfChar(ClassLayer - 1, " ") + Title;
                    this.ddlParentId.Items.Add(new ListItem(Title, Id));
                }
            }
        }
Esempio n. 3
0
        private bool DoEdit(int _id)
        {
            try
            {
                BLL.subject   bll   = new BLL.subject();
                Model.subject model = bll.GetModel(_id);

                int parentId = int.Parse(ddlParentId.SelectedValue);
                model.name = txtName.Text.Trim();
                //如果选择的父ID不是自己,则更改
                if (parentId != model.id)
                {
                    model.parent_id = parentId;
                }
                model.sort_id = int.Parse(txtSortId.Text.Trim());
                model.type    = rblPageType.SelectedValue;
                if (bll.Update(model))
                {
                    AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改科目分类:" + model.name); //记录日志
                    return(true);
                }
            }
            catch
            {
                return(false);
            }
            return(false);
        }
Esempio n. 4
0
        private void TreeBind()
        {
            BLL.xiehui bll = new BLL.xiehui();
            DataTable  dt  = bll.GetList("").Tables[0];

            this.ddlXiehui.Items.Clear();
            this.ddlXiehui.Items.Add(new ListItem("请选择协会", "0"));
            foreach (DataRow dr in dt.Rows)
            {
                string Id    = dr["id"].ToString();
                string Title = dr["name"].ToString().Trim();
                this.ddlXiehui.Items.Add(new ListItem(Title, Id));
            }

            BLL.subject bllSubject = new BLL.subject();
            DataTable   dtSubject  = bllSubject.GetParentList(0);

            ddlBSubject.Items.Clear();
            ddlBSubject.Items.Add(new ListItem("请选择科目大类", "0"));
            foreach (DataRow dr in dtSubject.Rows)
            {
                string Id    = dr["id"].ToString();
                string Title = dr["name"].ToString().Trim();
                ddlBSubject.Items.Add(new ListItem(Title, Id));
            }
        }
Esempio n. 5
0
        //数据绑定
        private void RptBind()
        {
            BLL.subject bll = new BLL.subject();
            DataTable   dt  = bll.GetList(0);

            this.rptList.DataSource = dt;
            this.rptList.DataBind();
        }
Esempio n. 6
0
        private void ShowInfo(int _id)
        {
            BLL.subject   bll   = new BLL.subject();
            Model.subject model = bll.GetModel(_id);

            ddlParentId.SelectedValue = model.parent_id.ToString();
            txtName.Text              = model.name;
            txtSortId.Text            = model.sort_id.ToString();
            rblPageType.SelectedValue = model.type.ToString();
        }
Esempio n. 7
0
 //删除导航
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     BLL.subject bll = new BLL.subject();
     for (int i = 0; i < rptList.Items.Count; i++)
     {
         int      id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
         CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId");
         if (cb.Checked)
         {
             bll.Delete(id);
         }
     }
     AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), "删除导航菜单"); //记录日志
     JscriptMsg("删除数据成功!", "subject_list.aspx", "parent.loadMenuTree");
 }
Esempio n. 8
0
 //保存
 public void subjcet_Change_Click(object sender, EventArgs e)
 {
     if (ddlBSubject.SelectedValue.ToString() != "0")
     {
         ddlSSubject.Items.Clear();
         BLL.subject subjectBll = new BLL.subject();
         DataTable   dtSubject  = subjectBll.GetList(Utils.StrToInt(ddlBSubject.SelectedValue, 0));
         foreach (DataRow dr in dtSubject.Rows)
         {
             string Id    = dr["id"].ToString();
             string Title = dr["name"].ToString().Trim();
             ddlSSubject.Items.Add(new ListItem(Title, Id));
         }
     }
 }
Esempio n. 9
0
 //保存排序
 protected void btnSave_Click(object sender, EventArgs e)
 {
     BLL.subject bll = new BLL.subject();
     for (int i = 0; i < rptList.Items.Count; i++)
     {
         int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value);
         int sortId;
         if (!int.TryParse(((TextBox)rptList.Items[i].FindControl("txtSortId")).Text.Trim(), out sortId))
         {
             sortId = 99;
         }
         bll.UpdateField(id, "sort_id=" + sortId.ToString());
     }
     AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "保存导航排序"); //记录日志
     JscriptMsg("保存排序成功!", "subject_list.aspx");
 }
Esempio n. 10
0
        private static string GetAmount(string subjetNmae, DataRow dr)
        {
            BLL.subject        subjectBll       = new BLL.subject();
            BLL.subject_detail subjectDetailBll = new BLL.subject_detail();

            var xianjinId     = subjectBll.GetNavId(subjetNmae);
            var xianjinModel  = subjectBll.GetModel(xianjinId);
            var subjcetDetail = subjectDetailBll.GetModel(Utils.ObjToInt(xianjinModel.parent_id, 0), xianjinModel.id);
            var amount        = "0";

            if (subjcetDetail != null)
            {
                amount = subjcetDetail.amount.ToString();
                //如果是当前科目则进行计算
                if (Utils.StrToInt(dr["s_subject"].ToString(), 0) == xianjinModel.id)
                {
                    amount = (Utils.StrToInt(subjcetDetail.amount.ToString(), 0) - Utils.StrToInt(dr["jie"].ToString(), 0) + Utils.StrToInt(dr["dai"].ToString(), 0)).ToString();
                }
            }
            return(amount);
        }
Esempio n. 11
0
 private bool DoAdd()
 {
     try
     {
         Model.subject model = new Model.subject();
         BLL.subject   bll   = new BLL.subject();
         model.name      = txtName.Text.Trim();
         model.parent_id = int.Parse(ddlParentId.SelectedValue);
         model.sort_id   = int.Parse(txtSortId.Text.Trim());
         model.type      = rblPageType.SelectedValue;
         if (bll.Add(model) > 0)
         {
             AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加科目分类:" + model.name); //记录日志
             return(true);
         }
     }
     catch
     {
         return(false);
     }
     return(false);
 }
Esempio n. 12
0
        private List <StatisEntity> GetStatisList()
        {
            BLL.account bll       = new BLL.account();
            BLL.xiehui  xiehuiBll = new BLL.xiehui();

            var id   = xiehuiBll.GetId(txtTown.Text, txtVillage.Text);
            var ds   = bll.GetStatisList(this.keywords, Utils.StrToInt(id, 0), Utils.StrToInt(this.bSubject, 0), Utils.StrToInt(this.sSubject, 0)).Tables[0];
            var list = new List <StatisEntity>();

            foreach (DataRow item in ds.Rows)
            {
                BLL.subject_detail subjectDetailBll = new BLL.subject_detail();
                var subjcetDetail = subjectDetailBll.GetModel(Utils.StrToInt(item["b_subject"].ToString(), 0), Utils.StrToInt(item["s_subject"].ToString(), 0));
                if (subjcetDetail == null)
                {
                    continue;
                }
                var model  = new StatisEntity();
                var xiehui = xiehuiBll.GetModel(Utils.StrToInt(item["xiehui_id"].ToString(), 0));

                BLL.subject subjectBll   = new BLL.subject();
                var         bSubjectName = subjectBll.GetName(Utils.StrToInt(item["b_subject"].ToString(), 0));
                var         sSubjectName = subjectBll.GetName(Utils.StrToInt(item["s_subject"].ToString(), 0));

                model.Town      = xiehui.town;
                model.Village   = xiehui.village;
                model.XieHui    = xiehui.name;
                model.BBSubjcet = bSubjectName;
                model.SSbuject  = sSubjectName;
                model.Amount    = subjcetDetail.amount.ToString();
                model.BQJie     = item["jie"].ToString();
                model.BQDai     = item["dai"].ToString();
                model.QmAmount  = (Utils.StrToInt(subjcetDetail.amount.ToString(), 0) - Utils.StrToInt(item["jie"].ToString(), 0) + Utils.StrToInt(item["dai"].ToString(), 0)).ToString();
                list.Add(model);
            }
            return(list);
        }
Esempio n. 13
0
        private List <StatisEntity> GetStatisList()
        {
            BLL.account        bll              = new BLL.account();
            BLL.xiehui         xiehuiBll        = new BLL.xiehui();
            BLL.subject        subjectBll       = new BLL.subject();
            BLL.subject_detail subjectDetailBll = new BLL.subject_detail();

            var ds   = bll.GetStatisList(this.keywords, 0, Utils.StrToInt(ddlBSubject.SelectedValue, 0), Utils.StrToInt(ddlSSubject.SelectedValue, 0)).Tables[0];
            var list = new List <StatisEntity>();

            foreach (DataRow dr in ds.Rows)
            {
                var xiehui = xiehuiBll.GetModel(Utils.StrToInt(dr["xiehui_id"].ToString(), 0));
                var model  = new StatisEntity();
                model.Town    = xiehui.town;
                model.Village = xiehui.village;
                model.XieHui  = xiehui.name;
                model.XianJin = GetAmount("现金", dr);
                model.YHCK    = GetAmount("银行存款", dr);
                model.JCHZJ   = GetAmount("借出互助金", dr);
                //资产小计=现金+银行存款+借出互助金
                model.ZCXJ = (Utils.StrToInt(model.XianJin, 0) + Utils.StrToInt(model.YHCK, 0) + Utils.StrToInt(model.JCHZJ, 0)).ToString();
                //借出互助资金占比率=资产小计/借出互助金
                model.JCZB  = Utils.StrToInt(model.JCHZJ, 0) == 0 ? "0" : (Utils.StrToInt(model.ZCXJ, 0) / Utils.StrToInt(model.JCHZJ, 0)).ToString();
                model.RHHZ  = GetAmount("会员入会互助金", dr);
                model.ZFHZJ = GetAmount("政府拨入互助资金", dr);
                //负债小计=会员入会互助金+政府拨入互助金
                model.FZXJ = (Utils.StrToInt(model.RHHZ, 0) + Utils.StrToInt(model.ZFHZJ, 0)).ToString();
                //净资产=资产小计-负债小计
                model.JZC  = (Utils.StrToInt(model.ZCXJ, 0) + Utils.StrToInt(model.FZXJ, 0)).ToString();
                model.ZFBZ = GetAmount("政府补助收入", dr);
                model.JCZY = GetAmount("互助金占用费收入", dr);
                model.YWGL = GetAmount("业务管理费收入", dr);
                model.GYJ  = GetAmount("公益金", dr);
                //收入小计=政府补助收入+互助金占用费收入+业务管理费收入+公益金
                model.SRXJ = (Utils.StrToInt(model.ZFBZ, 0) + Utils.StrToInt(model.JCZY, 0) + Utils.StrToInt(model.YWGL, 0) + Utils.StrToInt(model.GYJ, 0)).ToString();
                model.HDZC = GetAmount("业务活动支出", dr);
                //本期结余=收入小计-业务活动支出
                model.BQJY = (Utils.StrToInt(model.SRXJ, 0) + Utils.StrToInt(model.HDZC, 0)).ToString();
                list.Add(model);
            }
            //var list = new List<StatisEntity>()
            //{
            //   new StatisEntity(){Town="漩涡镇",Village="茨沟村",XieHui="漩涡镇茨沟村协会",XianJin="",YHCK="191816.41",JCHZJ="556000.00",ZCXJ="747816.41",JCZB="74.35%",RHHZ="54600.00",ZFHZJ="693780",FZXJ="748380",JZC="-563.59 ",ZFBZ="",JCZY="250.00",GYJ="",SRXJ="1261.41",HDZC="1825",BQJY="-563.59"},

            //   new StatisEntity(){Town="漩涡镇",Village="东河村",XieHui="漩涡镇东河村协会",XianJin="",YHCK="307102.74",JCHZJ="451000.00",ZCXJ="758102.74",JCZB="59.49%",RHHZ="39400.00",ZFHZJ="713420",FZXJ="752820",JZC="5282.74",ZFBZ="",JCZY="5282.74",GYJ="",SRXJ="5282.74",HDZC="",BQJY="5282.74"},

            //   new StatisEntity(){Town="漩涡镇",Village="金星村",XieHui="漩涡镇金星村协会",XianJin="",YHCK="237406.44 ",JCHZJ="555000.00",ZCXJ="792406.44",JCZB="70.04%",RHHZ="48300.00",ZFHZJ="741740",FZXJ="790040",JZC="2366.44",ZFBZ="",JCZY="2366.44",GYJ="",SRXJ="2366.44",HDZC="",BQJY="2366.44"},

            //   new StatisEntity(){Town="漩涡镇",Village="田凤村",XieHui="漩涡镇田凤村协会",XianJin="",YHCK="494204.05",JCHZJ="305000.00",ZCXJ="799204.05",JCZB="38.16%",RHHZ="27000.00",ZFHZJ="770950",FZXJ="797950",JZC="1254.05",ZFBZ="",JCZY="1254.05",GYJ="",SRXJ="1254.05",HDZC="",BQJY="1254.05"},

            //   new StatisEntity(){Town="漩涡镇",Village="田堰村",XieHui="漩涡镇田堰村协会",XianJin="",YHCK="441926.13",JCHZJ="310000.00",ZCXJ="751926.13",JCZB="41.23%",RHHZ="29900.00",ZFHZJ="715700",FZXJ="745600",JZC="6326.13",ZFBZ="",JCZY="8121.13",GYJ="",SRXJ="8121.13",HDZC="1795",BQJY="6326.13"},

            //   new StatisEntity(){Town="漩涡镇",Village="上七村",XieHui="漩涡镇上七村协会",XianJin="",YHCK="500379.17",JCHZJ="",ZCXJ="500379.17",JCZB="0.00%",RHHZ="",ZFHZJ="500000",FZXJ="500000",JZC="379.17",ZFBZ="",JCZY="379.17",GYJ="",SRXJ="379.17",HDZC="",BQJY="379.17"},

            //   new StatisEntity(){Town="漩涡镇",Village="龙泉村",XieHui="漩涡镇龙泉村协会",XianJin="237",YHCK="170990.74",JCHZJ="370000.00",ZCXJ="541227.74",JCZB="68.36%",RHHZ="42700.00",ZFHZJ="500000",FZXJ="542700",JZC="-1472.26",ZFBZ="",JCZY="290.74",GYJ="",SRXJ="290.74",HDZC="1763",BQJY="-1472.26"},

            //   new StatisEntity(){Town="漩涡镇",Village="中银村",XieHui="漩涡镇中银村协会",XianJin="47",YHCK="246524.64",JCHZJ="412000.00",ZCXJ="658571.64",JCZB="62.56%",RHHZ="41900.00",ZFHZJ="600000",FZXJ="641900",JZC="16671.64",ZFBZ="",JCZY="18576.64",GYJ="",SRXJ="18576.64",HDZC="1905",BQJY="16671.64"},
            //};
            return(list);
            //BLL.account bll = new BLL.account();
            //var ds = bll.GetStatisList(this.keywords,1, Utils.StrToInt(this.bSubject, 0), Utils.StrToInt(this.sSubject, 0)).Tables[0];
            //var list = new List<StatisEntity>();
            //foreach (DataRow item in ds.Rows)
            //{
            //    BLL.subject_detail subjectDetailBll = new BLL.subject_detail();
            //    var subjcetDetail = subjectDetailBll.GetModel(Utils.StrToInt(item["b_subject"].ToString(), 0), Utils.StrToInt(item["s_subject"].ToString(), 0));
            //    if (subjcetDetail == null)
            //    {
            //        continue;
            //    }
            //    var model = new StatisEntity();
            //    BLL.xiehui xiehuiBll = new BLL.xiehui();
            //    var xiehui = xiehuiBll.GetModel(Utils.StrToInt(item["xiehui_id"].ToString(), 0));

            //    BLL.subject subjectBll = new BLL.subject();
            //    var bSubjectName = subjectBll.GetName(Utils.StrToInt(item["b_subject"].ToString(), 0));
            //    var sSubjectName = subjectBll.GetName(Utils.StrToInt(item["s_subject"].ToString(), 0));

            //    model.Town = xiehui.town;
            //    model.Village = xiehui.village;
            //    model.XieHui = xiehui.name;
            //    model.BBSubjcet = bSubjectName;
            //    model.SSbuject = sSubjectName;
            //    model.Amount = subjcetDetail.amount.ToString();
            //    model.BQJie = item["jie"].ToString();
            //    model.BQDai = item["dai"].ToString();
            //    model.QmAmount = (Utils.StrToInt(subjcetDetail.amount.ToString(), 0) - Utils.StrToInt(item["jie"].ToString(), 0) + Utils.StrToInt(item["dai"].ToString(), 0)).ToString();
            //    list.Add(model);
            //}
            //return list;
        }