• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# PsqlConnection类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中PsqlConnection的典型用法代码示例。如果您正苦于以下问题:C# PsqlConnection类的具体用法?C# PsqlConnection怎么用?C# PsqlConnection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PsqlConnection类属于命名空间,在下文中一共展示了PsqlConnection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: button2_Click

        private void button2_Click(object sender, EventArgs e)
        {
            string sConnString = "Server Name=localhost;Database Name=LSYNC;";
            using (PsqlConnection oPastelConn = new PsqlConnection(sConnString))
            {
                oPastelConn.Open();

                Cursor = System.Windows.Forms.Cursors.WaitCursor;
                solPastelSDK clsPastelSDK = new solPastelSDK();

                string[] aLines = new string[2];
                aLines[0] = "0|1|105.28|120|DAY |1|0|0|023PHIREDRILL|DRILL HILTI TE16                        |4|001|     |";
              //              aLines[0] = "0|1|162.28|162.28|DAY |0|0|0|039PHIREGENERA|6KVA GENERATOR HONDA MGS6000            |4|001|     |";
                aLines[1] = "0|1|0.02|0.02|    |0|0|0|1000020        |Rounding                                |6|001|     |";

                string sHeader = "|||ABS001|05/02/2010|IN100159|Y|0|||||||||00001|0||2010/02/05 12:00:00 AM||Blondie||1|||||||||26477506|0";

                string sDataPath = "C:\\Pastel09\\FAIREGLEN";
                string sResult = clsPastelSDK.CreatePastelDocument(sHeader, aLines, 106, sDataPath, Global.iPastelSdkUser, false, oPastelConn, 1);

                MessageBox.Show(sResult);
                //CreatePastelDocument(sHeader, aLines, 106, sDataPath, Global.iPastelSdkUser, Global.bLogCreateDocument);

                //txtSdkResults.Text = sResult;

                Cursor = System.Windows.Forms.Cursors.Default;
            }
        }
开发者ID:anthonied,项目名称:LiquidPastel,代码行数:28,代码来源:Test.cs


示例2: LoadData

        public void LoadData()
        {
            using (PsqlConnection oConn = new PsqlConnection(Connect.sConnStr))
            {
                string sSql = "SELECT * FROM SOLINVENTSS";

                PsqlDataReader rdReader = Connect.getDataCommand(sSql, oConn).ExecuteReader();
                if (rdReader.HasRows)
                {
                    while (rdReader.Read())
                    {
                        int i = dgvSetup.Rows.Add();

                        dgvSetup.Rows[i].Cells["clReceiverRef"].Value = rdReader["sReceiverRef"].ToString().Trim();
                        dgvSetup.Rows[i].Cells["clReceiverAlias"].Value = rdReader["sReceiverAlias"].ToString().Trim();

                        dgvSetup.Rows[i].Cells["clIP"].Value = rdReader["sReceiverIP"].ToString().Trim();
                        dgvSetup.Rows[i].Cells["clSourceRef"].Value = rdReader["sSourceRef"].ToString().Trim();
                        dgvSetup.Rows[i].Cells["clDataPath"].Value = rdReader["sDataPath"].ToString().Trim();
                        dgvSetup.Rows[i].Cells["clSolPMS"].Value = rdReader["sLiquidConn"].ToString().Trim();
                        dgvSetup.Rows[i].Cells["clPastelConn"].Value = rdReader["sPastelConn"].ToString().Trim();

                        dgvSetup.Rows[i].Cells["clSourceStore"].Value = rdReader["sSourceStore"].ToString().Trim();
                        dgvSetup.Rows[i].Cells["clReceiverStore"].Value = rdReader["sReceiverStore"].ToString().Trim();
                    }
                }

                rdReader.Close();
            }
        }
开发者ID:anthonied,项目名称:LiquidPastel,代码行数:30,代码来源:frmSyncInventorySetup.cs


示例3: cmdFinish_Click

        private void cmdFinish_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("This will add selected stock to store. Continue?", "Recieve Stock", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.OK)
            {
                using (PsqlConnection oConn = new PsqlConnection(Solsage_Process_Management_System.Classes.Connect.sConnStr))
                {
                    oConn.Open();

                    foreach (DataGridViewRow dgRow in dgReciveOldStock.Rows)
                    {

                        string sSql = "Insert into SOLMSM ";
                        sSql += "(GeneralItemCode,GenItemDescription,QuantityScanned,UserName,ItemDate)";
                        sSql += "Values ('" + dgRow.Cells["clItemCode"].Value.ToString().Trim() + "','" + dgRow.Cells["clItemDescription"].Value.ToString().Trim() + "','" + dgRow.Cells["clQuantity"].Value.ToString().Trim() + "', '" + Solsage_Process_Management_System.Classes.Global.sLogedInUserName.ToString() + "', '" + lblDateTime.Text + "')";
                        int iReturn = Solsage_Process_Management_System.Classes.Connect.getDataCommand(sSql, oConn).ExecuteNonQuery();

                        sSql = "Insert into SOLMROS ";
                        sSql += "(ItemCode,ItemDescription,Quantity,UserName,Date)";
                        sSql += "Values ('" + dgRow.Cells["clItemCode"].Value.ToString().Trim() + "','" + dgRow.Cells["clItemDescription"].Value.ToString().Trim() + "','" + dgRow.Cells["clQuantity"].Value.ToString().Trim() + "', '" + Solsage_Process_Management_System.Classes.Global.sLogedInUserName.ToString() + "', '" + lblDateTime.Text + "') ";
                        iReturn = Solsage_Process_Management_System.Classes.Connect.getDataCommand(sSql, oConn).ExecuteNonQuery();

                    }

                    oConn.Dispose();
                }
                this.Close();
            }
        }
开发者ID:anthonied,项目名称:LiquidPastel,代码行数:28,代码来源:RecieveOldStock.cs


示例4: FetchVersionDetails

        public static void FetchVersionDetails()
        {
            using (PsqlConnection oConn = new PsqlConnection(Connect.sConnStr))
            {
                try
                {
                    oConn.Open();

                }
                catch (Exception Ex)
                {
                    MessageBox.Show("Error connecting to Liquid Database:" + Ex.ToString(),"Connection Error");
                    Application.Exit();
                }

                string sSql = "SELECT * FROM SOLUPD";
                PsqlDataReader rdReader = Connect.getDataCommand(sSql, oConn).ExecuteReader();
                while (rdReader.Read())
                {
                    iCurrVersion = Convert.ToInt32(rdReader["CurrentVersion"].ToString().Trim());
                }

                rdReader.Close();
            }
        }
开发者ID:anthonied,项目名称:LiquidPastel,代码行数:25,代码来源:DBUpdater.cs


示例5: CalculateCommission

        public static Decimal CalculateCommission(string sCommissionType, string sCommissionCategory, Decimal dInvoiceValue)
        {
            decimal dTotalCommission = 0;
            decimal dCategory = 0;
            decimal dCommissionType = 0;
            //get category percentage
            using (PsqlConnection oConn = new PsqlConnection(Solsage_Process_Management_System.Classes.Connect.sConnStr))
            {
                oConn.Open();
                String sSql = "Select CategoryPercentage from SOLMARKCAT where CategoryName = '" + sCommissionCategory + "'";
                string sPercentage = Solsage_Process_Management_System.Classes.Connect.getDataCommand(sSql, oConn).ExecuteScalar().ToString();
                dCategory = Convert.ToDecimal(sPercentage) / 100;

                try
                {
                    sSql = "Select CommissionPercentage From SOLMARKCOMTIPE where CommissionTipe = '" + sCommissionType + "'";
                    string sComPercentage = Solsage_Process_Management_System.Classes.Connect.getDataCommand(sSql, oConn).ExecuteScalar().ToString();
                    dCommissionType = Convert.ToDecimal(sComPercentage) / 100;
                }
                catch
                {
                    dCommissionType = 1;
                }

                oConn.Dispose();
            }
            dTotalCommission = dInvoiceValue * dCategory * dCommissionType;

            return dTotalCommission;
        }
开发者ID:anthonied,项目名称:LiquidPastel,代码行数:30,代码来源:Functions.cs


示例6: DBLoadRawBatchGrid

        private void DBLoadRawBatchGrid()
        {
            try
            {
                dgvRawBatches.AutoGenerateColumns = false;
                dgvRawBatches.DataSource = null;

                string sSql = "";

                using (PsqlConnection liqConn = new PsqlConnection(Connect.sConnStr))
                {
                    liqConn.Open();

                    sSql = "SELECT * FROM SOLSIL";
                    sSql += " WHERE DocNumber = '" +sDocNumFilter + "'" ;

                    dsRawBatchInfo = Connect.getDataSet(sSql, "RawBatch", liqConn);

                    bsRawBatch = new BindingSource();
                    bsRawBatch.DataSource = dsRawBatchInfo;
                    bsRawBatch.DataMember = dsRawBatchInfo.Tables["RawBatch"].TableName;

                    dgvRawBatches.DataSource = bsRawBatch;

                    liqConn.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error Info: " + ex.Message, "Exception Occurred", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
开发者ID:anthonied,项目名称:LiquidPastel,代码行数:32,代码来源:RawSIBatchZoom.cs


示例7: BusinessUnitTracking_Load

        private void BusinessUnitTracking_Load(object sender, EventArgs e)
        {
            this.WindowState = FormWindowState.Maximized;
            this.ControlBox = false;
            using (PsqlConnection oConn = new PsqlConnection(Solsage_Process_Management_System.Classes.Connect.sConnStr))
            {
                oConn.Open();
                string sSql = "select UnitId, concat(concat(UnitName,' - '),UnitDescription) 'Name'  from SOLMBS order by UnitID";
                DataSet dsUnits = Solsage_Process_Management_System.Classes.Connect.getDataSet(sSql, "Unit", oConn);
                selUnits.DataSource = dsUnits.Tables["Unit"];
                selUnits.DisplayMember = "Name";
                this.txtUnitID.DataBindings.Add(new Binding("Text", dsUnits.Tables["Unit"], "UnitID", true));
                if (loadOperators(oConn))
                {
                    selOperators_SelectedIndexChanged(sender, e);
                    viewSheet(oConn);
                }
                oConn.Dispose();
            }
            DataGridViewCellStyle dgCellStyle = new DataGridViewCellStyle();
            dgCellStyle.BackColor = Color.LightGray;
            dgInput.Columns[0].DefaultCellStyle = dgCellStyle;
            dgInput.Columns[1].DefaultCellStyle = dgCellStyle;
            dgInput.Columns[2].DefaultCellStyle = dgCellStyle;
            dgInput.Columns["cl24"].DefaultCellStyle = dgCellStyle;
            dgInput.Columns["clEntryId"].Width = 0;

            this.txtUnitID.TextChanged += new System.EventHandler(this.txtUnitID_TextChanged);
            this.selOperators.SelectedIndexChanged += new System.EventHandler(this.selOperators_SelectedIndexChanged);
        }
开发者ID:anthonied,项目名称:LiquidPastel,代码行数:30,代码来源:BusinessUnitTracking.cs


示例8: cmdlogin_Click

        private void cmdlogin_Click(object sender, EventArgs e)
        {
            bool bMatch = false;

            using (PsqlConnection oConn = new PsqlConnection(Solsage_Process_Management_System.Classes.Connect.sConnStr))
            {
                oConn.Open();
                string sSql = "Select UserName,Psswrd,Code,UserType from SOLUS where UserName = '" + txtUserName.Text + "'";
                PsqlDataReader rdReader = Solsage_Process_Management_System.Classes.Connect.getDataCommand(sSql, oConn).ExecuteReader();
                while (rdReader.Read())
                {
                    if (txtPassword.Text == rdReader["Psswrd"].ToString().Trim())
                    {
                        bMatch = true;
                        sUserCode = rdReader["Code"].ToString().Trim();
                    }
                }
                rdReader.Close();
                oConn.Dispose();
            }

             if (bMatch == true)
            {
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            else
            {
                MessageBox.Show("Username and Password does not match.  Please try again.");
                cmdClearFields();
                this.ActiveControl = txtUserName;
            }
        }
开发者ID:anthonied,项目名称:LiquidPastel,代码行数:33,代码来源:VerifyUser.cs


示例9: DBLoadInventoryGrid

        public void DBLoadInventoryGrid()
        {
            try
            {
                dgvInventory.AutoGenerateColumns = false;
                dgvInventory.DataSource = null;

                string sSql = "";

                using (PsqlConnection pasConn = new PsqlConnection(Connect.sPastelConnStr))
                {
                    pasConn.Open();

                    sSql = "SELECT RTRIM(Category) As Category, RTRIM(ItemCode) As ItemCode, RTRIM(Description) AS Description, RTRIM(UnitSize) AS UnitSize, RTRIM(ICDesc) AS ICDesc";
                    sSql += " FROM Inventory";
                    sSql += " LEFT JOIN InventoryCategory ON ICCode = Category ";

                    dsInventory = Connect.getDataSet(sSql, "Inventory", pasConn);

                    bsInventory = new BindingSource();
                    bsInventory.DataSource = dsInventory;
                    bsInventory.DataMember = dsInventory.Tables["Inventory"].TableName;

                    dgvInventory.DataSource = bsInventory;
                    dgvInventory.ClearSelection();

                    pasConn.Close();
                }

            }
            catch(Exception ex)
            {
                MessageBox.Show("Error Info: " + ex.Message, "Exception Occurred", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
开发者ID:anthonied,项目名称:LiquidPastel,代码行数:35,代码来源:ManuInventory.cs


示例10: LoadAssetGrid

        private void LoadAssetGrid()
        {
            dgAllAssetZoom.Rows.Clear();
            string sSelectedStoreCode = "All";
            using (PsqlConnection oConn = new PsqlConnection(Solsage_Process_Management_System.Classes.Connect.sPastelConnStr))
            {
                oConn.Open();
                string sSql = "SELECT distinct  Inventory.ItemCode, Description, UserDefText01, UserDefText02, UserDefText03 from Inventory ";
                sSql += " inner join MultiStoreTrn on Inventory.ItemCode = MultiStoreTrn.ItemCode ";
                sSql += " where (StoreCode = '" + sSelectedStoreCode + "' or '" + sSelectedStoreCode + "' = 'All')and (Inventory.ItemCode like '%" + txtItemCodeFilter.Text + "%' or '" + txtItemCodeFilter.Text + "' = '')";
                sSql += " and UserDefNum01 = 1 ";
                //sSql += " and UserDefText01 = 'WORKSHOP'";
                sSql += " order by Inventory.UserDefText01, Inventory.ItemCode ";

                PsqlDataReader rdReader = Solsage_Process_Management_System.Classes.Connect.getDataCommand(sSql, oConn).ExecuteReader();
                while (rdReader.Read())
                {
                    int n = dgAllAssetZoom.Rows.Add();
                    dgAllAssetZoom.Rows[n].Cells["clItemCode"].Value = rdReader["ItemCode"].ToString();
                    dgAllAssetZoom.Rows[n].Cells["clDescription"].Value = rdReader["Description"].ToString();
                }
                oConn.Dispose();
                rdReader.Close();
            }
        }
开发者ID:anthonied,项目名称:LiquidPastel,代码行数:25,代码来源:AllAssetZoom.cs


示例11: cmdSaveOutWorkshop_Click

        private void cmdSaveOutWorkshop_Click(object sender, EventArgs e)
        {
            using (PsqlConnection oConn = new PsqlConnection(Solsage_Process_Management_System.Classes.Connect.sPastelConnStr))
            {
                oConn.Open();
                for (int i = 0; i < dgTakeOutWorkshop.Rows.Count; i++)
                {
                    if (dgTakeOutWorkshop.Rows[i].Cells["chkSelectOut"].Value == chkSelectOut.TrueValue)
                    {

                        string sSql = "Update Inventory Set ";
                        sSql += "UserDefText01 = '',";
                        sSql += "UserDefText03 = '',";
                        sSql += "UserDefText02 = '' ";
                        sSql += "where ItemCode = '" + this.dgTakeOutWorkshop.Rows[i].Cells[0].Value + "'";

                        int iReturn = Solsage_Process_Management_System.Classes.Connect.getDataCommand(sSql, oConn).ExecuteNonQuery();
                        if (iReturn <= 0)
                        {
                            MessageBox.Show("An error occured with the movement of item " + this.dgTakeOutWorkshop.Rows[i].Cells[0].Value + " to the workshop");

                        }

                    }
                }

                cmdSaveOutWorkshop.Enabled = false;
                oConn.Dispose();
            }
            dgPutInWorkshop.Rows.Clear();
            currentlyOutWorkshopGridLoad();

            dgTakeOutWorkshop.Rows.Clear();
            currentlyInWorkshopGridLoad();
        }
开发者ID:anthonied,项目名称:LiquidPastel,代码行数:35,代码来源:AssetToWorkshop.cs


示例12: Connect

 public void Connect(string dsn, string host)
 {
     Console.Error.Write("Connecting to {0}...", host);
     DBConn = new PsqlConnection(string.Format("Server DSN={0}; Host={1}", dsn, host));
     DBConn.Open();
     Console.Error.WriteLine("connected");
 }
开发者ID:glenn-hill,项目名称:pervasivecl,代码行数:7,代码来源:engine.cs


示例13: LoadAccountDetails

        private void LoadAccountDetails()
        {
            Cursor = System.Windows.Forms.Cursors.WaitCursor;
            dgAccountDetails.Rows.Clear();

            using (PsqlConnection oConn = new PsqlConnection(Solsage_Process_Management_System.Classes.Connect.sConnStr))
            {
                oConn.Open();
                String sSql = "Select Category, CommissionType, InvoiceValue, CustomerCode, DocumentNumber From SOLMARKTRANS where MarketerCode = '" + txtMarketer.Text.Trim() + "' order by CustomerCode";
                PsqlDataReader rdReader = Solsage_Process_Management_System.Classes.Connect.getDataCommand(sSql, oConn).ExecuteReader();
                while (rdReader.Read())
                {
                    int n = dgAccountDetails.Rows.Add();
                    dgAccountDetails.Rows[n].Cells["clCustomerCode"].Value = rdReader[3].ToString();
                    dgAccountDetails.Rows[n].Cells["clDocumentNumber"].Value = rdReader[4].ToString();
                    dgAccountDetails.Rows[n].Cells["clCategory"].Value = rdReader[0].ToString();
                    dgAccountDetails.Rows[n].Cells["clCommissionType"].Value = rdReader[1].ToString();
                    dgAccountDetails.Rows[n].Cells["clInvoiceValue"].Value = rdReader[2].ToString();
                    dgAccountDetails.Rows[n].Cells["clCommissionAmount"].Value = Classes.Functions.CalculateCommission(rdReader[1].ToString(), rdReader[0].ToString(), Convert.ToDecimal(rdReader[2].ToString())).ToString("N2");

                }
                rdReader.Dispose();
                oConn.Dispose();
            }
            AddTotals();
            Cursor = System.Windows.Forms.Cursors.Default;
        }
开发者ID:anthonied,项目名称:LiquidPastel,代码行数:27,代码来源:MarketingAccountDetails.cs


示例14: cmdDeleteKit_Click

        private void cmdDeleteKit_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("This will permanently delete the current selected Kit Items. Are you sure?", "Delete Kit Items", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
            {
                using (PsqlConnection oConn = new PsqlConnection(Solsage_Process_Management_System.Classes.Connect.sConnStr))
                {
                    oConn.Open();
                    foreach (DataGridViewRow dgRow in dgKitMain.Rows)
                    {
                        // Main Kit code
                        if (dgRow.Cells[0].Value != null)
                        {
                            string sDelSql = "delete From SOLKIT where KitName = '" + txtKitName.Text.Trim() + "'";
                            int delRet = Solsage_Process_Management_System.Classes.Connect.getDataCommand(sDelSql, oConn).ExecuteNonQuery();

                            //Kit Details
                            string sDelSql2 = "delete From SOLKITDET where FkMainItemCode = '" + dgRow.Cells["clMainItemCode"].Value.ToString() + "'";
                            int delRet2 = Solsage_Process_Management_System.Classes.Connect.getDataCommand(sDelSql2, oConn).ExecuteNonQuery();
                        }
                    }
                    oConn.Dispose();
                }
                dgKitDetails.Rows.Clear();
                dgKitMain.Rows.Clear();
                txtKitName.Text = "";
            }
            dgKitDetails.Rows.Add();
            dgKitMain.Rows.Add();
        }
开发者ID:anthonied,项目名称:LiquidPastel,代码行数:29,代码来源:KitItemSetup.cs


示例15: LoadData

        private void LoadData()
        {
            using (PsqlConnection oConn = new PsqlConnection(Connect.sConnStr))
            {
                string sSql = "SELECT * FROM SOLTS";

                PsqlDataReader rdReader = Connect.getDataCommand(sSql, oConn).ExecuteReader();
                if (rdReader.HasRows)
                {
                    while (rdReader.Read())
                    {
                        int i = dgvSetup.Rows.Add();

                        dgvSetup.Rows[i].Cells["Customer_Ref"].Value = rdReader["Customer_Ref"].ToString();

                        dgvSetup.Rows[i].Cells["IP_Destination"].Value = rdReader["IP_Destination"].ToString();
                        dgvSetup.Rows[i].Cells["clAlias"].Value = rdReader["Receiver_Alias"].ToString();
                        dgvSetup.Rows[i].Cells["Supplier_Ref"].Value = rdReader["Supplier_Ref"].ToString();
                        dgvSetup.Rows[i].Cells["Data_Path"].Value = rdReader["sData_Path"].ToString();
                        dgvSetup.Rows[i].Cells["SOLPMS_ConnString"].Value = rdReader["SOLPMS_ConnString"].ToString();

                    }
                }

                rdReader.Close();
            }
        }
开发者ID:anthonied,项目名称:LiquidPastel,代码行数:27,代码来源:frmTransferSetup.cs


示例16: DBFetchSIRange

        private string DBFetchSIRange()
        {
            string sSql = "";
            string sSIRange = "(";

            using (PsqlConnection liqConn = new PsqlConnection(Connect.sConnStr))
            {
                liqConn.Open();

                sSql = "SELECT DocNumber FROM SOLSIL";
                sSql += " WHERE BatchNumber LIKE '%" + txtInclBatch.Text + "%'";

                PsqlDataReader rdReader = Connect.getDataCommand(sSql, liqConn).ExecuteReader();

                if (rdReader.HasRows)
                {
                    while (rdReader.Read())
                    {
                        sSIRange += "'" + rdReader["DocNumber"].ToString().Trim() + "',";
                    }

                    rdReader.Close();
                }

                liqConn.Close();
            }

            sSIRange = sSIRange.Substring(0, sSIRange.Length - 1);
            sSIRange += ")";

            return sSIRange;
        }
开发者ID:anthonied,项目名称:LiquidPastel,代码行数:32,代码来源:StockIssueZoom.cs


示例17: loadUserGrid

        private void loadUserGrid()
        {
            dgUserZoom.Rows.Clear();
            PsqlConnection oConn = new PsqlConnection(Solsage_Process_Management_System.Classes.Connect.sConnStr);
            oConn.Open();

            string sSql = "Select * from SOLUS order by UserName";

            PsqlDataReader rdReader = Solsage_Process_Management_System.Classes.Connect.getDataCommand(sSql, oConn).ExecuteReader();

            while (rdReader.Read())
            {
                int n = dgUserZoom.Rows.Add();
                dgUserZoom.Rows[n].Cells["clUserCode"].Value = rdReader["Code"].ToString();
                dgUserZoom.Rows[n].Cells["clDescription"].Value = rdReader["Description"].ToString();
                dgUserZoom.Rows[n].Cells["UserName"].Value = rdReader["UserName"].ToString();
                if (rdReader["UserType"].ToString() == "0")
                    dgUserZoom.Rows[n].Cells["UserType"].Value = "Front Desk";
                if (rdReader["UserType"].ToString() == "1")
                    dgUserZoom.Rows[n].Cells["UserType"].Value = "Administrator";
                if (rdReader["UserType"].ToString() == "2")
                    dgUserZoom.Rows[n].Cells["UserType"].Value = "Asset Maintenance";
                dgUserZoom.Rows[n].Cells["Password"].Value = rdReader["Psswrd"].ToString();
                dgUserZoom.Rows[n].Cells["clCreditInvoice"].Value = rdReader["CreditInvoice"].ToString();
                dgUserZoom.Rows[n].Cells["clCancelReturn"].Value = rdReader["CancelReturnItem"].ToString();
                dgUserZoom.Rows[n].Cells["clCloseOrder"].Value = rdReader["CloseOrder"].ToString();
                dgUserZoom.Rows[n].Cells["clShortName"].Value = rdReader["ShortName"].ToString();
                dgUserZoom.Rows[n].Cells["clTelephoneNumber"].Value = rdReader["TelephoneNumber"].ToString();
                dgUserZoom.Rows[n].Cells["clLockOrder"].Value = rdReader["LockOrder"].ToString();
                dgUserZoom.Rows[n].Cells["clReturnItem"].Value = rdReader["ReturnItem"].ToString();
            }
            rdReader.Close();
            oConn.Dispose();
            dgUserZoom.Focus();
        }
开发者ID:anthonied,项目名称:LiquidPastel,代码行数:35,代码来源:UserZoom.cs


示例18: cmdlogin_Click

        private void cmdlogin_Click(object sender, EventArgs e)
        {
            bool bMatch = false;
            string sUserName = "";
            string sUserCode = "";
            string sUserType = "";

            if (txtUserName.Text == "")
            {
                MessageBox.Show("Please supply username field");
                return;
            }
            using (PsqlConnection oConn = new PsqlConnection(Solsage_Process_Management_System.Classes.Connect.sConnStr))
            {
                oConn.Open();
                string sSql = "Select UserName,Psswrd,Code,UserType, CreditInvoice from SOLUS where UserName = '" + txtUserName.Text + "'";
                PsqlDataReader rdReader = Solsage_Process_Management_System.Classes.Connect.getDataCommand(sSql, oConn).ExecuteReader();
                while (rdReader.Read())
                {
                    if (txtPassword.Text == rdReader["Psswrd"].ToString().Trim())
                    {
                        bMatch = true;
                        sUserName = rdReader["UserName"].ToString().Trim();
                        sUserCode = rdReader["Code"].ToString().Trim();
                        sUserType = rdReader["UserType"].ToString().Trim();
                        Global.iCreditInvoice = Convert.ToInt32(rdReader["CreditInvoice"]);
                    }
                }

                rdReader.Close();
                oConn.Dispose();
            }

            if (bMatch == true)
            {

                this.Visible = false;
                Cursor = System.Windows.Forms.Cursors.WaitCursor;
                Main frmMain = new Solsage_Process_Management_System.Main();

                Global.sLogedInUserName = sUserName;
                Global.sLogedInUserCode = sUserCode;
                Global.sLogedInUserType = sUserType;
                Global.frmLogin = this;

                Global.bUseBackground = chkUseBackground.Checked;

                Global.frmMain = frmMain;
                frmMain.Show();

                Cursor = System.Windows.Forms.Cursors.Default;
            }
            else
            {
                MessageBox.Show("Login Failed");
                cmdClearFields();
            }
        }
开发者ID:anthonied,项目名称:LiquidPastel,代码行数:58,代码来源:Login.cs


示例19: getDataSet

        public static DataSet getDataSet(string sSQL, string sTable, PsqlConnection conn)
        {
            DataSet ds = new DataSet();

            // create a data adapter
            PsqlDataAdapter da = new PsqlDataAdapter(sSQL, conn);

            da.Fill(ds, sTable);
            return (ds);
        }
开发者ID:anthonied,项目名称:tcrm,代码行数:10,代码来源:Connect.cs


示例20: LoadErrorInfo

        public void LoadErrorInfo()
        {
            using (PsqlConnection oConn = new PsqlConnection(Connect.sConnStr))
            {
                int iDgvRowCount = 0;
                int iErrorCounter = 1;
                string sSql = "SELECT * FROM SOLTERR ORDER BY dtTimeFailed DESC ";

                PsqlDataReader rdReader = Connect.getDataCommand(sSql, oConn).ExecuteReader();

                if (rdReader.HasRows)
                {
                    btnMarkAsHandled.Enabled = true;
                    while (rdReader.Read())
                    {
                        iDgvRowCount = dgvTransferErrors.Rows.Add();

                        dgvTransferErrors.Rows[iDgvRowCount].Cells["clErrorID"].Value = rdReader["sTransferErrorID"].ToString().Trim();
                        dgvTransferErrors.Rows[iDgvRowCount].Cells["clSourceDocNum"].Value = rdReader["sDocNum"].ToString().Trim();
                        dgvTransferErrors.Rows[iDgvRowCount].Cells["clReceiverIP"].Value = rdReader["sTransToIP"].ToString().Trim();
                        dgvTransferErrors.Rows[iDgvRowCount].Cells["clReceiverDatapath"].Value = rdReader["sTransToDataPath"].ToString().Trim();
                        dgvTransferErrors.Rows[iDgvRowCount].Cells["clDateTimeFailed"].Value = rdReader["dtTimeFailed"];
                        dgvTransferErrors.Rows[iDgvRowCount].Cells["clUserCode"].Value = rdReader["sUserCode"].ToString().Trim();
                        dgvTransferErrors.Rows[iDgvRowCount].Cells["clUserName"].Value = rdReader["sUserName"].ToString().Trim();
                        dgvTransferErrors.Rows[iDgvRowCount].Cells["clErrorString"].Value = rdReader["sErrorInfo"].ToString().Trim();

                        if (rdReader["iHandled"].ToString().Trim() == "1")
                            dgvTransferErrors.Rows[iDgvRowCount].DefaultCellStyle.BackColor = Color.Blue;
                        else
                            dgvTransferErrors.Rows[iDgvRowCount].DefaultCellStyle.BackColor = Color.White;

                        if (!bActive)
                        {
                            if(rdReader["sDocNum"].ToString().Trim() == sActiveError)
                            {
                                dgvTransferErrors.Rows[iDgvRowCount].Selected = true;
                                iErrorCounter = iDgvRowCount;
                                bActive = true;
                            }
                        }
                    }

                    if (iErrorCounter != 1)
                    {
                        dgvTransferErrors.Rows[iErrorCounter].Selected = true;
                    }

                    SetDetailedInformation();
                }

                rdReader.Close();

            }
        }
开发者ID:anthonied,项目名称:LiquidPastel,代码行数:54,代码来源:frmTransferErrors.cs



注:本文中的PsqlConnection类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Ptr类代码示例发布时间:2022-05-24
下一篇:
C# ProxyTypes类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap