예제 #1
0
        private void PopulateOC()
        {
            dtOC = new DataTable();

            try
            {
                dtOC = ProjectInfoBL.GetOtherCost(m_iCCId);

                grdOC.DataSource = dtOC;
                grdViewOC.Columns["OtherCostId"].Visible = false;
                grdViewOC.Columns["SysDefault"].Visible  = false;

                grdViewOC.Columns["Sel"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
                grdViewOC.BestFitColumns();

                grdViewOC.Columns["OtherCostName"].OptionsColumn.ReadOnly  = true;
                grdViewOC.Columns["OtherCostName"].OptionsColumn.AllowEdit = false;

                grdViewOC.OptionsSelection.InvertSelection = true;
                grdViewOC.OptionsSelection.EnableAppearanceHideSelection = false;
                grdViewOC.Appearance.FocusedRow.BackColor = Color.Teal;
                grdViewOC.Appearance.FocusedRow.ForeColor = Color.White;
            }
            catch (Exception e)
            {
                throw e;
            }
        }
예제 #2
0
        private void PopulateOC()
        {
            BsfGlobal.OpenCRMDB();
            dtOC = new DataTable();
            string stt  = "";
            string newS = "";

            try
            {
                stt = m_sOCId.TrimEnd(',');

                for (int i = 0; i < stt.Length; i++)
                {
                    newS += stt[i].ToString();
                }

                dtOC = ProjectInfoBL.SelectOtherCost(newS, iArea, CCId);

                grdOC.DataSource = dtOC;
                grdViewOC.Columns["OtherCostId"].Visible = false;
                grdViewOC.Columns["Amount"].Visible      = false;
                grdViewOC.Columns["Flag"].Visible        = false;
                grdViewOC.Columns["SysDefault"].Visible  = false;
                grdViewOC.Columns["Area"].Visible        = false;

                grdViewOC.Columns["Amount"].SummaryItem.SummaryType   = DevExpress.Data.SummaryItemType.Sum;
                grdViewOC.Columns["Amount"].SummaryItem.DisplayFormat = BsfGlobal.g_sDigitFormatS;

                grdViewOC.Columns["Sel"].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
                RepositoryItemCheckEdit chkSel = new RepositoryItemCheckEdit();
                chkSel.CheckedChanged += chkSel_CheckedChanged;
                grdViewOC.BestFitColumns();

                grdViewOC.Columns["OtherCostName"].OptionsColumn.ReadOnly  = true;
                grdViewOC.Columns["OtherCostName"].OptionsColumn.AllowEdit = false;

                RepositoryItemTextEdit txtAmount = new RepositoryItemTextEdit();
                grdViewOC.Columns["Amount"].ColumnEdit = txtAmount;
                txtAmount.Mask.EditMask = BsfGlobal.g_sDigitFormat;
                txtAmount.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric;
                txtAmount.Validating   += txtAmount_Validating;
                BsfGlobal.g_CRMDB.Close();

                grdViewOC.Appearance.HeaderPanel.Font      = new Font(grdViewOC.Appearance.HeaderPanel.Font, FontStyle.Bold);
                grdViewOC.Appearance.FocusedCell.BackColor = Color.Teal;
                grdViewOC.Appearance.FocusedCell.ForeColor = Color.White;
                grdViewOC.Appearance.FocusedRow.ForeColor  = Color.Teal;
                grdViewOC.Appearance.FocusedRow.BackColor  = Color.White;

                grdViewOC.OptionsSelection.EnableAppearanceHideSelection = false;
            }
            catch (Exception e)
            {
                throw e;
            }
        }
예제 #3
0
        private void btnOK_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            DataTable dt = new DataTable();

            dt = grdOC.DataSource as DataTable;
            if (dt == null)
            {
                return;
            }
            ProjectInfoBL.UpdateOCType(dt);
            Close();
        }
예제 #4
0
        private void btnOK_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            string  sBlock = "", sBook = "", sFlat = "";
            decimal dBlockAmt = 0, dBookAmt = 0, dFlatAmt = 0;

            try
            {
                if (rGBlock.SelectedIndex == 0)
                {
                    sBlock = "P"; if (Convert.ToDecimal(txtBlock.EditValue) > 100)
                    {
                        MessageBox.Show("Should Not Exceed 100%"); return;
                    }
                }
                else
                {
                    sBlock = "L";
                }
                dBlockAmt = Convert.ToDecimal(txtBlock.EditValue);
                if (rGBook.SelectedIndex == 0)
                {
                    sBook = "P"; if (Convert.ToDecimal(txtBook.EditValue) > 100)
                    {
                        MessageBox.Show("Should Not Exceed 100%"); return;
                    }
                }
                else
                {
                    sBook = "L";
                }
                dBookAmt = Convert.ToDecimal(txtBook.EditValue);
                if (rGFlat.SelectedIndex == 0)
                {
                    sFlat = "P"; if (Convert.ToDecimal(txtFlat.EditValue) > 100)
                    {
                        MessageBox.Show("Should Not Exceed 100%"); return;
                    }
                }
                else
                {
                    sFlat = "L";
                }
                dFlatAmt = Convert.ToDecimal(txtFlat.EditValue);

                ProjectInfoBL.UpdatePenalty(m_iCCId, sBlock, dBlockAmt, sBook, dBookAmt, sFlat, dFlatAmt);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            Close();
        }
예제 #5
0
 private void btnOK_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     grdViewOC.FocusedRowHandle = grdViewOC.FocusedRowHandle + 1;
     if (m_sType == "Service")
     {
         if (dtOC.Rows.Count > 0)
         {
             ProjectInfoBL.UpdateServiceOC(dtOC, m_sType, m_iCCId);
         }
     }
     else
     {
         if (dtOX.Rows.Count > 0)
         {
             ProjectInfoBL.UpdateServiceOC(dtOX, m_sType, m_iCCId);
         }
     }
     Close();
 }
예제 #6
0
        private void frmCancellation_Load(object sender, EventArgs e)
        {
            DataTable dt = new DataTable();

            dt = ProjectInfoBL.GetPenalty(m_iCCId);
            if (dt.Rows.Count > 0)
            {
                if (dt.Rows[0]["BlockingType"].ToString() == "P")
                {
                    rGBlock.SelectedIndex = 0;
                }
                else
                {
                    rGBlock.SelectedIndex = 1;
                }
                txtBlock.EditValue = Convert.ToDecimal(dt.Rows[0]["BlockingPenalty"]);
                if (dt.Rows[0]["BookingType"].ToString() == "P")
                {
                    rGBook.SelectedIndex = 0;
                }
                else
                {
                    rGBook.SelectedIndex = 1;
                }
                txtBook.EditValue = Convert.ToDecimal(dt.Rows[0]["BookingPenalty"]);
                if (dt.Rows[0]["CancelType"].ToString() == "P")
                {
                    rGFlat.SelectedIndex = 0;
                }
                else
                {
                    rGFlat.SelectedIndex = 1;
                }
                txtFlat.EditValue = Convert.ToDecimal(dt.Rows[0]["CancelPenalty"]);
            }
            else
            {
                rGBlock.SelectedIndex = 1;
                rGBook.SelectedIndex  = 1;
                rGFlat.SelectedIndex  = 1;
            }
        }
예제 #7
0
        private void PopulateGrid()
        {
            DataTable dt = new DataTable();

            dtOC = new DataTable();

            dt   = ProjectInfoBL.GetOtherCostType();
            dtOC = ProjectInfoBL.GetOCTypeMaster();

            DataRow dr;

            dr               = dtOC.NewRow();
            dr["OCTypeId"]   = 0;
            dr["OCTypeName"] = "None";
            dtOC.Rows.InsertAt(dr, 0);

            DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit cboOC = new DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit();
            cboOC.DataSource = dtOC;
            cboOC.PopulateColumns();
            cboOC.ValueMember   = "OCTypeId";
            cboOC.DisplayMember = "OCTypeName";
            cboOC.Columns["OCTypeId"].Visible = false;
            cboOC.ShowFooter = false;
            cboOC.ShowHeader = false;

            grdOC.DataSource = dt;
            grdViewOC.PopulateColumns();
            grdViewOC.Columns["OCTypeId"].Caption    = "TypeName";
            grdViewOC.Columns["OtherCostId"].Visible = false;
            grdViewOC.Columns["OtherCostName"].OptionsColumn.AllowEdit = false;
            grdViewOC.Columns["OCTypeId"].ColumnEdit = cboOC;
            cboOC.EditValueChanged += new EventHandler(cboOC_EditValueChanged);

            grdViewOC.Appearance.HeaderPanel.Font = new Font(grdViewOC.Appearance.HeaderPanel.Font, FontStyle.Bold);

            grdViewOC.OptionsSelection.InvertSelection = true;
            grdViewOC.OptionsSelection.EnableAppearanceHideSelection = false;
            grdViewOC.Appearance.FocusedRow.BackColor = Color.Teal;
            grdViewOC.Appearance.FocusedRow.ForeColor = Color.White;
        }
예제 #8
0
        private void btnOK_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            DataTable dt = new DataTable();

            dt = grdOC.DataSource as DataTable;
            ProjectInfoBL.UpdateSortOrder(dt);

            grdViewOC.FocusedRowHandle = grdViewOC.FocusedRowHandle + 1;
            DataTable dtRtnVal = new DataTable();

            using (DataView dvData = new DataView(dtOC)
            {
                RowFilter = "Sel = '" + true + "'"
            })
            {
                dtRtnVal = dvData.ToTable();
            }
            if (dtRtnVal.Rows.Count > 0)
            {
                ProjectInfoBL.UpdateOC(m_iCCId, dtRtnVal);
            }
            Close();
        }
예제 #9
0
        private void grdViewOC_ShowingEditor(object sender, System.ComponentModel.CancelEventArgs e)
        {
            if (Convert.ToBoolean(CommFun.IsNullCheck(grdViewOC.GetFocusedRowCellValue("SysDefault"), CommFun.datatypes.vartypenumeric)) == true)
            {
                e.Cancel = true;
                return;
            }

            if (grdViewOC.FocusedColumn.FieldName == "Sel")
            {
                bool bSel = Convert.ToBoolean(CommFun.IsNullCheck(grdViewOC.GetFocusedRowCellValue("Sel"), CommFun.datatypes.vartypenumeric));
                if (bSel == true)
                {
                    int  iOCId        = Convert.ToInt32(CommFun.IsNullCheck(grdViewOC.GetFocusedRowCellValue("OtherCostId"), CommFun.datatypes.vartypenumeric));
                    bool bUsedinFlats = ProjectInfoBL.CheckUsedInFlatsPayment(m_iCCId, iOCId);
                    if (bUsedinFlats == true)
                    {
                        e.Cancel = true;
                        //MessageBox.Show("Selected OtherCost Used in Flat-Payment", "OtherCost", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        //return;
                    }
                }
            }
        }