예제 #1
0
 protected virtual void Page_Load(object sender, EventArgs e)
 {
     Act             = HTTPRequest.GetString("Act");
     ShowType        = HTTPRequest.GetString("ShowType");
     DepartmentsJson = Caches.GetDepartmentsClassInfoToJson(-1, true, true);
     SupplierJson    = Caches.GetSupplierClassInfoToJson(-1, true, true);
     CustomersJson   = Caches.GetCustomersClassInfoToJson(-1, true, true);
     FeesSubjectJson = Caches.GetFeesSubjectClassInfoToJson(-1, false, true);
 }
        public string FeesSubjectName = ""; //移动至某个科目下
        protected virtual void Page_Load(object sender, EventArgs e)
        {
            if (this.userid > 0)
            {
                if (CheckUserPopedoms("X") || CheckUserPopedoms("6-1-3"))
                {
                    FeesSubjectJson = Caches.GetFeesSubjectClassInfoToJson(-1, false, true);
                    sName           = HTTPRequest.GetString("sName").Trim();
                    sID             = HTTPRequest.GetInt("FeesSubjectClassID", 0);


                    if (ispost)
                    {
                        certificateID   = HTTPRequest.GetString("Content");
                        classID         = HTTPRequest.GetInt("treeNode", -1);
                        lastName        = HTTPRequest.GetString("lastName").Trim();
                        FeesSubjectName = HTTPRequest.GetString("getTreeName").Trim();

                        if (certificateID != "")
                        {
                            if (classID > -1)
                            {
                                int uState = DataClass.updateCertificateToFeessubjects(certificateID, classID, HTTPRequest.GetInt("sFeeID", 0));
                                if (uState > 0)
                                {
                                    //记录修改操作
                                    Logs.AddEventLog(this.userid, "将" + lastName + "科目下凭证移动至" + FeesSubjectName);
                                    Response.Write(uState);
                                    Response.End();
                                }
                                else
                                {
                                    Response.Write("0");
                                    Response.End();
                                }
                            }
                            else
                            {
                                AddErrLine("请核对选中的科目信息!");
                            }
                        }
                        else
                        {
                            AddErrLine("请核对选中的凭证信息!");
                        }
                    }
                    else
                    {
                        cList = DataClass.getCertificateDate(sID);
                    }
                }
                else
                {
                    AddErrLine("权限不足!");
                    AddScript("window.parent.HidBox();");
                }
            }
            else
            {
                AddErrLine("请先登录!");
                SetBackLink("login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
                SetMetaRefresh(1, "login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
            }
        }
예제 #3
0
        protected virtual void Page_Load(object sender, EventArgs e)
        {
            if (this.userid > 0)
            {
                if (CheckUserPopedoms("X") || CheckUserPopedoms("6-7-9"))
                {
                    //科目树
                    FeesSubjectJson = Caches.GetFeesSubjectClassInfoToJson(-1, false, true);

                    bDate    = (HTTPRequest.GetString("bDate").Trim() != "") ? Convert.ToDateTime(HTTPRequest.GetString("bDate").Trim()) : DateTime.Now.AddDays(-(DateTime.Now.Day) + 1); //获得日期
                    eDate    = (HTTPRequest.GetString("eDate").Trim() != "") ? Convert.ToDateTime(HTTPRequest.GetString("eDate").Trim()) : DateTime.Now;                                  //获得日期
                    sType    = HTTPRequest.GetInt("seType", -1);                                                                                                                          //统计类型:0=明细统计,1=总账统计
                    getYear  = bDate.ToString("yyyy");
                    oneMonth = Convert.ToInt32(bDate.ToString("MM"));
                    status   = HTTPRequest.GetInt("get_status", 0);


                    //获得科目选择,遍历科目
                    fsubject = HTTPRequest.GetString("subject_hd");
                    result   = fsubject.Split(',');



                    if (ispost)
                    {
                        for (int i = 0; i < result.Length - 1; i++)
                        {
                            //获得科目所选节点科目名称
                            fsubjectName = CostDetails.getObjectsListName(Convert.ToInt32(result[i]));

                            //判断是否有子节点
                            tl = DataClass.ExistsFeesSubjectClassChild(Convert.ToInt32(result[i]));
                            if (tl)
                            {
                                dataclass = CostDetails.getTreeChildrenCount(result[i]); //找到子节点
                                string[] dclass = dataclass.Split(',');
                                for (int j = 0; j < dclass.Length - 1; j++)
                                {
                                    //获得月份
                                    mList         = CostDetails.getMonthBySubjectAndDateTime(Convert.ToInt32(dclass[j]), bDate, eDate);
                                    mdt           = mList.Copy();
                                    mdt.TableName = "m_" + j + c_count;
                                    mds.Tables.Add(mdt);


                                    //获得最大月
                                    maxList += CostDetails.getMonthBySubjectAndDateTime_Max(Convert.ToInt32(dclass[j]), bDate, eDate) + ",";
                                    //获得科目名称及编码
                                    objectName = CostDetails.getSubjectNameAndID(Convert.ToInt32(dclass[j]));

                                    //上年结转余额
                                    dList         = CostDetails.getOccurrenceAndBalanceDetails(bDate, eDate, Convert.ToInt32(dclass[j]), status);
                                    ydt           = dList.Copy();
                                    ydt.TableName = "y_" + j + c_count;
                                    yds.Tables.Add(ydt);

                                    c_count++;
                                }
                                //--====================================月份合成表=============================================
                                msCost = mds.Tables[0].Clone();                        //创建新表 克隆以有表的架构
                                object[] objmArray = new object[msCost.Columns.Count]; //定义与表列数相同的对象数组 存放表的一行的值
                                for (int m = 0; m < mds.Tables.Count; m++)
                                {
                                    if (mds.Tables[m].Rows.Count > 0)
                                    {
                                        for (int n = 0; n < mds.Tables[m].Rows.Count; n++)
                                        {
                                            mds.Tables[m].Rows[n].ItemArray.CopyTo(objmArray, 0); //将表的一行的值存放数组中
                                            msCost.Rows.Add(objmArray);                           //将数组的值添加到新表中
                                        }
                                    }
                                }
                                DataView dv = new DataView(msCost);
                                dv.Sort = "oMonth";
                                nTable  = dv.ToTable(true, "oMonth");
                                //=====================上年结存余额合成一张表==============================
                                ysCost = yds.Tables[0].Clone();                       //创建新表 克隆以有表的架构
                                object[] objArray = new object[ysCost.Columns.Count]; //定义与表列数相同的对象数组 存放表的一行的值
                                for (int m = 0; m < yds.Tables.Count; m++)
                                {
                                    if (yds.Tables[m].Rows.Count > 0)
                                    {
                                        for (int n = 0; n < yds.Tables[m].Rows.Count; n++)
                                        {
                                            yds.Tables[m].Rows[n].ItemArray.CopyTo(objArray, 0); //将表的一行的值存放数组中
                                            ysCost.Rows.Add(objArray);                           //将数组的值添加到新表中
                                        }
                                    }
                                }
                                if (ysCost.Rows.Count > 0)
                                {
                                    ycAccountMoney = Convert.ToDecimal(ysCost.Compute("sum(cAccountMoney)", "").ToString());
                                }

                                //====================找到科目中最大月========================================
                                string[] maxListArrary = maxList.Split(',');

                                for (int q = 0; q < maxListArrary.Length - 1; q++)
                                {
                                    if (maxListArrary[q].ToString() != "")
                                    {
                                        int mValue = Convert.ToInt32(maxListArrary[q].ToString());
                                        if (mValue > maxValue)
                                        {
                                            maxValue = mValue;
                                        }
                                    }
                                }
                                maxList = maxValue.ToString();
                            }
                            else
                            {
                                //上年结转余额
                                ysCost = CostDetails.getOccurrenceAndBalanceDetails(bDate, eDate, Convert.ToInt32(result[i]), status);
                                //获得月份
                                nTable = CostDetails.getMonthBySubjectAndDateTime(Convert.ToInt32(result[i]), bDate, eDate);
                                //获得最大月
                                maxList = CostDetails.getMonthBySubjectAndDateTime_Max(Convert.ToInt32(result[i]), bDate, eDate);
                                //获得科目名称及编码
                                objectName = CostDetails.getSubjectNameAndID(Convert.ToInt32(result[i]));
                            }
                        }
                    }
                }
                else
                {
                    AddErrLine("权限不足!");
                }
            }
            else
            {
                AddErrLine("请先登录!");
                SetBackLink("login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
                SetMetaRefresh(1, "login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
            }
        }
예제 #4
0
        protected virtual void Page_Load(object sender, EventArgs e)
        {
            if (this.userid > 0)
            {
                if (CheckUserPopedoms("X") || CheckUserPopedoms("6-1-2"))
                {
                    Act             = HTTPRequest.GetString("Act");
                    FeesSubjectJson = Caches.GetFeesSubjectClassInfoToJson(-1, false, true);
                    if (Act == "Edit")
                    {
                        BankID = Utils.StrToInt(HTTPRequest.GetString("bid"), 0);

                        ba = tbBankInfo.GetBankModel(BankID);
                    }
                    if (ispost)
                    {
                        bName       = HTTPRequest.GetString("FeesSubject").Trim();    //账户名称
                        beginMoney  = HTTPRequest.GetString("beginMoney");            //期初金额
                        FeesSubject = HTTPRequest.GetInt("FeesSubjectID", 0);         //获取科目
                        //bAppendTime = Utils.IsDateString(Utils.ChkSQL(HTTPRequest.GetString("bAppendTime"))) ? DateTime.Parse(Utils.ChkSQL(HTTPRequest.GetString("bAppendTime"))) : DateTime.Now;  //操作日期

                        //获得科目方向
                        cDirecion = tbBankInfo.ClassDiretion(FeesSubject);
                        //检查账户名称是否存在
                        bool checkName = tbBankInfo.ExistsBank(FeesSubject);

                        //添加
                        if (Act == "Add")
                        {
                            ba.CAccountName       = bName;
                            ba.FeesSubjectClassID = FeesSubject;
                            ba.PAppendTime        = bAppendTime;
                            ba.CAccountMoney      = Convert.ToDecimal(beginMoney);
                            ba.CDirection         = Convert.ToInt32(cDirecion);

                            if (checkName)
                            {
                                AddErrLine("该资金账户[" + bName + "]已经存在!");
                            }

                            else
                            {
                                if (tbBankInfo.AddBank(ba) > 0)
                                {
                                    Logs.AddEventLog(this.userid, "新增资金帐户." + ba.FeesSubjectClassID);
                                    AddMsgLine("创建成功!");
                                    AddScript("window.setTimeout('window.parent.HidBox();',1000);");
                                }
                                else
                                {
                                    AddErrLine("创建失败!");
                                    AddScript("history.back(1);");
                                }
                            }
                        }

                        if (Act == "Edit")
                        {
                            ba.CAccountMoney = Convert.ToDecimal(beginMoney);

                            try
                            {
                                tbBankInfo.UpdateBank(ba);
                                Logs.AddEventLog(this.userid, "修改资金帐户." + ba.FeesSubjectClassID);
                                AddMsgLine("修改成功!");
                                AddScript("window.setTimeout('window.parent.HidBox();',1000);");
                            }
                            catch (Exception ex)
                            {
                                AddErrLine("修改失败!<br/>" + ex);
                            }
                        }
                    }
                    else
                    {
                        if (Act == "Del")
                        {
                            try
                            {
                                string sCheckbox = HTTPRequest.GetString("bid");

                                tbBankInfo.DeleteBank(sCheckbox);
                                Logs.AddEventLog(this.userid, "删除资金帐户." + HTTPRequest.GetString("bid"));
                                AddMsgLine("删除成功!");
                                AddScript("window.setTimeout('window.parent.HidBox();',1000);");
                            }
                            catch (Exception ex)
                            {
                                AddErrLine("删除失败!<br/>" + ex);
                                AddScript("window.setTimeout('window.parent.HidBox();',1000);");
                            }
                        }
                    }
                }
                else
                {
                    AddErrLine("权限不足!");
                    AddScript("window.setTimeout('window.parent.HidBox();',1000);");
                }
            }
            else
            {
                AddErrLine("请先登录!");
                SetBackLink("login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
                SetMetaRefresh(1, "login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
            }
        }
        //public DataTable BankList = new DataTable();//银行列表

        protected virtual void Page_Load(object sender, EventArgs e)
        {
            if (this.userid > 0)
            {
                /*
                 * CertificateDataJson cdj = new CertificateDataJson();
                 * CertificateDataInfo[] cdi = new CertificateDataInfo[1] ;
                 * cdi[0] = new CertificateDataInfo();
                 * cdi[0].cdAppendTime = DateTime.Now;
                 *
                 * cdj.CertificateDataInfoJson = cdi;
                 * CertificateDataJsonStr = JavaScriptConvert.SerializeObject(cdi);
                 */
                if (CheckUserPopedoms("X") || CheckUserPopedoms("6-5-1") || CheckUserPopedoms("6-5-2") || CheckUserPopedoms("6-5-3") || CheckUserPopedoms("6-5-4"))
                {
                    Act       = HTTPRequest.GetString("Act");
                    OrderType = HTTPRequest.GetInt("OrderType", 0);
                    OrderID   = HTTPRequest.GetInt("OrderID", 0);
                    string NewPIC = Utils.ChkSQL(HTTPRequest.GetString("NewPIC"));
                    cCode  = Utils.ChkSQL(HTTPRequest.GetString("cCode"));
                    format = HTTPRequest.GetString("format");

                    #region 鉴权
                    if (CheckUserPopedoms("X") || CheckUserPopedoms("6-5-1") || CheckUserPopedoms("6-5-2") || CheckUserPopedoms("6-5-3") || CheckUserPopedoms("6-5-4") || CheckUserPopedoms("6-5-5") || CheckUserPopedoms("6-5-6"))
                    {
                        if (Act == "Add")
                        {
                            if (CheckUserPopedoms("X") || CheckUserPopedoms("6-5-1"))
                            {
                            }
                            else
                            {
                                AddErrLine("权限不足,无法新建 凭证 列表!");
                            }
                        }
                        if (Act == "Edit" || Act == "View")
                        {
                            if (CheckUserPopedoms("X") || CheckUserPopedoms("6-5-2") || CheckUserPopedoms("6-5-3"))
                            {
                            }
                            else
                            {
                                AddErrLine("权限不足,无法新建 凭证 列表!");
                            }
                        }
                        //作废
                        if (Act == "i")
                        {
                            if (CheckUserPopedoms("X") || CheckUserPopedoms("6-5-4"))
                            {
                            }
                            else
                            {
                                AddErrLine("权限不足,无法新建 凭证 列表!");
                            }
                        }
                        //审核
                        if (Act == "s")
                        {
                            if (CheckUserPopedoms("X") || CheckUserPopedoms("6-5-5"))
                            {
                            }
                            else
                            {
                                AddErrLine("权限不足,无法新建 凭证 列表!");
                            }
                        }
                    }
                    #endregion

                    if (!IsErr())
                    {
                        if (Act == "Edit")
                        {
                            CertificateID = Utils.StrToInt(HTTPRequest.GetString("cid"), 0);

                            ci        = Certificates.GetCertificateInfoModel(CertificateID);
                            cCode     = ci.cCode;
                            cDateTime = ci.cDateTime;
                            cNumber   = ci.cNumber;

                            IsVerify = ci.cSteps == 1;

                            if (IsVerify)
                            {
                                TimeSpan ts1 = new TimeSpan(DateTime.Now.Ticks);
                                TimeSpan ts2 = new TimeSpan(Certificates.GetLastVerifyTime(CertificateID).Ticks);
                                TimeSpan ts  = ts1.Subtract(ts2).Duration();

                                IsVerifyLongTime  = ts.TotalHours > 48;
                                IsVerifyLongTimeB = ts.TotalHours > 6;
                            }

                            DataTable cdList = Certificates.GetCertificateDataInfoList(" cd.CertificateID = " + CertificateID + " order by cd.CertificateDataID asc").Tables[0];
                            if (cdList != null)
                            {
                                foreach (DataRow dr in cdList.Rows)
                                {
                                    CertificateDataJsonStr += "{\"CertificateDataID\":\"" + dr["CertificateDataID"].ToString() + "\",\"CertificateID\":\"" + dr["CertificateID"].ToString() + "\",\"FeesSubjectName\":\"" + dr["FeesSubjectName"].ToString() + "\",\"FeesSubjectID\":\"" + dr["FeesSubjectID"].ToString() + "\",\"cdName\":\"" + dr["cdName"].ToString() + "\",\"cdMoney\":\"" + dr["cdMoney"].ToString() + "\",\"cdMoneyB\":\"" + dr["cdMoneyB"].ToString() + "\",\"cdRemake\":\"" + dr["cdRemake"].ToString() + "\",\"cdAppendTime\":\"" + dr["cdAppendTime"].ToString() + "\",\"toObject\":\"" + dr["toObject"].ToString() + "\",\"toObjectID\":\"" + dr["toObjectID"].ToString() + "\",\"ObjectName\":\"" + dr["ObjectName"].ToString() + "\"},";
                                }
                            }
                            if (CertificateDataJsonStr.Trim() != "")
                            {
                                CertificateDataJsonStr = "{\"CertificateDataInfoJson\":[" + Utils.ReSQLSetTxt(CertificateDataJsonStr.Trim()) + "]}";
                            }

                            PicList = Certificates.GetCertificatePicInfoList(" CertificateID=" + CertificateID + " order by cAppendTime desc").Tables[0];
                        }
                        if (ispost)
                        {
                            //string cCode = Utils.ChkSQL(HTTPRequest.GetString("cCode"));
                            decimal cMoney     = (HTTPRequest.GetString("cMoney").Trim() != "") ? Convert.ToDecimal(HTTPRequest.GetString("cMoney")) : 0;
                            int     cType      = HTTPRequest.GetInt("cType", 0);
                            int     UserID     = this.userid;
                            int     StaffID    = HTTPRequest.GetInt("StaffID", 0);
                            string  cRemake    = HTTPRequest.GetString("cRemake");
                            int     toObject   = HTTPRequest.GetInt("toObject", 0);
                            int     toObjectID = HTTPRequest.GetInt("toObjectID", 0);
                            int     cObject    = HTTPRequest.GetInt("cObject", 0);
                            int     cObjectID  = HTTPRequest.GetInt("cObjectID", 0);
                            int     cState     = HTTPRequest.GetInt("cState", 0);
                            int     BankID     = HTTPRequest.GetInt("BankID", 0);
                            cNumber = HTTPRequest.GetInt("cNumber", 0);

                            cDateTime = (HTTPRequest.GetString("cDateTime").Trim() != "") ? Convert.ToDateTime(HTTPRequest.GetString("cDateTime")) : DateTime.Now;

                            string CertificateDataStr = Utils.ChkSQL(HTTPRequest.GetString("CertificateDataStr"));


                            ci.cMoney     = cMoney;
                            ci.cType      = cType;
                            ci.StaffID    = StaffID;
                            ci.cRemake    = cRemake;
                            ci.toObject   = toObject;
                            ci.toObjectID = toObjectID;
                            ci.cObject    = cObject;
                            ci.cObjectID  = cObjectID;
                            ci.cState     = cState;
                            ci.cDateTime  = cDateTime;
                            ci.BankID     = BankID;


                            ci.CertificateDataJson = (CertificateDataJson)JavaScriptConvert.DeserializeObject(CertificateDataStr, typeof(CertificateDataJson));

                            if (Act == "Add")
                            {
                                if (CheckUserPopedoms("X") || CheckUserPopedoms("6-5-1"))
                                {
                                    ci.cSteps      = 0;
                                    ci.UserID      = UserID;
                                    ci.cAppendTime = DateTime.Now;
                                    ci.cCode       = Certificates.GetNewNum(); //cCode;//

                                    ci.cNumber = cNumber;
                                    if (!Certificates.CheckCertificateNumber(ci.cDateTime, ci.cNumber))
                                    {
                                        if (!Certificates.ExistsCertificateInfo(ci.cCode))
                                        {
                                            CertificateID = Certificates.AddCertificateInfo(ci);

                                            //添加凭证照片
                                            AddPic(NewPIC, CertificateID);

                                            CertificateWorkingLogInfo co = new CertificateWorkingLogInfo();
                                            co.CertificateID = CertificateID;
                                            co.UserID        = this.userid;
                                            co.cType         = 0;
                                            co.cAppendTime   = DateTime.Now;
                                            Certificates.AddCertificateWorkingLog(co);

                                            AddMsgLine("凭证录入成功!");
                                            AddScript("window.setTimeout('window.parent.HidBox();',1000);");
                                        }
                                        else
                                        {
                                            AddErrLine("凭证编号重复,系统已存在该编号(" + ci.cCode + ")!");
                                        }
                                    }
                                    else
                                    {
                                        AddErrLine("凭证序号重复,系统已存在该序号(" + ci.cDateTime.ToString("yyyyMMdd") + "-" + (ci.cNumber.ToString()).PadLeft(config.CertificateCodeLen, '0') + ")!");
                                    }
                                }
                                else
                                {
                                    AddErrLine("权限不足!");
                                    AddScript("window.setTimeout('window.parent.HidBox();',1000);");
                                }
                            }
                            if (Act == "Edit")
                            {
                                if (CheckUserPopedoms("X") || CheckUserPopedoms("6-5-3"))
                                {
                                    if (ci.cNumber != cNumber)
                                    {
                                        if (!Certificates.CheckCertificateNumber(ci.cDateTime, cNumber))
                                        {
                                            ci.cNumber = cNumber;
                                        }
                                        else
                                        {
                                            AddErrLine("凭证序号重复,系统已存在该序号(" + ci.cDateTime.ToString("yyyyMMdd") + "-" + (cNumber.ToString()).PadLeft(config.CertificateCodeLen, '0') + ")!");
                                        }
                                    }

                                    if (!IsErr())
                                    {
                                        Certificates.UpdateCertificateInfo(ci);
                                        //添加凭证照片
                                        AddPic(NewPIC, CertificateID);

                                        CertificateWorkingLogInfo co = new CertificateWorkingLogInfo();
                                        co.CertificateID = CertificateID;
                                        co.UserID        = this.userid;
                                        co.cType         = 1;
                                        co.cAppendTime   = DateTime.Now;
                                        Certificates.AddCertificateWorkingLog(co);

                                        AddMsgLine("凭证 " + ci.cDateTime.ToString("yyyyMMdd") + "-" + (ci.cNumber.ToString()).PadLeft(config.CertificateCodeLen, '0') + " 修改成功!");
                                        AddScript("window.setTimeout('location=\"/certificate_do-Edit-" + OrderType + "-" + OrderID + "-" + CertificateID + ".aspx\";',1000);");
                                    }
                                }
                                else
                                {
                                    AddErrLine("权限不足!");
                                    AddScript("window.setTimeout('window.parent.HidBox();',1000);");
                                }
                            }
                        }
                        else
                        {
                            if (format != "json")
                            {
                                //BankList = tbBankInfo.GetBankList("").Tables[0];
                                StaffList = Caches.GetDepartmentsClassInfoAndStaffListToHTML();
                                //FeesSubjectClassList = Caches.GetFeesSubjectClassInfoToHTML();
                                //string CustomersList = Caches.GetCustomersClassInfoAndDataToHTML();//客户
                                //string SupplierList = Caches.GetSupplierClassInfoAndDataToHTML();//供应商
                                //ToObjectList = "<ul><li rel=\"cus\">客户" + CustomersList + "</li>"+
                                //                        "<li rel=\"sup\">供应商" + SupplierList + "</li>" +
                                //                        "<li rel=\"sta\">人员" + StaffList + "</li>" +
                                //                        "</ul>";

                                DepartmentsJson = Caches.GetDepartmentsClassInfoToJson(-1, true, true);
                                SupplierJson    = Caches.GetSupplierClassInfoToJson(-1, true, true);
                                CustomersJson   = Caches.GetCustomersClassInfoToJson(-1, true, true);
                                FeesSubjectJson = Caches.GetFeesSubjectClassInfoToJson(-1, false, true);

                                PaymentSystemJson = Caches.GetPaymentSystemJson();
                            }
                            if (Act == "Add")
                            {
                                cCode   = "";// Certificates.GetNewNum();
                                cNumber = Certificates.GetCertificateNewNumber(cDateTime);
                            }
                            if (Act == "GetNum")
                            {
                                CertificateID = Utils.StrToInt(HTTPRequest.GetString("cid"), 0);
                                cDateTime     = (HTTPRequest.GetString("cDateTime").Trim() != "") ? Convert.ToDateTime(HTTPRequest.GetString("cDateTime")) : DateTime.Now;
                                cNumber       = Certificates.GetCertificateNewNumber(cDateTime);
                                tJson         = ",\"MaxOrderDate\":\"" + Certificates.GetMaxCertificateData(CertificateID) + "\",\"Num\":" + cNumber;
                            }
                            //作废
                            if (Act == "i")
                            {
                                if (CheckUserPopedoms("X") || CheckUserPopedoms("6-5-4"))
                                {
                                    CertificateID = Utils.StrToInt(HTTPRequest.GetString("cid"), 0);

                                    if (CertificateID > 0)
                                    {
                                        ci = Certificates.GetCertificateInfoModel(CertificateID);
                                        if (ci != null)
                                        {
                                            ci.cState = 1;
                                            Certificates.UpdateCertificateInfo(ci);

                                            CertificateWorkingLogInfo co = new CertificateWorkingLogInfo();
                                            co.CertificateID = CertificateID;
                                            co.UserID        = this.userid;
                                            co.cType         = -1;
                                            co.cAppendTime   = DateTime.Now;
                                            Certificates.AddCertificateWorkingLog(co);

                                            AddMsgLine("凭证 " + ci.cDateTime.ToString("yyyyMMdd") + "-" + (ci.cNumber.ToString()).PadLeft(config.CertificateCodeLen, '0') + " 作废成功!");
                                        }
                                        else
                                        {
                                            AddErrLine("凭证不存在!");
                                        }
                                    }
                                    else
                                    {
                                        AddErrLine("参数错误!");
                                    }
                                }
                                else
                                {
                                    AddErrLine("权限不足!");
                                    AddScript("window.setTimeout('window.parent.HidBox();',1000);");
                                }
                            }
                            //审核
                            if (Act == "s")
                            {
                                if (CheckUserPopedoms("X") || CheckUserPopedoms("6-5-5"))
                                {
                                    CertificateID = Utils.StrToInt(HTTPRequest.GetString("cid"), 0);
                                    if (CertificateID > 0)
                                    {
                                        ci = Certificates.GetCertificateInfoModel(CertificateID);
                                        if (ci != null)
                                        {
                                            Certificates.SetCertificateSteps(CertificateID, 1);

                                            CertificateWorkingLogInfo co = new CertificateWorkingLogInfo();
                                            co.CertificateID = CertificateID;
                                            co.UserID        = this.userid;
                                            co.cType         = 2;
                                            co.cAppendTime   = DateTime.Now;
                                            Certificates.AddCertificateWorkingLog(co);

                                            AddMsgLine("凭证 " + ci.cDateTime.ToString("yyyyMMdd") + "-" + (ci.cNumber.ToString()).PadLeft(config.CertificateCodeLen, '0') + " 审核成功!");
                                        }
                                        else
                                        {
                                            AddErrLine("凭证不存在!");
                                        }
                                    }
                                    else
                                    {
                                        AddErrLine("参数错误!");
                                    }
                                }
                                else
                                {
                                    AddErrLine("权限不足!");
                                }
                            }
                            //撤回重审
                            if (Act == "rs")
                            {
                                if (CheckUserPopedoms("X") || CheckUserPopedoms("6-5-7") || CheckUserPopedoms("6-5-8"))
                                {
                                    CertificateID = Utils.StrToInt(HTTPRequest.GetString("cid"), 0);
                                    if (CertificateID > 0)
                                    {
                                        ci = Certificates.GetCertificateInfoModel(CertificateID);
                                        if (ci != null)
                                        {
                                            Certificates.SetCertificateSteps(CertificateID, 0);

                                            CertificateWorkingLogInfo co = new CertificateWorkingLogInfo();
                                            co.CertificateID = CertificateID;
                                            co.UserID        = this.userid;
                                            co.cType         = 4;
                                            co.cAppendTime   = DateTime.Now;
                                            Certificates.AddCertificateWorkingLog(co);

                                            AddMsgLine("凭证 " + ci.cDateTime.ToString("yyyyMMdd") + "-" + (ci.cNumber.ToString()).PadLeft(config.CertificateCodeLen, '0') + " 撤回成功!");
                                        }
                                        else
                                        {
                                            AddErrLine("凭证不存在!");
                                        }
                                    }
                                    else
                                    {
                                        AddErrLine("参数错误!");
                                    }
                                }
                                else
                                {
                                    AddErrLine("权限不足!");
                                }
                            }
                            //获取指定凭证前后两个凭证信息
                            if (Act == "p")
                            {
                                if (CheckUserPopedoms("X") || CheckUserPopedoms("6-5-2"))
                                {
                                    CertificateID = Utils.StrToInt(HTTPRequest.GetString("cid"), 0);
                                    if (CertificateID > 0)
                                    {
                                        long[] UpDownID = Certificates.GetCertificateUpDownID(CertificateID);
                                        tJson = ",\"UpDownID\":{\"UpID\":\"" + UpDownID[0] + "\",\"DownID\":\"" + UpDownID[1] + "\"}";
                                    }
                                    else
                                    {
                                        AddErrLine("参数错误!");
                                    }
                                }
                                else
                                {
                                    AddErrLine("权限不足!");
                                }
                            }
                        }
                    }
                }
                else
                {
                    AddErrLine("权限不足!");
                }
            }
            else
            {
                AddErrLine("请先登录!");
                SetBackLink("login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
                SetMetaRefresh(1, "login.aspx?referer=" + Utils.UrlEncode(Utils.GetUrlReferrer()));
            }
            if (format == "json")
            {
                Response.ClearContent();
                Response.Buffer          = true;
                Response.ExpiresAbsolute = System.DateTime.Now.AddYears(-1);
                Response.Expires         = 0;

                Response.Charset         = "utf-8";
                Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8");
                Response.ContentType     = "application/json";
                string Json_Str = "{\"results\": {\"msg\":\"" + this.msgbox_text + "\",\"state\":\"" + (!IsErr()).ToString() + "\"" + tJson + "}}";
                Response.Write(Json_Str);
                Response.End();
            }
        }