Exemple #1
0
 private void BtnEdit_Click(object sender, EventArgs e)
 {
     if (btnEdit.Enabled)
     {
         try
         {
             var row = ReplGridView.GetDataRow(ReplGridView.FocusedRowHandle);
             var ds  = ProjectFunctions.GetDataSet(string.Format("select * from ExMst Where ExId='" + row["ExId"].ToString() + "'"));
             if (ds.Tables[0].Rows[0]["ExLoadTag"].ToString() == string.Empty)
             {
                 var frm = new Forms_Transaction.FrmAdvanceAddEdit()
                 {
                     S1 = btnEdit.Text
                 };
                 var P = ProjectFunctions.GetPositionInForm(this);
                 frm.Location = new Point(P.X + (ClientSize.Width / 2 - frm.Size.Width / 2), P.Y + (ClientSize.Height / 2 - frm.Size.Height / 2));
                 frm.Text     = "Time Office Payment Editing";
                 frm.ExId     = row["ExId"].ToString();
                 frm.ShowDialog();
             }
             else
             {
                 XtraMessageBox.Show("Entry Has been Loaded");
             }
             FillGrid();
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
         }
     }
 }
Exemple #2
0
 private void BtnDelete_Click(object sender, EventArgs e)
 {
     if (GlobalVariables.ProgCode == "PROG152")
     {
         var confirmResult = XtraMessageBox.Show("Are you sure to delete this item ??",
                                                 "Confirm Delete!!",
                                                 MessageBoxButtons.YesNo);
         if (confirmResult == DialogResult.Yes)
         {
             var row = ReplGridView.GetDataRow(ReplGridView.FocusedRowHandle);
             ProjectFunctions.GetDataSet("Delete from ExMst Where ExNo ='" + row["ExNo"].ToString() + "'");
             FillGrid();
         }
     }
 }
        private void FillGrid()
        {
            var ds = ProjectFunctions.GetDataSet("	SELECT DISTINCT ActMst.AccCode, ActMst.AccName FROM            InvoiceMst left outer join ActMst ON InvoiceMst.ImPartyCode = ActMst.AccCode WHERE        (InvoiceMst.ImType = 'S') and Imdate between '"+ Convert.ToDateTime(DtStartDate.Text).ToString("yyyy-MM-dd") + "' and '" + Convert.ToDateTime(DtEndDate.Text).ToString("yyyy-MM-dd") + "'");

            ds.Tables[0].Columns.Add("Select", typeof(bool));


            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                dr["Select"] = false;
            }
            if (ds.Tables[0].Rows.Count > 0)
            {
                ReplGrid.DataSource = ds.Tables[0];
                ReplGridView.BestFitColumns();
            }
        }
        private void BtnSelectALL_CheckedChanged(object sender, EventArgs e)
        {
            var MaxRow = ((ReplGrid.FocusedView as GridView).RowCount);

            if (btnSelectALL.Checked == true)
            {
                for (var i = 0; i < MaxRow; i++)
                {
                    ReplGridView.SetRowCellValue(i, "Select", "True");
                }
            }
            if (btnSelectALL.Checked == false)
            {
                for (var i = 0; i < MaxRow; i++)
                {
                    ReplGridView.SetRowCellValue(i, "Select", "False");
                }
            }
        }
Exemple #5
0
        private void FillGrid()
        {
            //DevExpress.XtraSplashScreen.SplashScreenManager.ShowForm(this, typeof(WaitForm1), true, true, false);
            //SplashScreenManager.Default.SetWaitFormDescription("Fetching Data");
            var qr = " sp_LoadAdvanceMst '" + Convert.ToDateTime(DtStartDate.Text).ToString("yyyy-MM-dd") + "', '" + Convert.ToDateTime(DtEndDate.Text).ToString("yyyy-MM-dd") + "'";
            var ds = ProjectFunctions.GetDataSet(qr);

            if (ds.Tables[0].Rows.Count > 0)
            {
                ReplGrid.DataSource = ds.Tables[0];
                ReplGridView.BestFitColumns();
                btnEdit.Enabled = true;
            }
            else
            {
                ReplGrid.DataSource = null;
                btnEdit.Enabled     = false;
            }
            //SplashScreenManager.CloseForm();
        }