//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { ChkAdminLevel("account_list", DTEnums.ActionEnum.Delete.ToString()); //检查权限 int sucCount = 0; int errorCount = 0; BLL.account bll = new BLL.account(); 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) { if (bll.Delete(id)) { sucCount += 1; } else { errorCount += 1; } } } AddAdminLog(DTEnums.ActionEnum.Delete.ToString(), "删除记账信息" + sucCount + "条,失败" + errorCount + "条"); //记录日志 JscriptMsg("删除成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("account_list.aspx", "keywords={0}", this.keywords)); }
private void loaddata() { name.Text = DateTime.Now.ToShortDateString() + "填的单据"; return_str(); Maticsoft.BLL.account_detail ac_d = new BLL.account_detail(); dt_all = ac_d.GetList(500, "", " id desc").Tables[0]; DataTable dt = new DataTable(); dt.Columns.Add("id", typeof(int)); for (int i = 1; i < 6; i++) { DataRow row = dt.NewRow(); row["id"] = i; dt.Rows.Add(row); } GridView1.DataSource = dt; GridView1.DataBind(); AccountsPrincipal user = new AccountsPrincipal(Context.User.Identity.Name); User currentUser = new LTP.Accounts.Bus.User(user); //lururen.Text = currentUser.TrueName; Maticsoft.BLL.peixunban1 bll = new Maticsoft.BLL.peixunban1(); DataSet ds = new DataSet(); StringBuilder strWhere = new StringBuilder(); strWhere.Append("[start_time] < '"); strWhere.Append(DateTime.Today.AddDays(30).Date.ToShortDateString()); strWhere.Append("' and [end_time] > '"); strWhere.Append(DateTime.Today.AddDays(-30).Date.ToShortDateString()); strWhere.Append("'"); ds = bll.GetList(strWhere.ToString()); qishu.DataSource = ds; qishu.DataTextField = "name"; qishu.DataValueField = "id"; qishu.DataBind(); Maticsoft.BLL.account account_bll = new BLL.account(); DataSet ds2 = account_bll.lururen(""); jingshouren.DataSource = ds2; jingshouren.DataTextField = "lururen"; jingshouren.DataValueField = "lururen"; jingshouren.DataBind(); for (int i = 0; i < jingshouren.Items.Count; i++) { if (jingshouren.Items[i].Value.Trim() == currentUser.TrueName) { jingshouren.Items[i].Selected = true; } } //jingshouren.SelectedValue = currentUser.TrueName; luru_time.Text = DateTime.Now.ToShortDateString(); }
private void RptBind(string _strWhere, string _orderby) { this.page = DTRequest.GetQueryInt("page", 1); txtKeywords.Text = this.keywords; BLL.account bll = new BLL.account(); this.rptList.DataSource = bll.GetList(this.pageSize, this.page, _strWhere, _orderby, out this.totalCount); this.rptList.DataBind(); //绑定页码 txtPageNum.Text = this.pageSize.ToString(); string pageUrl = Utils.CombUrlTxt("account_list.aspx", "keywords={0}&page={1}", this.keywords, "__id__"); PageContent.InnerHtml = Utils.OutPageList(this.pageSize, this.page, this.totalCount, pageUrl, 8); }
private void ShowInfo(int _id) { BLL.account bll = new BLL.account(); Model.account model = bll.GetModel(_id); ddlXiehui.SelectedValue = model.xiehui_id.ToString(); ddlBSubject.SelectedValue = model.b_subject.ToString(); ddlSSubject.SelectedValue = model.s_subject.ToString(); txtAddTime.Text = model.date.Value.ToString("yyyy-MM-dd"); txtZhaiyao.Text = model.zhaiyao; txtJie.Text = model.jie.ToString(); txtDai.Text = model.dai.ToString(); //绑定图片相册 rptAlbumList.DataSource = model.albums; rptAlbumList.DataBind(); }
private int add_account() { Maticsoft.BLL.account acc_bll = new BLL.account(); Maticsoft.Model.account acc_mod = new Model.account(); acc_mod.leibei = leibie.SelectedValue; if (leibie.SelectedValue == "培训班费用") { acc_mod.peixunban_id = Convert.ToInt16(qishu.SelectedValue); } else { acc_mod.peixunban_id = 0; } acc_mod.name = name.Text.Trim(); acc_mod.time = Convert.ToDateTime(luru_time.Text.Trim()); acc_mod.beizhu = beizhu.Text.Trim(); acc_mod.lururen = jingshouren.SelectedValue; int i = acc_bll.Add(acc_mod); return(i); }
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); }
private void loaddata() { Maticsoft.BLL.account_view acc_bll = new BLL.account_view(); GridView1.DataSource = acc_bll.GetList(100, "", "detail_id"); GridView1.DataBind(); Maticsoft.BLL.peixunban1 bll = new Maticsoft.BLL.peixunban1(); DataSet ds = new DataSet(); StringBuilder strWhere = new StringBuilder(); strWhere.Append("[start_time] < '"); strWhere.Append(DateTime.Today.AddDays(30).Date.ToShortDateString()); strWhere.Append("' and [end_time] > '"); strWhere.Append(DateTime.Today.AddDays(-30).Date.ToShortDateString()); strWhere.Append("'"); ds = bll.GetList(strWhere.ToString()); DataRow newrow = ds.Tables[0].NewRow(); newrow["id"] = "999"; newrow["name"] = "—全部显示—"; ds.Tables[0].Rows.Add(newrow); qishu.DataSource = ds; qishu.DataTextField = "name"; qishu.DataValueField = "id"; qishu.DataBind(); Maticsoft.BLL.account account_bll = new BLL.account(); DataSet ds2 = account_bll.lururen(""); DataRow newrow2 = ds2.Tables[0].NewRow(); newrow2["lururen"] = "—全部显示—"; ds2.Tables[0].Rows.Add(newrow2); lururen.DataSource = ds2; lururen.DataTextField = "lururen"; lururen.DataValueField = "lururen"; lururen.DataBind(); }
private int DoAdd() { var successCount = 0; for (int i = 0; i < 10; i++) { DropDownList ddlXiehui = FindControl("ddlXiehui" + i) as DropDownList; DropDownList ddlBSubject = FindControl("ddlBSubject" + i) as DropDownList; DropDownList ddlSSubject = FindControl("ddlSSubject" + i) as DropDownList; TextBox txtAddTime = FindControl("txtAddTime" + i) as TextBox; TextBox txtJie = FindControl("txtJie" + i) as TextBox; TextBox txtDai = FindControl("txtDai" + i) as TextBox; TextBox txtZhaiyao = FindControl("txtZhaiyao" + i) as TextBox; if (ddlXiehui.SelectedValue.ToString() != "0") { if (ddlBSubject.SelectedValue.ToString() == "0") { JscriptMsg("请选择大类!", ""); return(0); } if (ddlSSubject.SelectedValue.ToString() == "0") { JscriptMsg("请选择小类!", ""); return(0); } Model.account model = new Model.account(); BLL.account bll = new BLL.account(); model.xiehui_id = Utils.StrToInt(ddlXiehui.SelectedValue, 0); model.b_subject = Utils.StrToInt(ddlBSubject.SelectedValue, 0); model.s_subject = Utils.StrToInt(ddlSSubject.SelectedValue, 0); model.date = Utils.StrToDateTime(txtAddTime.Text.Trim()).Date; model.jie = Utils.StrToDecimal(Utils.ObjectToStr(txtJie.Text.Trim()), 0); model.dai = Utils.StrToDecimal(Utils.ObjectToStr(txtDai.Text.Trim()), 0); model.zhaiyao = txtZhaiyao.Text.Trim(); #region 保存相册==================== string[] albumArr = Request.Form.GetValues("hid_photo_name" + i); string[] remarkArr = Request.Form.GetValues("hid_photo_remark" + i); string[] link_urlArr = Request.Form.GetValues("hid_photo_link_url" + i); if (albumArr != null && albumArr.Length > 0) { List <Model.account_albums> ls = new List <Model.account_albums>(); for (int j = 0; j < albumArr.Length; j++) { string[] imgArr = albumArr[j].Split('|'); if (imgArr.Length == 3) { if (!string.IsNullOrEmpty(link_urlArr[j])) { ls.Add(new Model.account_albums { original_path = imgArr[1], thumb_path = imgArr[2], link_url = link_urlArr[j] }); } if (!string.IsNullOrEmpty(remarkArr[j])) { ls.Add(new Model.account_albums { original_path = imgArr[1], thumb_path = imgArr[2], remark = remarkArr[j] }); } else { ls.Add(new Model.account_albums { original_path = imgArr[1], thumb_path = imgArr[2] }); } } } model.albums = ls; } #endregion if (bll.Add(model) > 0) { //AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加记账信息:" + model.name); //记录日志 successCount++; } } } return(successCount); }
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; }
private bool DoEdit(int _id) { bool result = false; BLL.account bll = new BLL.account(); Model.account model = bll.GetModel(_id); model.xiehui_id = Utils.StrToInt(ddlXiehui.SelectedValue.ToString(), 0); model.b_subject = Utils.StrToInt(ddlBSubject.SelectedValue.ToString(), 0); model.s_subject = Utils.StrToInt(ddlSSubject.SelectedValue.ToString(), 0); model.date = Utils.StrToDateTime(txtAddTime.Text.Trim()); model.zhaiyao = txtZhaiyao.Text.Trim(); model.jie = Utils.StrToDecimal(Utils.ObjectToStr(txtJie.Text.Trim()), 0); model.dai = Utils.StrToDecimal(Utils.ObjectToStr(txtDai.Text.Trim()), 0); #region 保存相册==================== //检查是否有自定义图片 if (model.albums != null) { model.albums.Clear(); } string[] albumArr = Request.Form.GetValues("hid_photo_name"); string[] remarkArr = Request.Form.GetValues("hid_photo_remark"); string[] linkUrlArr = Request.Form.GetValues("hid_photo_link_url"); if (albumArr != null) { List <Model.account_albums> ls = new List <Model.account_albums>(); for (int i = 0; i < albumArr.Length; i++) { string[] imgArr = albumArr[i].Split('|'); int img_id = Utils.StrToInt(imgArr[0], 0); if (imgArr.Length == 3) { if (linkUrlArr != null && !string.IsNullOrEmpty(linkUrlArr[i]) && !string.IsNullOrEmpty(remarkArr[i])) { ls.Add(new Model.account_albums { id = img_id, account_id = _id, original_path = imgArr[1], thumb_path = imgArr[2], remark = remarkArr[i], link_url = linkUrlArr[i] }); } else if (linkUrlArr != null && !string.IsNullOrEmpty(remarkArr[i]) && string.IsNullOrEmpty(linkUrlArr[i])) { ls.Add(new Model.account_albums { id = img_id, account_id = _id, original_path = imgArr[1], thumb_path = imgArr[2], remark = remarkArr[i] }); } else if (linkUrlArr != null && !string.IsNullOrEmpty(linkUrlArr[i]) && string.IsNullOrEmpty(remarkArr[i])) { ls.Add(new Model.account_albums { id = img_id, account_id = _id, original_path = imgArr[1], thumb_path = imgArr[2], link_url = linkUrlArr[i] }); } else { ls.Add(new Model.account_albums { id = img_id, account_id = _id, original_path = imgArr[1], thumb_path = imgArr[2] }); } } } model.albums = ls; } #endregion if (bll.Update(model)) { AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改记账信息:" + model.xiehui_id); //记录日志 result = true; } return(result); }