Пример #1
0
        private void toolStripDelete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (BsfGlobal.FindPermission("Vendor-Grade-Master-Delete") == false)
            {
                MessageBox.Show("No Rights to Vendor-Grade-Master-Delete");
                return;
            }

            if (TransView.FocusedRowHandle >= 0)
            {
                if (TransView.IsNewItemRow(TransView.FocusedRowHandle) == true)
                {
                    return;
                }
                if (TransView.FocusedRowHandle != TransView.RowCount - 2)
                {
                    return;
                }

                DialogResult reply = MessageBox.Show("Do you want Delete?", "Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                if (reply == DialogResult.Yes)
                {
                    int Id = 0;
                    Id = Convert.ToInt32(TransView.GetRowCellValue(TransView.FocusedRowHandle, "GradeId"));
                    m_oGrade.DeleteGrade(Id);
                    //grdTrans.Rows.RemoveAt(grdTrans.CurrentRow.Index);
                    TransView.DeleteRow(TransView.FocusedRowHandle);
                }
            }
        }
Пример #2
0
        private void TransView_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
        {
            if (m_bAns == false)
            {
                return;
            }

            int rowhandleva = TransView.GetDataSourceRowIndex(TransView.FocusedRowHandle);

            m_oCountry.CountryName = cCName;
            if (TransView.IsNewItemRow(TransView.FocusedRowHandle) == true)
            {
                int cId;
                cId    = m_oCountry.InsertCountry(m_oCountry.CountryName);
                m_bAns = false;
                TransView.SetRowCellValue(TransView.FocusedRowHandle, "CountryId", cId);
                m_bAns = true;
            }
            else
            {
                m_oCountry.CountryId = Convert.ToInt32(TransView.GetRowCellValue(TransView.FocusedRowHandle, "CountryId"));
                m_oCountry.UpdateCountry(m_oCountry.CountryId, m_oCountry.CountryName);
            }
            m_bEdit = false;
        }
Пример #3
0
        private void toolStripDelete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (TransView.RowCount > 0)
            {
                if (TransView.FocusedRowHandle >= 0)
                {
                    if (TransView.GetRowCellValue(TransView.FocusedRowHandle, "Status").ToString() == "Register")
                    {
                        MessageBox.Show("Registration Not Delete");
                        return;
                    }

                    int Id        = Convert.ToInt32(TransView.GetRowCellValue(TransView.FocusedRowHandle, "RegTransID"));
                    int lVendorId = Convert.ToInt32(TransView.GetRowCellValue(TransView.FocusedRowHandle, "VendorId"));
                    if (Id != m_oRegister.GetMaxRegTransId(lVendorId))
                    {
                        MessageBox.Show("Do Not Delete!");
                        return;
                    }
                    DialogResult reply = MessageBox.Show("Do you want Delete?", "Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (reply == DialogResult.Yes)
                    {
                        m_oRegister.DeleteRegTrans(Id);
                        TransView.DeleteRow(TransView.FocusedRowHandle);
                        //grdTrans.Rows.RemoveAt(grdTrans.CurrentRow.Index);
                        m_oRegUpdate.UpdateRegistration(lVendorId);
                    }
                }
            }
        }
Пример #4
0
 private void toolStripDelete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     try
     {
         m_lFeatureId = Convert.ToInt32(CommFun.IsNullCheck(TransView.GetRowCellValue(TransView.FocusedRowHandle, "FeatureId"), CommFun.datatypes.vartypenumeric));
         DialogResult reply = MessageBox.Show("Do you want Delete?", "Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
         if (reply == DialogResult.Yes)
         {
             if (m_lFBL.CheckUsed(m_lFeatureId) == false)
             {
                 m_lFBL.DeleteFeature(m_lFeatureId);
                 TransView.DeleteRow(TransView.FocusedRowHandle);
             }
             else
             {
                 MessageBox.Show("Do Not Delete ! Already Used?", "Information", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                 return;
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Пример #5
0
        private void toolStripEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            int           lStateId   = Convert.ToInt32(TransView.GetRowCellValue(TransView.FocusedRowHandle, "StateId"));
            frmStateEntry StateEntry = new frmStateEntry();

            if (StateEntry.Execute(lStateId) == true)
            {
                PopulateGrid();
            }
        }
Пример #6
0
 private void TransView_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
 {
     if (TransView.FocusedColumn.FieldName == "TValue")
     {
         int     rHandle   = TransView.GetDataSourceRowIndex(TransView.FocusedRowHandle);
         Decimal tValue    = Convert.ToDecimal(TransView.GetRowCellValue(rHandle - 1, "TValue"));
         Decimal tCurValue = Convert.ToDecimal(TransView.GetRowCellValue(TransView.FocusedRowHandle, "TValue"));
         if (tCurValue <= tValue)
         {
             DataRow dr = TransView.GetDataRow(TransView.FocusedRowHandle);
             dr["TValue"] = 0;
         }
     }
 }
Пример #7
0
        private void toolStripEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (BsfGlobal.FindPermission("Location-Edit") == false)
            {
                MessageBox.Show("No Rights to Location-Edit");
                return;
            }



            int          lCityID   = Convert.ToInt32(TransView.GetRowCellValue(TransView.FocusedRowHandle, "CityId"));
            frmCityEntry CityEntry = new frmCityEntry();

            if (CityEntry.Execute(lCityID, m_tCity) == true)
            {
                PopulateGrid();
            }
        }
Пример #8
0
 private void toolStripEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     if (TransView.RowCount > 0)
     {
         if (TransView.FocusedRowHandle >= 0)
         {
             if (TransView.GetRowCellValue(TransView.FocusedRowHandle, "Status").ToString() == "Register")
             {
                 MessageBox.Show("Registration Not Edit");
                 return;
             }
             int         lRegTransId = Convert.ToInt32(TransView.GetRowCellValue(TransView.FocusedRowHandle, "RegTransID"));
             int         lVendorId   = Convert.ToInt32(TransView.GetRowCellValue(TransView.FocusedRowHandle, "VendorId"));
             string      sVendorName = TransView.GetRowCellValue(TransView.FocusedRowHandle, "VendorName").ToString();
             string      sRegNo      = TransView.GetRowCellValue(TransView.FocusedRowHandle, "RegNo").ToString();
             frmRegTrans sts         = new frmRegTrans();
             sts.Execute(lRegTransId, lVendorId, sVendorName, sRegNo);
             PopulateGrid();
         }
     }
 }
Пример #9
0
        private void TransView_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
        {
            if (m_bAns == true)
            {
                return;
            }

            int rowhandleva = TransView.GetDataSourceRowIndex(TransView.FocusedRowHandle);

            if (TransView.IsNewItemRow(TransView.FocusedRowHandle) == true)
            {
                int iID = m_lFBL.InsertFDesc(m_lFDescription);
                m_bAns = true;
                TransView.SetRowCellValue(TransView.FocusedRowHandle, "FeatureId", iID);
                m_bAns = false;
            }

            else
            {
                m_lFeatureId = Convert.ToInt32(TransView.GetRowCellValue(TransView.FocusedRowHandle, "FeatureId"));
                m_lFBL.UpdateFDesc(m_lFeatureId, m_lFDescription);
            }
        }
Пример #10
0
        private void toolStripDelete_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (BsfGlobal.FindPermission("Vendor-Assessment-Master-Delete") == false)
            {
                MessageBox.Show("No Rights to Vendor-Assessment-Master-Delete");
                return;
            }



            if (TransView.FocusedRowHandle < 0)
            {
                return;
            }

            int Id = 0;

            if (TransView.GetRowCellValue(TransView.FocusedRowHandle, "CheckListId").ToString() == "")
            {
                TransView.DeleteRow(TransView.FocusedRowHandle);
                return;
            }
            Id = Convert.ToInt32(TransView.GetRowCellValue(TransView.FocusedRowHandle, "CheckListId"));
            if (m_oCheckList.CheckListFound(Id) == true)
            {
                MessageBox.Show("Already Used, Do Not Delete");
                return;
            }

            DialogResult reply = MessageBox.Show("Do you want Delete?", "Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (reply == DialogResult.Yes)
            {
                m_oCheckList.DeleteCheckList(Id);
                TransView.DeleteRow(TransView.FocusedRowHandle);
            }
        }
Пример #11
0
        private void TransView_InitNewRow(object sender, DevExpress.XtraGrid.Views.Grid.InitNewRowEventArgs e)
        {
            //if (TransView.FocusedRowHandle >= 0)
            //{
            if (TransView.RowCount <= 1)
            {
                //e.Row.Cells[2].Value = 0;
                TransView.SetRowCellValue(TransView.FocusedRowHandle, "FValue", 0);
            }
            else
            {
                //e.Row.Cells[2].Value = grdTrans.Rows[grdTrans.RowCount - 2].Cells[3].Value;
                TransView.SetRowCellValue(TransView.FocusedRowHandle, "FValue", Convert.ToInt32(TransView.GetRowCellValue(TransView.RowCount - 2, "TValue")));
            }
            //}
            //else
            //{
            //    //e.Row.Cells[2].Value = 0;
            //    TransView.SetRowCellValue(TransView.FocusedRowHandle, "FValue", 0);
            //}

            ////e.Row.Cells[3].Value = 0;
            //TransView.SetRowCellValue(TransView.FocusedRowHandle, "TValue", 0);
            //DataRow dr = m_tGrade.NewRow();
            //dr[0] = 0;
            //dr[1] = "";
            //dr[2] = 0;
            //dr[3] = 0;
            //m_tGrade.Rows.Add(dr);
        }
Пример #12
0
        private void grdTrans_EditorKeyPress(object sender, KeyPressEventArgs e)
        {
            base.OnKeyPress(e);

            if (TransView.FocusedColumn.FieldName == "GradeName")
            {
                if (TransView.IsNewItemRow(TransView.FocusedRowHandle) == true)
                {
                    if (TransView.RowCount != 1)
                    {
                        if (Convert.ToInt32(TransView.GetRowCellValue(TransView.RowCount - 2, "TValue")) == 0.0)
                        {
                            e.Handled = true;
                            return;
                        }
                    }
                }
            }


            if (TransView.FocusedColumn.FieldName == "FValue")
            {
                e.Handled = true;
                return;
            }

            if (TransView.FocusedColumn.FieldName == "TValue")
            {
                if (TransView.IsNewItemRow(TransView.FocusedRowHandle) != true)
                {
                    if (TransView.FocusedRowHandle != TransView.RowCount - 2)
                    {
                        e.Handled = true;
                        return;
                    }
                }
            }



            if (TransView.FocusedColumn.FieldName == "TValue")
            {
                if (!char.IsNumber(e.KeyChar))
                {
                    e.Handled = true;
                }
                else
                {
                    e.Handled = false;
                }
                if (e.KeyChar == 8)
                {
                    e.Handled = false;
                }
            }



            if (e.KeyChar == '.')
            {
                char[] c   = (((System.Windows.Forms.TextBoxBase)(sender))).Text.ToString().ToCharArray();
                int    cnt = 1;
                foreach (char b in c)
                {
                    if (b == '.')
                    {
                        cnt += 1;
                    }
                }
                if (cnt > 1)
                {
                    e.Handled = true;
                }
                else
                {
                    e.Handled = false;
                }
            }

            if (TransView.FocusedColumn.FieldName == "TValue")
            {
                if (TransView.IsNewItemRow(TransView.FocusedRowHandle) != true)
                {
                    if (TransView.FocusedRowHandle != TransView.RowCount - 2)
                    {
                        e.Handled = true;
                        return;
                    }
                }
            }
        }