Example #1
0
        //需要调用窗体名称
        System.Windows.Forms.Control INetUserControl.CreateControl(UFSoft.U8.Framework.Login.UI.clsLogin login, string MenuID, string Paramters)
        {
            UFSoft.U8.Framework.LoginContext.UserData LoginInfo = new UFSoft.U8.Framework.LoginContext.UserData();
            LoginInfo = login.GetLoginInfo();
            string conn = LoginInfo.ConnString;

            conn = Utils.ConvertConn(conn);
            DbHelperSQL.connectionString = conn;

            string sLogUserid   = LoginInfo.UserId;
            string sLogUserName = LoginInfo.UserName;
            string sLogDate     = LoginInfo.operDate;
            string sAccID       = LoginInfo.AccID;

            //ClsUserRight clsUser = new ClsUserRight();
            //if (clsUser.chkRight(login, "TH_ETS_02"))
            //{
            GL_accvouch fm = new GL_accvouch();

            fm.Conn      = conn;
            fm.sUserID   = sLogUserid;
            fm.sUserName = sLogUserName;
            fm.sLogDate  = sLogDate;
            fm.sAccID    = sAccID;

            this._Title = "凭证导入";

            return(fm);
            //}
            //else
            //    return null;
        }
Example #2
0
        //[SwaggerResponse(HttpStatusCode.OK, Type = typeof(LeaveVoucher))]
        public HttpResponseMessage AddPZForJson(string token, string jsonStr)
        {
            ReturnMessage msg = new ReturnMessage();

            vouMag = (VoucherManager)HttpContext.Current.Application.Get(token);
            if (vouMag == null)
            {
                msg.Success = false;
                msg.Msg     = "参数token无效或已过期";
                msg.Code    = 500;
            }
            else
            {
                GLAccVouchManager glMag = new GLAccVouchManager(vouMag.UFDataConnstringForNet);
                GL_accvouch       glAcc = (GL_accvouch)JsonConvert.DeserializeObject(jsonStr, typeof(GL_accvouch));
                string            xml   = glMag.getVoucherXml(vouMag.AccId, glAcc);
                msg = glMag.AddForGL(vouMag, xml);
            }

            HttpContext.Current.Application.Remove(vouMag.GetGUID);
            string str = msg.ToJson();

            return(new HttpResponseMessage {
                Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json")
            });
        }
Example #3
0
        //需要调用窗体名称
        System.Windows.Forms.Control INetUserControl.CreateControl(UFSoft.U8.Framework.Login.UI.clsLogin login, string MenuID, string Paramters)
        {
            UFSoft.U8.Framework.LoginContext.UserData LoginInfo = new UFSoft.U8.Framework.LoginContext.UserData();
            LoginInfo = login.GetLoginInfo();
            string conn = LoginInfo.ConnString;

            conn = Utils.ConvertConn(conn);
            string sLogUserid   = LoginInfo.UserId;
            string sLogUserName = LoginInfo.UserName;
            string sLogDate     = LoginInfo.operDate;

            GL_accvouch fm = new GL_accvouch();

            fm.Conn      = conn;
            fm.sUserID   = sLogUserid;
            fm.sUserName = sLogUserName;
            fm.sLogDate  = sLogDate;



            this._Title = "凭证导入";

            return(fm);
        }
Example #4
0
        public string getVoucherXml(string sender, GL_accvouch voucher)
        {
            StringBuilder xml = new StringBuilder();

            xml.Append("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
            xml.Append("<ufinterface roottag=\"voucher\" receiver=\"u8\" sender=\"" + sender + "\" proc=\"add\" renewproofno=\"y\" codeexchanged=\"y\" exportneedexch=\"N\" >");
            xml.Append("<voucher id=\"" + setNull(voucher.head.voucher_id) + "\">");
            xml.Append("<voucher_head>");
            xml.Append("<company>" + setNull(voucher.head.company) + "</company>");
            xml.Append("<voucher_type>" + setNull(voucher.head.voucher_type) + "</voucher_type>");
            xml.Append("<fiscal_year>" + setNull(voucher.head.fiscal_year) + "</fiscal_year>");
            xml.Append("<accounting_period>" + setNull(voucher.head.accounting_period) + "</accounting_period>");
            xml.Append("<voucher_id>" + setNull(voucher.head.voucher_id) + "</voucher_id>");
            xml.Append("<attachment_number>" + setNull(voucher.head.attachment_number) + "</attachment_number>");
            xml.Append("<date>" + setNull(voucher.head.date) + "</date>");
            xml.Append("<enter>" + setNull(voucher.head.enter) + "</enter>");
            xml.Append("<cashier>" + setNull(voucher.head.cashier) + "</cashier>");
            xml.Append("<signature>" + setNull(voucher.head.signature) + "</signature>");
            xml.Append("<checker>" + setNull(voucher.head.checker) + "</checker>");
            xml.Append("<posting_date>" + setNull(voucher.head.posting_date) + "</posting_date>");
            xml.Append("<posting_person>" + setNull(voucher.head.posting_person) + "</posting_person>");
            xml.Append("<voucher_making_system>" + setNull(voucher.head.voucher_making_system) + "</voucher_making_system>");
            xml.Append("<memo1>" + setNull(voucher.head.memo1) + "</memo1>");
            xml.Append("<memo2>" + setNull(voucher.head.memo2) + "</memo2>");
            xml.Append("<reserve1>" + setNull(voucher.head.reserve1) + "</reserve1>");
            xml.Append("<reserve2>" + setNull(voucher.head.reserve2) + "</reserve2>");
            xml.Append("<revokeflag>" + setNull(voucher.head.revokeflag) + "</revokeflag>");
            xml.Append("</voucher_head>");
            xml.Append("<voucher_body>");
            for (int i = 0; i < voucher.body.Count; i++)
            {
                xml.Append("<entry>");
                xml.Append("<entry_id>" + setNull(voucher.body[i].entry_id) + "</entry_id>");
                xml.Append("<account_code>" + setNull(voucher.body[i].account_code) + "</account_code>");
                xml.Append("<abstract>" + setNull(voucher.body[i].Abstract) + "</abstract>");
                xml.Append("<settlement>" + setNull(voucher.body[i].settlement) + "</settlement>");
                xml.Append("<document_id>" + setNull(voucher.body[i].document_id) + "</document_id>");
                xml.Append("<document_date>" + setNull(voucher.body[i].document_date) + "</document_date>");
                xml.Append("<currency>" + setNull(voucher.body[i].currency) + "</currency>");
                xml.Append("<unit_price>" + setNull(voucher.body[i].unit_price) + "</unit_price>");
                xml.Append("<exchange_rate1>" + setNull(voucher.body[i].exchange_rate1) + "</exchange_rate1>");
                xml.Append("<exchange_rate2>" + setNull(voucher.body[i].exchange_rate2) + "</exchange_rate2>");
                xml.Append("<debit_quantity>" + setNull(voucher.body[i].debit_quantity) + "</debit_quantity>");
                xml.Append("<primary_debit_amount>" + setNull(voucher.body[i].primary_debit_amount) + "</primary_debit_amount>");
                xml.Append("<secondary_debit_amount>" + setNull(voucher.body[i].secondary_debit_amount) + "</secondary_debit_amount>");
                xml.Append("<natural_debit_currency>" + setNull(voucher.body[i].natural_debit_currency) + "</natural_debit_currency>");
                xml.Append("<credit_quantity>" + setNull(voucher.body[i].credit_quantity) + "</credit_quantity>");
                xml.Append("<primary_credit_amount>" + setNull(voucher.body[i].primary_credit_amount) + "</primary_credit_amount>");
                xml.Append("<secondary_credit_amount>" + setNull(voucher.body[i].secondary_credit_amount) + "</secondary_credit_amount>");
                xml.Append("<natural_credit_currency>" + setNull(voucher.body[i].natural_credit_currency) + "</natural_credit_currency>");
                xml.Append("<bill_type>" + setNull(voucher.body[i].bill_type) + "</bill_type>");
                xml.Append("<bill_id>" + setNull(voucher.body[i].bill_id) + "</bill_id>");
                xml.Append("<bill_date>" + setNull(voucher.body[i].bill_date) + "</bill_date>");
                xml.Append("<auxiliary_accounting>");
                xml.Append("<item name=\"dept_id\">" + setNull(voucher.body[i].accounting.dept_id) + "</item>");
                xml.Append("<item name=\"personnel_id\">" + setNull(voucher.body[i].accounting.personnel_id) + "</item>");
                xml.Append("<item name=\"cust_id\">" + setNull(voucher.body[i].accounting.cust_id) + "</item>");
                xml.Append("<item name=\"supplier_id\">" + setNull(voucher.body[i].accounting.supplier_id) + "</item>");
                xml.Append("<item name=\"item_id\">" + setNull(voucher.body[i].accounting.item_id) + "</item>");
                xml.Append("<item name=\"item_class\">" + setNull(voucher.body[i].accounting.item_class) + "</item>");
                xml.Append("<item name=\"operator\">" + setNull(voucher.body[i].accounting.Operator) + "</item>");
                xml.Append("<item name=\"self_define1\">" + setNull(voucher.body[i].accounting.self_define1) + "</item>");
                xml.Append("<item name=\"self_define2\">" + setNull(voucher.body[i].accounting.self_define2) + "</item>");
                xml.Append("<item name=\"self_define3\">" + setNull(voucher.body[i].accounting.self_define3) + "</item>");
                xml.Append("<item name=\"self_define4\">" + setNull(voucher.body[i].accounting.self_define4) + "</item>");
                xml.Append("<item name=\"self_define5\">" + setNull(voucher.body[i].accounting.self_define5) + "</item>");
                xml.Append("<item name=\"self_define6\">" + setNull(voucher.body[i].accounting.self_define6) + "</item>");
                xml.Append("<item name=\"self_define7\">" + setNull(voucher.body[i].accounting.self_define7) + "</item>");
                xml.Append("<item name=\"self_define8\">" + setNull(voucher.body[i].accounting.self_define8) + "</item>");
                xml.Append("<item name=\"self_define9\">" + setNull(voucher.body[i].accounting.self_define9) + "</item>");
                xml.Append("<item name=\"self_define10\">" + setNull(voucher.body[i].accounting.self_define10) + "</item>");
                xml.Append("<item name=\"self_define11\">" + setNull(voucher.body[i].accounting.self_define11) + "</item>");
                xml.Append("<item name=\"self_define12\">" + setNull(voucher.body[i].accounting.self_define12) + "</item>");
                xml.Append("<item name=\"self_define13\">" + setNull(voucher.body[i].accounting.self_define13) + "</item>");
                xml.Append("<item name=\"self_define14\">" + setNull(voucher.body[i].accounting.self_define14) + "</item>");
                xml.Append("<item name=\"self_define15\">" + setNull(voucher.body[i].accounting.self_define15) + "</item>");
                xml.Append("<item name=\"self_define16\">" + setNull(voucher.body[i].accounting.self_define16) + "</item>");
                xml.Append("</auxiliary_accounting>");
                xml.Append("<detail>");
                xml.Append("<cash_flow_statement>");
                if (voucher.body[i].detail != null)
                {
                    for (int q = 0; q < voucher.body[i].detail.Count; q++)
                    {
                        if (!string.IsNullOrEmpty(voucher.body[i].detail[q].cash_item))
                        {
                            try
                            {
                                //xml.Append("<cash_flow cash_item=\"" + setNull(voucher.body[i].detail[q].cash_item) + "\" natural_debit_currency=\"" + setNull(voucher.body[i].detail[q].natural_debit_currency) + "\" natural_credit_currency=\"" + setNull(voucher.body[i].detail[q].natural_credit_currency) + "\" />");
                                xml.Append("<cash_flow cash_item=\"" + setNull(voucher.body[i].detail[q].cash_item) +
                                           "\" natural_debit_currency=\"" + setNull(voucher.body[i].detail[q].natural_debit_currency) +
                                           "\" natural_credit_currency=\"" + setNull(voucher.body[i].detail[q].natural_credit_currency) +
                                           "\" dbill_date=\"" + setNull(voucher.body[i].detail[q].dbill_date) +
                                           "\" cCashItem=\"" + setNull(voucher.body[i].detail[q].cash_item) +
                                           "\" md=\"" + setNull(voucher.body[i].detail[q].natural_debit_currency) +
                                           "\" mc=\"" + setNull(voucher.body[i].detail[q].natural_credit_currency) +
                                           "\" ccode=\"" + setNull(voucher.body[i].account_code) +
                                           "\" md_f=\"" + setNull(voucher.body[i].secondary_debit_amount) +
                                           "\" mc_f=\"" + setNull(voucher.body[i].secondary_credit_amount) +
                                           "\" nd_s=\"" + setNull(voucher.body[i].debit_quantity) +
                                           "\" nc_s=\"" + setNull(voucher.body[i].credit_quantity) +
                                           "\" cdept_id=\"" + setNull(voucher.body[i].accounting.dept_id) +
                                           "\" cperson_id=\"" + setNull(voucher.body[i].accounting.personnel_id) +
                                           "\" ccus_id=\"" + setNull(voucher.body[i].accounting.cust_id) +
                                           "\" csup_id=\"" + setNull(voucher.body[i].accounting.supplier_id) +
                                           "\" citem_class=\"" + setNull(voucher.body[i].accounting.item_class) +
                                           "\" citem_id=\"" + setNull(voucher.body[i].accounting.item_id) +
                                           "\" cDefine1=\"" + setNull(voucher.body[i].accounting.self_define1) +
                                           "\" cDefine2=\"" + setNull(voucher.body[i].accounting.self_define2) +
                                           "\" cDefine3=\"" + setNull(voucher.body[i].accounting.self_define3) +
                                           "\" cDefine4=\"" + setNull(voucher.body[i].accounting.self_define4) +
                                           "\" cDefine5=\"" + setNull(voucher.body[i].accounting.self_define5) +
                                           "\" cDefine6=\"" + setNull(voucher.body[i].accounting.self_define6) +
                                           "\" cDefine7=\"" + setNull(voucher.body[i].accounting.self_define7) +
                                           "\" cDefine8=\"" + setNull(voucher.body[i].accounting.self_define8) +
                                           "\" cDefine9=\"" + setNull(voucher.body[i].accounting.self_define9) +
                                           "\" cDefine10=\"" + setNull(voucher.body[i].accounting.self_define10) +
                                           "\" cDefine11=\"" + setNull(voucher.body[i].accounting.self_define11) +
                                           "\" cDefine12=\"" + setNull(voucher.body[i].accounting.self_define12) +
                                           "\" cDefine13=\"" + setNull(voucher.body[i].accounting.self_define13) +
                                           "\" cDefine14=\"" + setNull(voucher.body[i].accounting.self_define14) +
                                           "\" cDefine15=\"" + setNull(voucher.body[i].accounting.self_define15) +
                                           "\" cDefine16=\"" + setNull(voucher.body[i].accounting.self_define16) +
                                           "\" csign=\"" + setNull(voucher.head.voucher_type) +
                                           "\" iyear=\"" + setNull(voucher.head.fiscal_year) +
                                           "\" iYPeriod=\"" + setNull(voucher.head.fiscal_year + voucher.head.accounting_period.ToString().PadLeft(2, '0')) +
                                           "\" cexch_name=\"" + setNull(voucher.body[i].currency) +
                                           "\" />");
                            }
                            catch (Exception e)
                            {
                                string msg = e.Message.ToString();
                                throw;
                            }
                        }
                        else
                        {
                            xml.Append("<cash_flow cash_item=\"" +
                                       "\" natural_debit_currency=\"" +
                                       "\" natural_credit_currency=\"" +
                                       "\" dbill_date=\"" +
                                       "\" />");
                        }
                    }
                }
                xml.Append("</cash_flow_statement>");
                xml.Append("<code_remark_statement></code_remark_statement>");
                xml.Append("</detail>");
                xml.Append("</entry>");
            }
            xml.Append("</voucher_body>");
            xml.Append("</voucher>");
            xml.Append("</ufinterface>");
            return(xml.ToString());
        }