Пример #1
0
        private void SaveInfo()
        {
            int    iResult = 0;
            string sRetMsg = "";

            string spName = "p_Role_Save";

            string[] sParameters = new string[6] {
                "result", "@OperType", "@RoleName", "@RoleId", "@RoleAction", "@Msg"
            };

            string[] sParametersValue = new string[6] {
                "0", iOperType.ToString(), sRoleName, iRoleId.ToString(), sRoleAction, sRetMsg
            };
            string[] sParametersType = new string[6] {
                "Int", "Int", "VarChar", "Int", "VarChar", "VarChar"
            };
            string[] sParametersDirection = new string[6] {
                "ReturnValue", "Input", "Input", "Input", "Input", "Output"
            };
            int[] sParametersSize = new int[6] {
                10, 20, 10, 10, 500, 50
            };

            iResult = int.Parse(PublicUtility.OperData(spName, sParameters, sParametersValue, sParametersType, sParametersDirection, sParametersSize, out sRetMsg, out sRetMsg));

            if (iResult == -1)
            {
                MessageBox.Show(sRetMsg); return;
            }
        }
Пример #2
0
        public int InvoiceCanceled(string sInvseqId)
        {
            int    iResult = 0;
            string sOut    = "";
            string spName  = "P_Invoice_Cancel";

            string[] sParameters = new string[4] {
                "result", "@InvseqId", "@UserId", "@Msg"
            };

            string[] sParametersValue = new string[4] {
                "0", sCurrentInvSeqId.ToString(), frmMain.sUserid, sRetMsg
            };
            string[] sParametersType = new string[4] {
                "Int", "VarChar", "VarChar", "VarChar"
            };
            string[] sParametersDirection = new string[4] {
                "ReturnValue", "Input", "Input", "Output"
            };
            int[] sParametersSize = new int[4] {
                10, 20, 20, 512
            };

            iResult = int.Parse(PublicUtility.OperData(spName, sParameters, sParametersValue, sParametersType, sParametersDirection, sParametersSize, out sOut, out sRetMsg));
            return(iResult);
        }
Пример #3
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            int iInvType = 0;

            if (cbbInvType.SelectedValue.ToString() == "1")
            {
                iInvType = 0;
            }
            else
            {
                iInvType = 2;
            }

            if (PublicUtility.ValidCustInfo(iInvType, gridView1) == 0)
            {
                iCurrentItemId = -1;
                if (Invoice(0) == 1)
                {
                    MessageBox.Show(sRetMsg); return;
                }

                /*for (int i = 0; i < gridView1.RowCount - 1; i++)
                 * {
                 *  Thread.Sleep(int.Parse(upTimerLong.Value.ToString()));
                 *  //if (gridView1.SelectedRowsCount > 0)
                 *  //{
                 *  //    iCurrentItemId = gridView1.FocusedRowHandle;
                 *  //后台生成发票明细
                 *  if (Invoice(i) == 1) { MessageBox.Show(sRetMsg); return; }
                 *  // }
                 * }*/
                GetData();
            }
        }
    // 从XML中载入单位模板信息
    public void LoadUnitInfoFromXML()
    {
        string filePath = Application.dataPath + "/Resources/Unit.xml";

        if (File.Exists(filePath))
        {
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(filePath);
            XmlNodeList node = xmlDoc.SelectSingleNode("Unit").ChildNodes;
            foreach (XmlElement UnitInfo in node)
            {
                //1. 在内存中创建一个新的Unit实例
                Unit NewUnit = new Unit();

                //2. 将XML中的信息拷贝到该Unit实例中
                foreach (XmlElement UnitInfoItem in UnitInfo.ChildNodes)
                {
                    if (UnitInfoItem.Name == "UnitID")
                    {
                        // 读取并设置新单位的单位名称
                        NewUnit.SetUnitID(UnitInfoItem.InnerText);
                    }
                    else if (UnitInfoItem.Name == "UnitName")
                    {
                        // 读取并设置新单位的单位名称
                        NewUnit.SetUnitName(UnitInfoItem.InnerText);
                    }
                    else if (UnitInfoItem.Name == "UnitMaxHealth")
                    {
                        // 读取并设置新单位的单位最大生命值和当前生命值
                        NewUnit.SetMaxHealth(PublicUtility.StringToInt(UnitInfoItem.InnerText));
                        NewUnit.SetCurrentHealth(PublicUtility.StringToInt(UnitInfoItem.InnerText));
                    }
                    else if (UnitInfoItem.Name == "UnitSize")
                    {
                        // 读取并设置新单位的单位尺寸
                        //Debug.Log(UnitInfoItem.InnerText);
                        NewUnit.SetUnitSize(PublicUtility.StringToFloat(UnitInfoItem.InnerText));
                    }
                    else if (UnitInfoItem.Name == "UnitWeaponList")
                    {
                        // 读取并设置新单位的单位武器列表
                        foreach (XmlElement WeaponListItem in UnitInfoItem.ChildNodes)
                        {
                            foreach (XmlElement WeaponInfoItem in WeaponListItem.ChildNodes)
                            {
                                if (WeaponInfoItem.Name == "WeaponID")
                                {
                                    //Debug.Log(WeaponInfoItem.InnerText);
                                    NewUnit.AddWeapon(GetWeapon(WeaponInfoItem.InnerText));
                                }
                            }
                        }
                    }
                }
                //3. 将该Unit实例的引用添加到Library引用数组当中
                AddUnit(NewUnit);
            }
        }
    }
Пример #5
0
        public int InvoiceBill(string sBseqId, int iTaxRate, string sUserId)
        {
            int iResult = 0;

            sRetMsg          = "";
            sCurrentInvSeqId = "";

            string spName = "p_fin_invoice_bill";

            string[] sParameters = new string[6] {
                "result", "@BseqId", "@TaxRate", "@UserId", "@InvSeqId", "@Msg"
            };

            string[] sParametersValue = new string[6] {
                "", sBseqId, iTaxRate.ToString(), frmMain.sUserid, "", ""
            };
            string[] sParametersType = new string[6] {
                "VarChar", "VarChar", "Int", "VarChar", "Int", "VarChar"
            };
            string[] sParametersDirection = new string[6] {
                "ReturnValue", "Input", "Input", "Input", "Output", "Output"
            };
            int[] sParametersSize = new int[6] {
                20, 20, 20, 20, 20, 512
            };

            //iResult = int.Parse(PublicUtility.OperData(spName, sParameters, sParametersValue, sParametersType, sParametersDirection, sParametersSize));
            iResult = int.Parse(PublicUtility.OperData(spName, sParameters, sParametersValue, sParametersType, sParametersDirection, sParametersSize, out sCurrentInvSeqId, out sRetMsg));
            return(iResult);
        }
Пример #6
0
        public int InvoiceValidated(string sBseqId, string sInvoiceCode, string sInvoiceNo)
        {
            if (sInvoiceCode is null)
            {
                sInvoiceCode = "";
            }
            int    iResult = 0;
            string sOut    = "";

            string spName = "p_fin_invoice_Validated";

            string[] sParameters = new string[6] {
                "result", "@InvseqId", "@InvoiceCode", "@InvoiceNumber", "@UserId", "@Msg"
            };

            string[] sParametersValue = new string[6] {
                "0", sCurrentInvSeqId.ToString(), sInvoiceCode, sInvoiceNo, frmMain.sUserid, sRetMsg
            };
            string[] sParametersType = new string[6] {
                "Int", "VarChar", "VarChar", "VarChar", "VarChar", "VarChar"
            };
            string[] sParametersDirection = new string[6] {
                "ReturnValue", "Input", "Input", "Input", "Input", "Output"
            };
            int[] sParametersSize = new int[6] {
                10, 20, 20, 20, 20, 512
            };

            iResult = int.Parse(PublicUtility.OperData(spName, sParameters, sParametersValue, sParametersType, sParametersDirection, sParametersSize, out sOut, out sRetMsg));

            return(iResult);
        }
Пример #7
0
    public void LoadChessBoardFromXML()
    {
        string filePath = Application.dataPath + "/Resources/XML/ChessBoardConfig/" + GameMapID + ".xml";

        if (File.Exists(filePath))
        {
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(filePath);
            XmlNodeList node = xmlDoc.SelectSingleNode("ChessBoardConfig").ChildNodes;
            foreach (XmlElement ChessBoardInfo in node)
            {
                foreach (XmlElement ChessBoardInfoItem in ChessBoardInfo.ChildNodes)
                {
                    if (ChessBoardInfoItem.Name == "Coordinate")
                    {
                        MainWorldManager.CreateChessboard(PublicUtility.StringToVector2Int(ChessBoardInfoItem.InnerText));
                    }
                    else if (ChessBoardInfoItem.Name == "DisableCheckerBoard")
                    {
                        foreach (XmlElement DisableCheckerBoardInfoItem in ChessBoardInfoItem.ChildNodes)
                        {
                            Debug.Log(DisableCheckerBoardInfoItem.InnerText);
                        }
                    }
                }
            }
        }
    }
Пример #8
0
        private void SaveInfo()
        {
            int    iResult = 0;
            string sRetMsg = "";

            string spName = "p_User_Save";

            string[] sParameters = new string[9] {
                "result", "@OperType", "@UserCode", "@UserName", "@Password", "@UserId", "@PermsDept", "@PermsRole", "@Msg"
            };

            string[] sParametersValue = new string[9] {
                "0", iOperType.ToString(), oUserInfo.UserCode, oUserInfo.UserName, oUserInfo.PassWord, oUserInfo.UserId.ToString(), oUserInfo.PermsDept, oUserInfo.PermsRole, sRetMsg
            };
            string[] sParametersType = new string[9] {
                "Int", "Int", "VarChar", "VarChar", "VarChar", "Int", "VarChar", "VarChar", "VarChar"
            };
            string[] sParametersDirection = new string[9] {
                "ReturnValue", "Input", "Input", "Input", "Input", "Input", "Input", "Input", "Output"
            };
            int[] sParametersSize = new int[9] {
                10, 20, 10, 50, 20, 20, 200, 200, 512
            };

            iResult = int.Parse(PublicUtility.OperData(spName, sParameters, sParametersValue, sParametersType, sParametersDirection, sParametersSize, out sRetMsg, out sRetMsg));

            if (iResult == -1)
            {
                MessageBox.Show(sRetMsg); return;
            }
        }
Пример #9
0
        private void button1_Click(object sender, EventArgs e)
        {
            int     iCurrentItemId = gridView1.FocusedRowHandle;
            DataRow row            = gridView1.GetDataRow(iCurrentItemId);
            string  sInvSeqId      = Convert.ToString(row["INVSEQID"]);
            string  sIvoiceCode    = Convert.ToString(row["INVOICECODE"]);
            string  sIvoiceNo      = Convert.ToString(row["INVOICENO"]);

            string sResult = "";
            string sUrl    = "http://localhost:8081";

            //string sJson = "fpdm=3200182130&fphm=64003515&qdbj=0&dysz=1";
            string sJson = "fpdm=" + sIvoiceCode + "&fphm=" + sIvoiceNo;

            sResult = PublicUtility.PostJson(sUrl, sJson);
            ToJsonMy oToJsonMy = PublicUtility.JsonMy(sResult);

            if (oToJsonMy.result == "True" && oToJsonMy.data == "成功")
            {
                PrintBill(sInvSeqId);
            }
            else
            {
                MessageBox.Show(oToJsonMy.data + "-" + oToJsonMy.result);
            }

            //PrintBill(sInvSeqId);
            //HttpRequest.PostAsyncJson(sUrl, sJson);
        }
Пример #10
0
        private void btnBill_Click_1(object sender, EventArgs e)
        {
            int iInvType = 0;

            if (cbbInvType.SelectedValue.ToString() == "1")
            {
                iInvType = 0;
            }
            else
            {
                iInvType = 2;
            }

            if (PublicUtility.ValidCustInfo(iInvType, gridView1) == 0)
            {
                foreach (int i in gridView1.GetSelectedRows())
                {
                    if (Invoice(i) == 1)
                    {
                        MessageBox.Show(sRetMsg); return;
                    }
                }
                GetData();
            }
        }
Пример #11
0
        public int InvoiceBillDetail(int iItemId)
        {
            DataTable myDt = new DataTable();

            myDt = PublicUtility.InvoiceBillDetail(sCurrentInvSeqId);
            int iTaxDetailCount = myDt.Rows.Count;

            //条目数大于8
            frmMain.oComTaxCard._InvocieHeader.sInfoListName = "";
            if (iTaxDetailCount > 8)
            {
                frmMain.oComTaxCard._InvocieHeader.sInfoListName = "详见销货清单";
            }

            if (iTaxDetailCount > 0)
            {
                frmMain.oComTaxCard.dtInvocieDetail = myDt;
                return(0);
            }
            else
            {
                string sRetMsg = "发票开具失败,无可开的发票明细。";
                return(1);
            }
        }
Пример #12
0
        public int PrintBill(string sInvSeqid)
        {
            int iResult = 0;

            sRetMsg = "";
            string sCurrentInvSeqId = "";

            string spName = "p_fin_invoice_print";

            string[] sParameters = new string[4] {
                "result", "@InvSeqId", "@UserId", "@Msg"
            };

            string[] sParametersValue = new string[4] {
                "", sInvSeqid, "0", ""
            };
            string[] sParametersType = new string[4] {
                "VarChar", "VarChar", "Int", "VarChar"
            };
            string[] sParametersDirection = new string[4] {
                "ReturnValue", "Input", "Input", "Output"
            };
            int[] sParametersSize = new int[4] {
                20, 20, 20, 512
            };

            //iResult = int.Parse(PublicUtility.OperData(spName, sParameters, sParametersValue, sParametersType, sParametersDirection, sParametersSize));
            iResult = int.Parse(PublicUtility.OperData(spName, sParameters, sParametersValue, sParametersType, sParametersDirection, sParametersSize, out sCurrentInvSeqId, out sRetMsg));
            return(iResult);
        }
Пример #13
0
        private int Invoice()
        {
            iCurrentItemId = -1;

            if (gridView1.SelectedRowsCount > 0)
            {
                iCurrentItemId = gridView1.FocusedRowHandle;

                DataRow row = gridView1.GetDataRow(iCurrentItemId);

                iCurrentBseqId = Convert.ToString(row["BSEQID"]);

                if (InvoiceBill(iCurrentBseqId, "0") == -1)
                {
                    MessageBox.Show(sRetMsg); return(1);
                }

                if (InvoiceBillHeader(iCurrentItemId) == -1)
                {
                    MessageBox.Show(sRetMsg); return(1);
                }
                if (InvoiceBillDetail(iCurrentItemId) == 1)
                {
                    MessageBox.Show(sRetMsg); return(1);
                }
                //接口开具发票,不成功作废后台明细
                if (frmMain.oComTaxCard.InvoiceBill() == 1)
                {
                    MessageBox.Show(frmMain.oComTaxCard.sRetMsg);
                    if (PublicUtility.InvoiceCanceled(sCurrentInvSeqId) == -1)
                    {
                        MessageBox.Show(frmMain.sRetMsg); return(1);
                    }
                    return(1);
                }
                else
                {
                    if (chkPrint.Checked)
                    {
                        frmMain.oComTaxCard.InvPrint(int.Parse(frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoNumber.ToString()),
                                                     frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoTypeCode, 0, frmMain.oComTaxCard.iInfoShowPrtDlg);
                        if (frmMain.oComTaxCard.iResult == 1)
                        {
                            MessageBox.Show(frmMain.oComTaxCard.sRetMsg);
                            return(1);
                        }
                        if (PublicUtility.PrintBill(sCurrentInvSeqId) == -1)
                        {
                            MessageBox.Show(frmMain.sRetMsg); return(1);
                        }
                    }
                    if (PublicUtility.InvoiceValidated(sCurrentInvSeqId, frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoTypeCode, frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoNumber.ToString()) == -1)
                    {
                        MessageBox.Show(frmMain.sRetMsg); return(1);
                    }
                }
            }
            return(0);
        }
Пример #14
0
    public void LoadClientPlayerResource()
    {
        string filePath = Application.dataPath + "/Resources/GamePlay/" + GameMapID + "/ResourceConfig.xml";

        if (File.Exists(filePath))
        {
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(filePath);
            XmlNodeList node = xmlDoc.SelectSingleNode("ResourceConfig").ChildNodes;

            int CurrentPlayerID        = -1;
            int CurrentMineral         = -1;
            int CurrentMineralCapacity = -1;
            int CurrentGas             = -1;
            int CurrentGasCapacity     = -1;

            foreach (XmlElement PlayerResourceInfo in node)
            {
                foreach (XmlElement PlayerResourceInfoItem in PlayerResourceInfo.ChildNodes)
                {
                    if (PlayerResourceInfoItem.Name == "PlayerID")
                    {
                        CurrentPlayerID = PublicUtility.StringToInt(PlayerResourceInfoItem.InnerText);
                    }
                    else if (PlayerResourceInfoItem.Name == "Mineral")
                    {
                        CurrentMineral = PublicUtility.StringToInt(PlayerResourceInfoItem.InnerText);
                    }
                    else if (PlayerResourceInfoItem.Name == "MineralCapacity")
                    {
                        CurrentMineralCapacity = PublicUtility.StringToInt(PlayerResourceInfoItem.InnerText);
                    }
                    else if (PlayerResourceInfoItem.Name == "Gas")
                    {
                        CurrentGas = PublicUtility.StringToInt(PlayerResourceInfoItem.InnerText);
                    }
                    else if (PlayerResourceInfoItem.Name == "GasCapacity")
                    {
                        CurrentGasCapacity = PublicUtility.StringToInt(PlayerResourceInfoItem.InnerText);
                    }
                }

                if (CurrentPlayerID == MainGameController.GetPlayerID())
                {
                    break;
                }
            }

            Debug.Log("233" + CurrentPlayerID);

            MainResourceManager.SetClientPlayerMineral(CurrentMineral);
            MainResourceManager.SetClientPlayerMineralCapacity(CurrentMineralCapacity);
            MainResourceManager.SetClientPlayerGas(CurrentGas);
            MainResourceManager.SetClientPlayerGasCapacity(CurrentGasCapacity);
            MainResourceManager.DisplayResourceUI();

            GameObject.Find("PlayerResourceArea").GetComponent <PlayerResourceAreaController>().DisplayResourceUI();
        }
    }
Пример #15
0
        //调用税控开票
        private int Invoice()
        {
            if (gridView2.SelectedRowsCount == 0)
            {
                MessageBox.Show("没有选择开票明细,请先选中开票明细后重试!"); return(1);
            }

            string sInvTypeId = cbbInvType.EditValue.ToString();

            if (sInvTypeId == "2")
            {
                frmMain.oComTaxCard.iInvType = 2;
            }
            if (sInvTypeId == "1")
            {
                frmMain.oComTaxCard.iInvType = 0;
            }

            if (InvoiceBill() == -1)
            {
                MessageBox.Show(sRetMsg); return(1);
            }

            if (InvoiceBillHeader() == -1)
            {
                MessageBox.Show(sRetMsg); return(1);
            }
            if (InvoiceBillDetail() == 1)
            {
                MessageBox.Show(sRetMsg); return(1);
            }
            //接口开具发票,不成功作废后台明细
            if (chkNoBill.Checked == false)
            {
                if (frmMain.oComTaxCard.InvoiceBill() == 1)
                {
                    MessageBox.Show(frmMain.oComTaxCard.sRetMsg);
                    if (PublicUtility.InvoiceCanceled(sCurrentInvSeqId) == -1)
                    {
                        MessageBox.Show(sRetMsg);
                    }
                    return(1);
                }
                else
                {
                    if (PublicUtility.InvoiceValidated(sCurrentInvSeqId, frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoTypeCode, frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoNumber.ToString()) == -1)
                    {
                        MessageBox.Show(frmMain.sRetMsg); return(1);
                    }

                    if (chkPrint.Checked)
                    {
                        frmMain.oComTaxCard.InvPrint(int.Parse(frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoNumber.ToString()),
                                                     frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoTypeCode, 0, frmMain.oComTaxCard.iInfoShowPrtDlg);
                    }
                }
            }
            return(0);
        }
Пример #16
0
 private void GetData(frmUserInfo ofrmUserInfo)
 {
     oUserInfo.UserId    = ofrmUserInfo.iUserId;
     oUserInfo.UserCode  = ofrmUserInfo.txtNo.Text.Trim();
     oUserInfo.UserName  = ofrmUserInfo.txtUserName.Text.Trim();
     oUserInfo.PassWord  = ofrmUserInfo.txtPassWord.Text.Trim();
     oUserInfo.PermsDept = PublicUtility.GetCheckList(ofrmUserInfo.chkListDept);
     oUserInfo.PermsRole = PublicUtility.GetCheckList(ofrmUserInfo.chkListRole);
 }
    // 从XML中载入武器信息
    public void LoadWeaponInfoFromXML()
    {
        string filePath = Application.dataPath + "/Resources/Weapon.xml";

        if (File.Exists(filePath))
        {
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(filePath);
            XmlNodeList node = xmlDoc.SelectSingleNode("Weapon").ChildNodes;
            foreach (XmlElement WeaponInfo in node)
            {
                //Debug.Log("333");
                //1. 在内存中创建一个新的Weapon实例
                Weapon NewWeapon = new Weapon();

                //2. 将XML中的信息拷贝到该Weapon实例中
                foreach (XmlElement WeaponInfoItem in WeaponInfo.ChildNodes)
                {
                    if (WeaponInfoItem.Name == "WeaponID")
                    {
                        // 读取并设置新武器的武器ID
                        NewWeapon.SetWeaponID(WeaponInfoItem.InnerText);
                    }
                    else if (WeaponInfoItem.Name == "WeaponName")
                    {
                        // 读取并设置新武器的武器射程
                        NewWeapon.SetWeaponName(WeaponInfoItem.InnerText);
                    }
                    else if (WeaponInfoItem.Name == "WeaponRange")
                    {
                        // 读取并设置新武器的武器射程
                        NewWeapon.SetWeaponRange(PublicUtility.StringToFloat(WeaponInfoItem.InnerText));
                    }
                    else if (WeaponInfoItem.Name == "WeaponAttackInterval")
                    {
                        // 读取并设置新武器的武器开火间隔
                        NewWeapon.SetAttackInterval(PublicUtility.StringToFloat(WeaponInfoItem.InnerText));
                    }
                    else if (WeaponInfoItem.Name == "WeaponAttackEffect")
                    {
                        NewWeapon.SetWeaponAttackEffect(GetEffect(WeaponInfoItem.InnerText));
                    }
                }
                //3. 将新武器添加到武器字典中
                AddWeapon(NewWeapon);
            }
        }
    }
Пример #18
0
        private void FillData(int iRoleId, frmRoleAction ofrmRoleAction)
        {
            string sDeptSql = "SELECT ID AS ACTIONID,ID,PERMID,ACTIONNO,ACTIONNAME,PARENTID," +
                              "CONVERT(Bit,CASE WHEN(SELECT ROLEID FROM T_ROLE_ACTION WHERE ACTIONID = A.PERMID AND ROLEID = " + iRoleId.ToString() + ") IS NULL THEN 0 ELSE 1 END) AS ISCHECK " +
                              "FROM T_Action A";

            ofrmRoleAction.tlRole.DataSource        = PublicUtility.GetDataTable(sDeptSql);
            ofrmRoleAction.tlRole.KeyFieldName      = "ACTIONID";
            ofrmRoleAction.tlRole.ParentFieldName   = "PARENTID";
            ofrmRoleAction.tlRole.CheckBoxFieldName = "ISCHECK";

            ofrmRoleAction.tlRole.Columns["ID"].Visible      = false;
            ofrmRoleAction.tlRole.Columns["ISCHECK"].Visible = false;
            //ofrmRoleAction.tlRole.Columns["PARENTID"].Visible = false;

            ofrmRoleAction.txtRoleName.Text = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "ROLENAME").ToString();
        }
Пример #19
0
        public int InvoiceBill(int iItemId)
        {
            string[] sOutPara = new string[10] {
                "0000", "00000000000000000000000", "00000000000000000000000",
                "00000000000000000000000", "00000000000000000000000", "00000000000000000000000",
                "00000000000000000000000", "00000000000000000000000",
                "00000000000000000000000000000000000000000000000000000000000000000000",
                "000000000000000000000000000000000000000000000000000000000000000000"
            };
            int iResult = 0;

            sRetMsg          = "";
            sCurrentInvSeqId = "";
            string sInvTypeId = "";

            sInvTypeId = cbbInvType.SelectedValue.ToString();
            DataRow row      = gridView1.GetDataRow(iItemId);
            string  ssCustId = row["CUSTID"].ToString();
            string  sRaxRate = row["TAXRATE"].ToString();

            string spName = "p_fin_invoice_bill_Sum_Month";

            string[] sParameters = new string[10] {
                "result", "@InvTypeId", "@TaxRate", "@DeptId", "@sCustId", "@BeginDate", "@EndDate", "@UserId", "@InvSeqIdList", "@Msg"
            };

            string[] sParametersValue = new string[10] {
                "", sInvTypeId, sRaxRate, sDeptId, ssCustId, sDateFrom, sDateTo, frmMain.sUserid, "", "000000000000000000000000"
            };
            string[] sParametersType = new string[10] {
                "VarChar", "Int", "Int", "Int", "VarChar", "VarChar", "VarChar", "VarChar", "VarChar", "VarChar"
            };
            string[] sParametersDirection = new string[10] {
                "ReturnValue", "Input", "Input", "Input", "Input", "Input", "Input", "Input", "Output", "Output"
            };
            int[] sParametersSize = new int[10] {
                10, sInvTypeId.Length, sRaxRate.Length, sDeptId.Length, ssCustId.Length, sDateFrom.Length, sDateTo.Length, 20, 20, 512
            };

            //iResult = int.Parse(PublicUtility.OperDataEx(spName, sParameters, sParametersValue, sParametersType, sParametersDirection, sParametersSize, out sOutPara));
            iResult          = int.Parse(PublicUtility.OperDataEx(spName, sParameters, sParametersValue, sParametersType, sParametersDirection, out sOutPara));
            sCurrentInvSeqId = sOutPara[8];
            sRetMsg          = sOutPara[9];
            return(iResult);
        }
    // 从XML中载入棋子雕像模板信息
    public void LoadStatusFromXML()
    {
        string filePath = Application.dataPath + "/Resources/Status.xml";

        if (File.Exists(filePath))
        {
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(filePath);
            XmlNodeList node = xmlDoc.SelectSingleNode("PieceStatus").ChildNodes;
            foreach (XmlElement PieceStatusInfo in node)
            {
                PieceStatusInfo NewPieceStatus = new PieceStatusInfo();

                foreach (XmlElement PieceStatusItem in PieceStatusInfo.ChildNodes)
                {
                    if (PieceStatusItem.Name == "PieceStatusID")
                    {
                        //Debug.Log(PieceStatusItem.InnerText);
                        NewPieceStatus.SetPieceStatusID(PieceStatusItem.InnerText);
                        NewPieceStatus.SetStatusPrefab(PieceStatusItem.InnerText);
                    }
                    else if (PieceStatusItem.Name == "PieceStatusName")
                    {
                        NewPieceStatus.SetPieceStatusName(PieceStatusItem.InnerText);
                    }
                    else if (PieceStatusItem.Name == "Position")
                    {
                        //NewPieceStatus.SetLocalPosition(StringToVector3(PieceStatusItem.InnerText));
                    }
                    else if (PieceStatusItem.Name == "Scale")
                    {
                        NewPieceStatus.SetLocalScale(PublicUtility.StringToVector3(PieceStatusItem.InnerText));
                        //Debug.Log(StringToVector3(PieceStatusItem.InnerText));
                    }
                    else if (PieceStatusItem.Name == "Rotation")
                    {
                        NewPieceStatus.SetLocalRotation(PublicUtility.StringToVector3(PieceStatusItem.InnerText));
                    }
                }

                AddPieceStatusInfo(NewPieceStatus);
            }
        }
    }
Пример #21
0
        private int InvoiceTaxBill(int iInvSeqId)
        {
            if (InvoiceBillDetail(iInvSeqId) == 1)
            {
                MessageBox.Show(sRetMsg); return(1);
            }
            if (frmMain.oComTaxCard.InvoiceBill() == 1)
            {
                MessageBox.Show(frmMain.oComTaxCard.sRetMsg);
                if (PublicUtility.InvoiceCanceled(iInvSeqId.ToString()) == -1)
                {
                    MessageBox.Show(frmMain.sRetMsg); return(1);
                }
                return(1);
            }
            else
            {
                if (chkPrint.Checked)
                {
                    short iInfoShowPrtDlg = 0;
                    if (chkShowPrint.Checked)
                    {
                        iInfoShowPrtDlg = 1;
                    }

                    frmMain.oComTaxCard.InvPrint(int.Parse(frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoNumber.ToString()),
                                                 frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoTypeCode, 0, iInfoShowPrtDlg);
                    if (frmMain.oComTaxCard.iResult == 1)
                    {
                        MessageBox.Show(frmMain.oComTaxCard.sRetMsg);
                        return(1);
                    }
                    if (PublicUtility.PrintBill(iInvSeqId.ToString()) == -1)
                    {
                        MessageBox.Show(frmMain.sRetMsg); return(1);
                    }
                }
                if (PublicUtility.InvoiceValidated(iInvSeqId.ToString(), frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoTypeCode, frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoNumber.ToString()) == -1)
                {
                    MessageBox.Show(frmMain.sRetMsg); return(1);
                }
            }
            return(0);
        }
Пример #22
0
        private void FillData(int iId, frmUserInfo ofrmUserInfo)
        {
            if (gridView1.FocusedRowHandle > 0)
            {
                ofrmUserInfo.iUserId          = int.Parse(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "ID").ToString());
                ofrmUserInfo.txtId.Text       = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "ID").ToString();
                ofrmUserInfo.txtNo.Text       = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "USERCODE").ToString();
                ofrmUserInfo.txtUserName.Text = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "USERNAME").ToString();
                //ofrmUserInfo.txtPassWord.Text = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "PASSWORD").ToString();
                //ofrmUserInfo.txtPassWordPre.Text = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "PASSWORD").ToString();

                oUserInfo.UserId    = int.Parse(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "ID").ToString());
                oUserInfo.UserCode  = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "USERCODE").ToString();
                oUserInfo.UserName  = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "USERNAME").ToString();
                oUserInfo.PassWord  = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "PASSWORD").ToString();
                oUserInfo.PermsDept = PublicUtility.GetCheckList(ofrmUserInfo.chkListDept);
                oUserInfo.PermsRole = PublicUtility.GetCheckList(ofrmUserInfo.chkListRole);
            }
        }
Пример #23
0
        //调用税控开票
        private int Invoice()
        {
            if (InvoiceBill() == -1)
            {
                MessageBox.Show(sRetMsg); return(1);
            }

            if (InvoiceBillHeader() == -1)
            {
                MessageBox.Show(sRetMsg); return(1);
            }
            if (InvoiceBillDetail() == 1)
            {
                MessageBox.Show(sRetMsg); return(1);
            }
            //接口开具发票,不成功作废后台明细
            if (chkNoBill.Checked == false)
            {
                if (frmMain.oComTaxCard.InvoiceBill() == 1)
                {
                    MessageBox.Show(frmMain.oComTaxCard.sRetMsg);
                    if (PublicUtility.InvoiceCanceled(sCurrentInvSeqId) == -1)
                    {
                        MessageBox.Show(sRetMsg);
                    }
                    return(1);
                }
                else
                {
                    if (chkPrint.Checked)
                    {
                        frmMain.oComTaxCard.InvPrint(int.Parse(frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoNumber.ToString()),
                                                     frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoTypeCode, 0, frmMain.oComTaxCard.iInfoShowPrtDlg);
                    }
                    if (PublicUtility.InvoiceValidated(sCurrentInvSeqId, frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoTypeCode, frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoNumber.ToString()) == -1)
                    {
                        MessageBox.Show(frmMain.sRetMsg); return(1);
                    }
                }
            }
            return(0);
        }
Пример #24
0
        private void initForm(int iUserId, frmUserInfo ofrmUserInfo)
        {
            string sDeptSql = "SELECT DEPTID,DEPTNAME," +
                              "CONVERT(Bit,CASE WHEN(SELECT DEPTID FROM T_USER_DEPT WHERE DEPTID = A.DEPTID AND USERID = " + iUserId.ToString() + ") IS NULL THEN 0 ELSE 1 END) AS ISCHECK " +
                              "FROM T_DEPT A";

            ofrmUserInfo.chkListDept.DataSource    = PublicUtility.GetDataTable(sDeptSql);
            ofrmUserInfo.chkListDept.DisplayMember = "DEPTNAME";
            ofrmUserInfo.chkListDept.ValueMember   = "DEPTID";
            ofrmUserInfo.chkListDept.CheckMember   = "ISCHECK";

            string sRoleSql = "SELECT ROLEID,ROLENAME," +
                              "CONVERT(Bit,CASE WHEN(SELECT ROLEID FROM T_USER_ROLE WHERE ROLEID = A.ROLEID AND USERID = " + iUserId.ToString() + ") IS NULL THEN 0 ELSE 1 END) AS ISCHECK " +
                              "FROM T_ROLE A ";

            ofrmUserInfo.chkListRole.DataSource    = PublicUtility.GetDataTable(sRoleSql);
            ofrmUserInfo.chkListRole.DisplayMember = "ROLENAME";
            ofrmUserInfo.chkListRole.ValueMember   = "ROLEID";
            ofrmUserInfo.chkListRole.CheckMember   = "ISCHECK";
        }
Пример #25
0
        public int InvoiceBill(int iItemId)
        {
            int iResult = 0;

            sRetMsg          = "";
            sCurrentInvSeqId = "";
            string  sInvTypeId = "";
            DataRow row        = gridView1.GetDataRow(iItemId);

            //sInvTypeId = cbbInvType.SelectedValue.ToString();
            sInvTypeId = Convert.ToString(row["INVTYPEID"]);
            string sBseqId = Convert.ToString(row["BSEQID"]);

            sDeptId = cbbDept.SelectedValue.ToString();
            //sInvTypeId = row["INVTYPEID"].ToString();

            string ssCustId = row["CUSTID"].ToString();
            string sRaxRate = row["TAXRATE"].ToString();

            string spName = "p_fin_invoice_bill_Sum";

            string[] sParameters = new string[11] {
                "result", "@DeptId", "@BseqId", "@InvTypeId", "@TaxRate", "@sCustId", "@BeginDate", "@EndDate", "@UserId", "@InvSeqId", "@Msg"
            };

            string[] sParametersValue = new string[11] {
                "", sDeptId, sBseqId, sInvTypeId, sRaxRate, ssCustId, sDateFrom, sDateTo, frmMain.sUserid, "", ""
            };
            string[] sParametersType = new string[11] {
                "VarChar", "Int", "VarChar", "Int", "Int", "VarChar", "VarChar", "VarChar", "VarChar", "VarChar", "VarChar"
            };
            string[] sParametersDirection = new string[11] {
                "ReturnValue", "Input", "Input", "Input", "Input", "Input", "Input", "Input", "Input", "Output", "Output"
            };
            int[] sParametersSize = new int[11] {
                10, 10, sBseqId.Length, sInvTypeId.Length, sRaxRate.Length, ssCustId.Length, sDateFrom.Length, sDateTo.Length, 20, 20, 512
            };

            iResult = int.Parse(PublicUtility.OperData(spName, sParameters, sParametersValue, sParametersType, sParametersDirection, sParametersSize, out sCurrentInvSeqId, out sRetMsg));
            return(iResult);
        }
Пример #26
0
    public void LoadInitialPieceFromXML()
    {
        string filePath = Application.dataPath + "/Resources/XML/InitialPieceConfig/" + GameMapID + ".xml";

        if (File.Exists(filePath))
        {
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(filePath);
            XmlNodeList node = xmlDoc.SelectSingleNode("InitialPieceConfig").ChildNodes;
            foreach (XmlElement InitialPieceInfo in node)
            {
                string     CurrentPieceID         = "";
                Vector2Int CurrentOuterCoordinate = new Vector2Int();
                Vector2Int CurrentInnerCoordinate = new Vector2Int();

                foreach (XmlElement InitialPieceInfoItem in InitialPieceInfo.ChildNodes)
                {
                    if (InitialPieceInfoItem.Name == "PieceID")
                    {
                        CurrentPieceID = InitialPieceInfoItem.InnerText;
                    }
                    else if (InitialPieceInfoItem.Name == "OuterCoordinate")
                    {
                        CurrentOuterCoordinate = PublicUtility.StringToVector2Int(InitialPieceInfoItem.InnerText);
                    }
                    else if (InitialPieceInfoItem.Name == "InnerCoordinate")
                    {
                        CurrentInnerCoordinate = PublicUtility.StringToVector2Int(InitialPieceInfoItem.InnerText);
                    }
                    else if (InitialPieceInfoItem.Name == "Orientation")
                    {
                        Debug.Log(InitialPieceInfoItem.InnerText);
                    }
                }

                MainWorldManager.CreatePieceOnChessboard(CurrentPieceID, CurrentInnerCoordinate, CurrentOuterCoordinate);
            }
        }
    }
Пример #27
0
        private void btnCancel_Click(object sender, EventArgs e)
        {
            int   iResult        = 0;
            int   iMyRetrun      = 0;
            short iInfoKind      = 0;
            int   iCurrentItemId = gridView1.FocusedRowHandle;

            DataRow row = gridView1.GetDataRow(iCurrentItemId);

            string iCurrentBseqId = Convert.ToString(row["INVSEQID"]);

            if (cbbInvType.SelectedValue.ToString() == "1")
            {
                iInfoKind = 0;
            }
            else
            {
                iInfoKind = 2;
            }

            iResult = frmMain.oComTaxCard.InvCancel(iInfoKind, Convert.ToInt32(row["INVOICENO"]), Convert.ToString(row["INVOICECODE"]));
            if (iResult == 1)
            {
                MessageBox.Show(frmMain.oComTaxCard.sRetMsg);
            }
            else
            {
                if (PublicUtility.InvoiceCanceled(iCurrentBseqId) == -1)
                {
                    MessageBox.Show(frmMain.sRetMsg);
                }
                if (PublicUtility.InvoiceCanceledSK(iCurrentBseqId) == -1)
                {
                    MessageBox.Show(frmMain.sRetMsg);
                }
            }
            GetData();
        }
Пример #28
0
        public int Login(string UserCode, string PassWord)
        {
            int iResult = 0;

            string spName = "p_Login";

            string[] sOutPara = new string[8] {
                "", "", "", "000000000", "000000000000000", "00000000000000000000000", "00000000000000000", "管理员"
            };

            string[] sParameters = new string[8] {
                "result", "@UserName", "@Password", "@UserId", "@PermsDept", "@Perms", "@Msg", "@TrueName"
            };

            string[] sParametersValue = new string[8] {
                "0", UserCode, PassWord, sUserId, sPermsDept, sPerms, sRetMsg, sTrueName
            };
            string[] sParametersType = new string[8] {
                "Int", "VarChar", "VarChar", "Int", "VarChar", "VarChar", "VarChar", "VarChar"
            };
            string[] sParametersDirection = new string[8] {
                "ReturnValue", "Input", "Input", "Output", "Output", "Output", "Output", "Output"
            };
            int[] sParametersSize = new int[8] {
                10, UserCode.Length, PassWord.Length, 20, 200, 200, 512, 20
            };

            iResult    = int.Parse(PublicUtility.OperDataEx(spName, sParameters, sParametersValue, sParametersType, sParametersDirection, out sOutPara));
            sUserId    = sOutPara[3];
            sPermsDept = sOutPara[4];
            sPerms     = sOutPara[5];
            sRetMsg    = sOutPara[6];
            sTrueName  = sOutPara[7];

            return(iResult);
        }
Пример #29
0
        private int Invoice(int iItemId)
        {
            if (iItemId != -1)
            {
                //iCurrentItemId = gridView1.FocusedRowHandle;
                //iCurrentItemId = iItemId;

                DataRow row = gridView1.GetDataRow(iItemId);

                //iCurrentCustId = Convert.ToString(row["BSEQID"]);
                //后台生成发票明细
                if (InvoiceBill(iItemId) == -1)
                {
                    MessageBox.Show(frmMain.sRetMsg); return(1);
                }

                if (InvoiceBillHeader(iItemId) == 1)
                {
                    MessageBox.Show(sRetMsg); return(1);
                }
                if (InvoiceBillDetail(iItemId) == 1)
                {
                    MessageBox.Show(sRetMsg); return(1);
                }

                //if (int.Parse(cbbInvType.SelectedValue.ToString()) == 2) frmMain.oComTaxCard.iInvType = 2;
                //if (int.Parse(cbbInvType.SelectedValue.ToString()) == 1) frmMain.oComTaxCard.iInvType = 0;
                if (Convert.ToString(row["INVTYPEID"]) == "2")
                {
                    frmMain.oComTaxCard.iInvType = 2;
                }
                if (Convert.ToString(row["INVTYPEID"]) == "1")
                {
                    frmMain.oComTaxCard.iInvType = 0;
                }

                short iInfoShowPrtDlg = 0;
                if (chkShowPrint.Checked)
                {
                    iInfoShowPrtDlg = 1;
                }

                if (!chkEnable.Checked)
                {
                    //接口开具发票,不成功作废后台明细
                    if (frmMain.oComTaxCard.InvoiceBill() == 1)
                    {
                        MessageBox.Show(frmMain.oComTaxCard.sRetMsg);
                        if (PublicUtility.InvoiceCanceled(sCurrentInvSeqId) == -1)
                        {
                            MessageBox.Show(frmMain.sRetMsg); return(1);
                        }
                        return(1);
                    }
                    else
                    {
                        if (PublicUtility.InvoiceValidated(sCurrentInvSeqId, frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoTypeCode, frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoNumber.ToString()) == -1)
                        {
                            MessageBox.Show(frmMain.sRetMsg); return(1);
                        }

                        if (chkPrint.Checked)
                        {
                            frmMain.oComTaxCard.InvPrint(int.Parse(frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoNumber.ToString()),
                                                         frmMain.oComTaxCard._InvoiceRetInfo.sRetInfoTypeCode, 0, iInfoShowPrtDlg);
                            if (frmMain.oComTaxCard.iResult == 1)
                            {
                                MessageBox.Show(frmMain.oComTaxCard.sRetMsg);
                                return(1);
                            }
                            if (PublicUtility.PrintBill(sCurrentInvSeqId) == -1)
                            {
                                MessageBox.Show(frmMain.sRetMsg); return(1);
                            }
                        }
                        //{ MessageBox.Show(frmMain.oComTaxCard.sRetMsg); return 1; }
                    }
                }
                else
                {
                    if (PublicUtility.InvoiceValidated(sCurrentInvSeqId, "111", "111") == -1)
                    {
                        MessageBox.Show(frmMain.sRetMsg); return(1);
                    }
                }
            }
            return(0);
        }
    // 从XML中载入棋子模板信息
    public void LoadPieceInfoFromXML()
    {
        string filePath = Application.dataPath + "/Resources/Piece.xml";

        if (File.Exists(filePath))
        {
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(filePath);
            XmlNodeList node = xmlDoc.SelectSingleNode("Piece").ChildNodes;
            foreach (XmlElement PieceInfo in node)
            {
                //item下面的节点
                //Debug.Log(ele.Name);

                Piece NewPiece = new Piece();

                NewPiece.SetPiecePedestalInfo(GetPiecePedestalInfo("TerrainePedestal1"));

                NewPiece.SetPieceStatusInfo(GetPieceStatusInfo("BanelingCommando"));

                foreach (XmlElement PieceInfoItem in PieceInfo.ChildNodes)
                {
                    //Debug.Log(i1.Name);
                    if (PieceInfoItem.Name == "PieceID")
                    {
                        NewPiece.SetPieceID(PieceInfoItem.InnerText);
                    }
                    else if (PieceInfoItem.Name == "PieceName")
                    {
                        NewPiece.SetPieceName(PieceInfoItem.InnerText);
                    }
                    else if (PieceInfoItem.Name == "PieceMineralCost")
                    {
                        NewPiece.SetPieceMineralCost(PublicUtility.StringToInt(PieceInfoItem.InnerText));
                    }
                    else if (PieceInfoItem.Name == "PieceGasCost")
                    {
                        NewPiece.SetPieceGasCost(PublicUtility.StringToInt(PieceInfoItem.InnerText));
                    }
                    else if (PieceInfoItem.Name == "PieceRetreatThreshold")
                    {
                        // 设置棋子撤退阈值
                        NewPiece.SetRetreatThreshold(PublicUtility.StringToFloat(PieceInfoItem.InnerText));
                    }
                    else if (PieceInfoItem.Name == "PiecePedestalID")
                    {
                        //Debug.Log(PieceInfoItem.InnerText);
                        NewPiece.SetPiecePedestalInfo(GetPiecePedestalInfo(PieceInfoItem.InnerText));
                    }
                    else if (PieceInfoItem.Name == "PieceStatusID")
                    {
                        //Debug.Log(PieceInfoItem.InnerText);
                        NewPiece.SetPieceStatusInfo(GetPieceStatusInfo(PieceInfoItem.InnerText));
                    }
                    else if (PieceInfoItem.Name == "PieceDeathEffectID")
                    {
                        //Debug.Log(PieceInfoItem.InnerText);
                        NewPiece.SetPieceDeathEffect(GetEffect(PieceInfoItem.InnerText));
                    }
                    else if (PieceInfoItem.Name == "PieceIncludeUnit")
                    {
                        string ContainUnitID  = "";
                        int    ContainUnitNum = 0;

                        foreach (XmlElement IncludeUnitItem in PieceInfoItem.ChildNodes)
                        {
                            if (IncludeUnitItem.Name == "UnitID")
                            {
                                //Debug.Log(IncludeUnitItem.InnerText);
                                ContainUnitID = IncludeUnitItem.InnerText;
                            }
                            else if (IncludeUnitItem.Name == "UnitNum")
                            {
                                //Debug.Log(IncludeUnitItem.InnerText);
                                ContainUnitNum = PublicUtility.StringToInt(IncludeUnitItem.InnerText);
                            }
                        }
                        NewPiece.LoadUnitInfo(GetUnit(ContainUnitID), ContainUnitNum);
                    }
                    else if (PieceInfoItem.Name == "PieceDescription")
                    {
                        foreach (XmlElement PieceDescriptionItem in PieceInfoItem.ChildNodes)
                        {
                            if (PieceDescriptionItem.Name == "PieceDescriptionItem")
                            {
                                //Debug.Log(PieceDescriptionItem.InnerText);
                                NewPiece.AddCardDescriptionItem(PieceDescriptionItem.InnerText);
                            }
                        }
                    }
                }
                // 将新加载的棋子添加到游戏棋子模板库当中
                AddPiece(NewPiece);
            }
        }
    }