當前位置: 首頁>>代碼示例>>C#>>正文


C# Data.DataColumnChangeEventArgs類代碼示例

本文整理匯總了C#中System.Data.DataColumnChangeEventArgs的典型用法代碼示例。如果您正苦於以下問題:C# DataColumnChangeEventArgs類的具體用法?C# DataColumnChangeEventArgs怎麽用?C# DataColumnChangeEventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DataColumnChangeEventArgs類屬於System.Data命名空間,在下文中一共展示了DataColumnChangeEventArgs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ValidateColumn

        void ValidateColumn(object sender, DataColumnChangeEventArgs e)
        {
            if (e.Column.Equals(this.patientidColumn))
            {
                if (Convert.IsDBNull(e.ProposedValue) || ((int)e.ProposedValue < 0))
                {
                    throw new ArgumentException(string.Format("{0} kan inte vara null eller negativt.", e.Column.ColumnName), e.Column.ColumnName);
                }
            }

            if (e.Column.Equals(this.startdatetimeColumn))
            {
                if (Convert.IsDBNull(e.ProposedValue) || (((DateTime)e.ProposedValue).Year == DateTime.MinValue.Year) || (((DateTime)e.ProposedValue).Year == DateTime.MaxValue.Year))
                {
                    throw new ArgumentException(string.Format("{0} är inte ett giltigt datum.", e.Column.ColumnName), "frikortsdatum");
                }
            }

            if (e.Column.Equals(this.titleColumn))
            {
                if (Convert.IsDBNull(e.ProposedValue) || ((string)e.ProposedValue).Length == 0)
                {
                    throw new ArgumentException(string.Format("{0} kan inte vara null eller tom.", e.Column.ColumnName), e.Column.ColumnName);
                }
            }
        }
開發者ID:andersruberg,項目名稱:RehabWeb,代碼行數:26,代碼來源:Rehab.BookingsDataTable.cs

示例2: custTable_ColumnChanging

		private void custTable_ColumnChanging(object sender, DataColumnChangeEventArgs e)
		{
			if (e.Column.ColumnName.ToUpper() == "MIN" && e.ProposedValue is int && (int)e.ProposedValue < 0)
			{
				throw new ApplicationException("Min must be >= 0");
			}
		}
開發者ID:wsrf2009,項目名稱:KnxUiEditor,代碼行數:7,代碼來源:TestDataSetPerformance.cs

示例3: VerifyUnitData

        /// <summary>
        /// todoComment
        /// </summary>
        /// <param name="e"></param>
        /// <param name="AMainDS"></param>
        /// <param name="AVerificationResult"></param>
        /// <returns></returns>
        public static Boolean VerifyUnitData(DataColumnChangeEventArgs e, PartnerEditTDS AMainDS, out TVerificationResult AVerificationResult)
        {
            Boolean ReturnValue;

            AVerificationResult = null;

            if (e.Column.ColumnName == PUnitTable.GetUnitNameDBName())
            {
                VerifyUnitNameChange(e, AMainDS, out AVerificationResult);
            }

            // any verification errors?
            if (AVerificationResult == null)
            {
                ReturnValue = true;
            }
            else
            {
                ReturnValue = false;

                // MessageBox.Show('VerifyUnitData: There was an error!');
            }

            return ReturnValue;
        }
開發者ID:Davincier,項目名稱:openpetra,代碼行數:32,代碼來源:UC_PartnerEdit_CollapsiblePart.cs

示例4: OnColumnChanging

 protected override void OnColumnChanging(DataColumnChangeEventArgs e)
 {
     if (mCanWrite)
     {
         (e.Row as DataRowEx).OnRowChanged();
     }
     base.OnColumnChanging(e);
 }
開發者ID:viticm,項目名稱:pap2,代碼行數:8,代碼來源:DataTableEx.cs

示例5: OnColumnChanging

 protected override void OnColumnChanging(DataColumnChangeEventArgs e)
 {
     if (e.Column.ColumnName == "Age")
     {
         if ((int)e.ProposedValue < 0 || (int)e.ProposedValue > 100)
         {
             e.Row.SetColumnError("Age", "나이는 0 ~ 100 사이여야 합니다.");
         }
         else
         {
             e.Row.SetColumnError("Age", "");
         }
     }
 }
開發者ID:gawallsibya,項目名稱:BIT_MFC-CShap-DotNet,代碼行數:14,代碼來源:ADOTestDataSet.cs

示例6: tblPeople_ColumnChanging

 //* 컬럼 에러 설정
 void tblPeople_ColumnChanging(object sender, DataColumnChangeEventArgs e)
 {
     if (e.Column.ColumnName == "Age")
     {
         if ((int)e.ProposedValue < 0 || (int)e.ProposedValue > 100)
         {
             e.Row.SetColumnError("Age", "나이는 0 ~ 100 사이여야 합니다.");
         }
         else
         {
             e.Row.SetColumnError("Age", "");
         }
     }
 }
開發者ID:gawallsibya,項目名稱:BIT_MFC-CShap-DotNet,代碼行數:15,代碼來源:Form1.cs

示例7: VerifySubscriptionData

        /// <summary>
        /// todoComment
        /// </summary>
        /// <param name="e"></param>
        /// <param name="AVerificationResultCollection"></param>
        /// <param name="AVerificationResult"></param>
        /// <param name="FDataColumnComparedTo"></param>
        /// <returns></returns>
        public static Boolean VerifySubscriptionData(DataColumnChangeEventArgs e,
            TVerificationResultCollection AVerificationResultCollection,
            out TVerificationResult AVerificationResult,
            out DataColumn FDataColumnComparedTo)
        {
            Boolean ReturnValue;

            AVerificationResult = null;
            DataColumn FDataColumnComparedTo2 = null;

            if ((e.Column.ColumnName == PSubscriptionTable.GetDateCancelledDBName())
                || (e.Column.ColumnName == PSubscriptionTable.GetExpiryDateDBName())
                || (e.Column.ColumnName == PSubscriptionTable.GetDateNoticeSentDBName())
                || (e.Column.ColumnName == PSubscriptionTable.GetStartDateDBName())
                || (e.Column.ColumnName == PSubscriptionTable.GetSubscriptionRenewalDateDBName())
                || (e.Column.ColumnName == PSubscriptionTable.GetFirstIssueDBName()) || (e.Column.ColumnName == PSubscriptionTable.GetLastIssueDBName()))
            {
                VerifySubscriptionDates(e, AVerificationResultCollection, out AVerificationResult, out FDataColumnComparedTo2);
            }

            FDataColumnComparedTo = FDataColumnComparedTo2;

            // if (e.Column.Ordinal = (e.Column.Table as PPartnerLocationTable).ColumnEmailAddress.Ordinal) then
            // begin
            // VerifyEMailAddress(e, AVerificationResult);
            // end;
            if ((e.Column.ColumnName == PSubscriptionTable.GetPublicationCopiesDBName())
                || (e.Column.ColumnName == PSubscriptionTable.GetNumberIssuesReceivedDBName())
                || (e.Column.ColumnName == PSubscriptionTable.GetNumberComplimentaryDBName()))
            {
                VerifyInteger(e, out AVerificationResult);
            }

            // any verification errors?
            if (AVerificationResult == null)
            {
                ReturnValue = true;
            }
            else
            {
                ReturnValue = false;
            }

            return ReturnValue;
        }
開發者ID:Davincier,項目名稱:openpetra,代碼行數:53,代碼來源:UC_PartnerSubscription.cs

示例8: BranchTable_ColumnChanged

 static void BranchTable_ColumnChanged(object sender, DataColumnChangeEventArgs e)
 {
     if (e.Column.ColumnName == "Push" && (bool)e.ProposedValue)
     {
         e.Row["Force"] = false;
         e.Row["Delete"] = false;
     }
     if (e.Column.ColumnName == "Force" && (bool)e.ProposedValue)
     {
         e.Row["Push"] = false;
         e.Row["Delete"] = false;
     }
     if (e.Column.ColumnName == "Delete" && (bool)e.ProposedValue)
     {
         e.Row["Push"] = false;
         e.Row["Force"] = false;
     }
 }
開發者ID:adrianoc,項目名稱:gitextensions,代碼行數:18,代碼來源:FormPush.cs

示例9: ValidateColumn

 void ValidateColumn(object sender, DataColumnChangeEventArgs e)
 {
     if(e.Column.Equals(this.UnitPriceColumn))
     {
        if(!Convert.IsDBNull(e.ProposedValue) && (decimal)e.ProposedValue < 0)
        {
           throw new ArgumentException("UnitPrice cannot be less than zero", "UnitPrice");
        }
     }
     else if (e.Column.Equals(this.UnitsInStockColumn) ||
             e.Column.Equals(this.UnitsOnOrderColumn) ||
             e.Column.Equals(this.ReorderLevelColumn))
     {
         if (!Convert.IsDBNull(e.ProposedValue) && (short)e.ProposedValue < 0)
         {
             throw new ArgumentException(string.Format("{0} cannot be less than zero", e.Column.ColumnName), e.Column.ColumnName);
         }
     }
 }
開發者ID:kjeans,項目名稱:online-shop,代碼行數:19,代碼來源:ProductsDataTable.ColumnChanging.cs

示例10: ReceiptDetailColumn_Changing

        private void ReceiptDetailColumn_Changing(object sender, DataColumnChangeEventArgs e)
        {
            if (e.Column == mDataSet.ReceiptDetail.PricePurchaseColumn)
            {
            //  MessageBox.Show(e.ProposedValue.ToString());
            }
           
            if (e.Column == mDataSet.ReceiptDetail.QuantityColumn)
            {
                MDataSet.RemainsRow remainsRow = (e.Row as MDataSet.ReceiptDetailRow).RemainsRow;

                    if (((e.Row as MDataSet.ReceiptDetailRow).Quantity - remainsRow.QuantityRemains) > ((decimal)e.ProposedValue))
                    {
                        MessageBox.Show("Товара уже продано больше!");

                        e.ProposedValue = (e.Row as MDataSet.ReceiptDetailRow).Quantity;
                    }
                    else
                        remainsRow.QuantityRemains += (decimal)e.ProposedValue - (e.Row as MDataSet.ReceiptDetailRow).Quantity;
            }
        }
開發者ID:vpjulia,項目名稱:Salvia,代碼行數:21,代碼來源:MainForm.Data.cs

示例11: VerifyPartnerLocationData

        /// <summary>
        /// todoComment
        /// </summary>
        /// <param name="e"></param>
        /// <param name="AVerificationResultCollection"></param>
        /// <param name="AVerificationResult"></param>
        /// <returns></returns>
        public static Boolean VerifyPartnerLocationData(DataColumnChangeEventArgs e,
            TVerificationResultCollection AVerificationResultCollection,
            out TVerificationResult AVerificationResult)
        {
            Boolean ReturnValue;

            AVerificationResult = null;

            // MessageBox.Show('Verifying DataRow...');
            if ((e.Column.ColumnName == PPartnerLocationTable.GetDateEffectiveDBName())
                || (e.Column.ColumnName == PPartnerLocationTable.GetDateGoodUntilDBName()))
            {
                VerifyDates(e, AVerificationResultCollection, out AVerificationResult);
            }

            if (e.Column.Ordinal == ((PPartnerLocationTable)e.Column.Table).ColumnEmailAddress.Ordinal)
            {
                VerifyEmailAddress(e, out AVerificationResult);
            }

            if (e.Column.Ordinal == ((PPartnerLocationTable)e.Column.Table).ColumnLocationType.Ordinal)
            {
                VerifyLocationType(e, out AVerificationResult);
            }

            // any verification errors?
            if (AVerificationResult == null)
            {
                ReturnValue = true;
            }
            else
            {
                ReturnValue = false;

                // MessageBox.Show('VerifyPartnerLocationData: There was an error!');
            }

            return ReturnValue;
        }
開發者ID:Davincier,項目名稱:openpetra,代碼行數:46,代碼來源:UC_PartnerAddress.cs

示例12: ValidateColumn

        void ValidateColumn(object sender, DataColumnChangeEventArgs e)
        {
            if (e.Column.Equals(this.personnumberColumn))
            {
                if (Convert.IsDBNull(e.ProposedValue) || ((string)e.ProposedValue).Length == 0)
                {
                    throw new ArgumentException(string.Format("{0} kan inte vara null eller tom.", e.Column.ColumnName), "personnumret");
                }
            }

            if (e.Column.Equals(this.freecarddateColumn))
            {
                if (!Convert.IsDBNull(e.ProposedValue))
                {
                    if (((DateTime.Parse((string)e.ProposedValue)).Year == DateTime.MinValue.Year) || ((DateTime.Parse((string)e.ProposedValue)).Year == DateTime.MaxValue.Year))
                    {
                        throw new ArgumentException(string.Format("{0} är inte ett giltigt datum.", e.Column.ColumnName), e.Column.ColumnName);
                    }
                }
            }

            if (e.Column.Equals(this.surnameColumn))
            {
                if (Convert.IsDBNull(e.ProposedValue) || ((string)e.ProposedValue).Length == 0)
                {
                    throw new ArgumentException(string.Format("{0} kan inte vara null eller tom.", e.Column.ColumnName), "efternamnet");
                }
            }

            if (e.Column.Equals(this.firstnameColumn))
            {
                if (Convert.IsDBNull(e.ProposedValue) || ((string)e.ProposedValue).Length == 0)
                {
                    throw new ArgumentException(string.Format("{0} kan inte vara null eller tom.", e.Column.ColumnName), "efternamnet");
                }
            }
        }
開發者ID:andersruberg,項目名稱:RehabWeb,代碼行數:37,代碼來源:Rehab.PatientsDataTable.cs

示例13: myReceiptMasterTable_ColumnChanged

        private void myReceiptMasterTable_ColumnChanged(object sender, DataColumnChangeEventArgs e)
        {
            if (IsColumnChangedDisable())
                return;

            if (System.String.Compare(e.Column.ColumnName, "strDiscountCode", true) == 0 ||
                System.String.Compare(e.Column.ColumnName, "DiscountAmt", true) == 0 ||
                System.String.Compare(e.Column.ColumnName, "mVoucherAmount", true) == 0 ||
                System.String.Compare(e.Column.ColumnName, "mNettAmount", true) == 0 ||
                System.String.Compare(e.Column.ColumnName, "mGSTAmount", true) == 0)
            {
                DisableColumnChanged();

                try
                {
                    RecalculateAll();
                }
                finally
                {
                    EnableColumnChanged();
                }
            }
            else if (System.String.Compare(e.Column.ColumnName, "nSalesPersonID", true) == 0)
            {
                DisableColumnChanged();

                try
                {
                    TblEmployee employee = new TblEmployee();
                    employee.NEmployeeID = ACMS.Convert.ToInt32(myReceiptMasterTable.Rows[0]["nSalesPersonID"]);
                    employee.SelectOne();
                    if (employee.StrEmployeeName.IsNull)
                        e.Row["strSalesPersonName"] = DBNull.Value;
                    else
                        e.Row["strSalesPersonName"] = employee.StrEmployeeName.Value;
                }
                finally
                {
                    EnableColumnChanged();
                }
            }
            else if (System.String.Compare(e.Column.ColumnName, "nTherapistID", true) == 0)
            {
                DisableColumnChanged();

                try
                {
                    TblEmployee employee = new TblEmployee();
                    employee.NEmployeeID = ACMS.Convert.ToInt32(myReceiptMasterTable.Rows[0]["nTherapistID"]);
                    employee.SelectOne();
                    if (employee.StrEmployeeName.IsNull)
                        e.Row["strTherapistName"] = DBNull.Value;
                    else
                        e.Row["strTherapistName"] = employee.StrEmployeeName.Value;
                }
                finally
                {
                    EnableColumnChanged();
                }
            }
            else if (System.String.Compare(e.Column.ColumnName, "strReceiptNo", true) == 0)
            {
                ChangeReceipNo();
            }
        }
開發者ID:kimykunjun,項目名稱:test,代碼行數:65,代碼來源:POS.cs

示例14: myReceiptItemsTable_ColumnChanged

        private void myReceiptItemsTable_ColumnChanged(object sender, DataColumnChangeEventArgs e)
        {
            if (IsColumnChangedDisable())
                return;

            connectionString = (string)ConfigurationSettings.AppSettings["Main.ConnectionString"];
            connection = new SqlConnection(connectionString);
            if (System.String.Compare(e.Column.ColumnName, "strDiscountCode", true) == 0 ||
                System.String.Compare(e.Column.ColumnName, "mUnitPrice", true) == 0 ||
                System.String.Compare(e.Column.ColumnName, "nQuantity", true) == 0 ||
                System.String.Compare(e.Column.ColumnName, "DiscountAmt", true) == 0 )
            {
                DisableColumnChanged();
                //BeginGridUpdate();

                try
                {
                    if (myCategoryID != 11 && myCategoryID != 12)
                    {
                        if (ACMS.Convert.ToInt32(e.Row["nQuantity"]) < 0)
                        {
                            e.Row["nQuantity"] = 0;
                        }
                    }
                    else
                    {
                        string strSQL = "SELECT nQty from tblSCStockRecon where strProductCode='" + e.Row["strCode"] + "' AND strBranchCode='" + myBranchCode + "' ";
                        DataSet _ds = new DataSet();
                        SqlHelper.FillDataset(connection, CommandType.StoredProcedure, "UP_GETDATA", _ds, new string[] { "table" }, new SqlParameter("@strSQL", strSQL));
                        if (_ds.Tables["table"].Rows.Count > 0 && e.Row["nQuantity"].ToString() != "")
                        {
                            if (Convert.ToInt16(e.Row["nQuantity"]) > Convert.ToInt16(_ds.Tables["table"].Rows[0]["nQty"]))
                            {
                                MessageBox.Show("Quantity entered greater than stock quantity ( " + _ds.Tables["table"].Rows[0]["nQty"].ToString() + " )", "Warning", MessageBoxButtons.OK);
                                e.Row["nQuantity"] = Convert.ToInt16(_ds.Tables["table"].Rows[0]["nQty"]);
                                return;
                            }
                        }
                        _ds.Dispose();
                    }

                    CalculateSubTotal(e.Row);
                    RecalculateAll();
                }
                finally
                {
                    //EndGridUpdate();
                    EnableColumnChanged();
                }

            }

            else if (System.String.Compare(e.Column.ColumnName, "StrReferenceNo", true) == 0)
            {
                StrReferenceNo = e.Row["StrReferenceNo"].ToString();
            }
        }
開發者ID:kimykunjun,項目名稱:test,代碼行數:57,代碼來源:POS.cs

示例15: m_dtShiftSetting_ColumnChanged

 private void m_dtShiftSetting_ColumnChanged(object sender, DataColumnChangeEventArgs e)
 {
     DirtyData = true;
 }
開發者ID:puentepr,項目名稱:thuctapvietinsoft,代碼行數:4,代碼來源:ShiftSetting.cs


注:本文中的System.Data.DataColumnChangeEventArgs類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。