Exemple #1
0
        /// <summary>
        /// 绑定数据
        /// </summary>
        protected void databind(string year)
        {
            int       loginID = ((LoginInfo)Session["login"]).Id;
            DataTable dt      = AusDetialInfoManager.GetMonthCount(loginID, year);

            rptdata.DataSource = dt;
            rptdata.DataBind();

            Session["MyData"] = dt;
        }
        /// <summary>
        /// 删除报销单
        /// </summary>
        /// <param name="id">报销单id</param>
        private void Del(int id)
        {
            AusRottenInfo info = AusRottenInfoManager.GetModel(id);

            if (info != null)
            {
                int    jobflowid = info.jobflowid;
                string strdel    = " jobflowid=" + jobflowid;
                AuditJobFlowManager.Delete(strdel);
                JobFlowManager.Delete(jobflowid);
                JobFlowFileManager.Delete(jobflowid);
                AusDetialInfoManager.Del(jobflowid);
                //RegReimbursementManager.Delete(id.ToString());
                //ReimbursementInvoiceManager;
                AusRottenInfoManager.Delete(id);
            }
        }
Exemple #3
0
        protected void cuslist_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            string id = e.CommandArgument.ToString();

            switch (e.CommandName)
            {
            case "Delete":
                AusTypeInfo typeInfo = AusTypeInfoManager.getAusTypesById(Convert.ToInt32(id));
                string      typeName = typeInfo.typename;
                int         count    = AusDetialInfoManager.getAusDetialInfoByAusType(typeName);
                if (count > 0)
                {
                    this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('费用类别正在使用中,无法删除!');", true);
                }
                else
                {
                    bool del = AusTypeInfoManager.Delete(Convert.ToInt32(id));
                    if (del == true)
                    {
                        Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "add", "<script>alert('删除成功');window.location='AusTypeList.aspx'</script>", false);
                    }
                    else
                    {
                        Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "add", "<script>alert('删除失败')</script>", true);
                    }
                }
                break;

            case "Update":
                Response.Redirect("UpdateAusType.aspx?id=" + id);
                break;

            case "Tick":
                AusTypeInfo typeInfo1 = AusTypeInfoManager.getAusTypesById(Convert.ToInt32(id));
                typeInfo1.iscy = "y";
                AusTypeInfoManager.Update(typeInfo1);
                break;

            case "TurnBack":
                AusTypeInfo typeInfo2 = AusTypeInfoManager.getAusTypesById(Convert.ToInt32(id));
                typeInfo2.iscy = "n";
                AusTypeInfoManager.Update(typeInfo2);
                break;
            }
            dataBind();
        }