Exemplo n.º 1
0
        private void gvProjView_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
        {
            DataRowView drv = e.Row as DataRowView;

            if (drv != null)
            {
                DataRow dr = drv.Row;
                if (dr != null)
                {
                    SqlCommand cmd = daInsertUpdate.SelectCommand;

                    object oID = dr["id"];
                    if (oID == null || oID.Equals(0))
                    {
                        oID = DBNull.Value;
                    }

                    cmd.Parameters["@id"].Value                           = oID;
                    cmd.Parameters["@supplier_id"].Value                  = dr["supplier_id"];
                    cmd.Parameters["@insur_type_id"].Value                = dr["insur_type_id"];
                    cmd.Parameters["@expiry_date"].Value                  = dr["expiry_date"];
                    cmd.Parameters["@rule_warning"].Value                 = dr["rule_warning"];
                    cmd.Parameters["@rule_restrict"].Value                = dr["rule_restrict"];
                    cmd.Parameters["@rule_accrual"].Value                 = dr["rule_accrual"];
                    cmd.Parameters["@rule_payment"].Value                 = dr["rule_payment"];
                    cmd.Parameters["@rule_holdback_release"].Value        = dr["rule_holdback_release"];
                    cmd.Parameters["@rule_po"].Value                      = dr["rule_po"];
                    cmd.Parameters["@webrule_internal_alert"].Value       = dr["webrule_internal_alert"];
                    cmd.Parameters["@webrule_warn_contractor"].Value      = dr["webrule_warn_contractor"];
                    cmd.Parameters["@webrule_restrict_payment_req"].Value = dr["webrule_restrict_payment_req"];
                    cmd.Parameters["@pri_id"].Value                       = dr["pri_id"];
                    cmd.Parameters["@active"].Value                       = dr["active"];

                    DataTable      dt = new DataTable();
                    SqlDataAdapter da = new SqlDataAdapter(cmd);
                    try
                    {
                        da.Fill(dt);
                        if (dt != null)
                        {
                            if (dt.Rows.Count > 0)
                            {
                                DataRow dtdr = dt.Rows[0];
                                if (dtdr != null)
                                {
                                    dr.BeginEdit();
                                    dr["id"] = dtdr["id"];
                                    dr.AcceptChanges();
                                }
                            }
                        }
                    }
                    catch (SqlException)
                    {
                        Popup.ShowPopup("Error saving record.");
                    }
                    finally
                    {
                        if (cmd.Connection.State == System.Data.ConnectionState.Open)
                        {
                            cmd.Connection.Close();
                        }
                        da.Dispose();
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void gridView2_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
        {
            try
            {
                int    id;
                string cspot;
                string cspot2;
                string address;
                double?ypeni;
                double?y0;
                double?yakt;
                double?y1;
                double?y2;
                double?y3;
                double?y4;
                double?y5;
                double?y6;
                double?y7;
                double?y8;


                var rowHandle = gridView2.FocusedRowHandle;
                id = (int)gridView2.GetRowCellValue(rowHandle, "id");
                if (gridView2.GetRowCellValue(rowHandle, "cspot") is DBNull || gridView2.GetRowCellValue(rowHandle, "cspot") == "")
                {
                    cspot = null;
                }
                else
                {
                    cspot = (string)gridView2.GetRowCellValue(rowHandle, "cspot");
                }
                if (gridView2.GetRowCellValue(rowHandle, "cspot2") is DBNull || gridView2.GetRowCellValue(rowHandle, "cspot2") == "")
                {
                    cspot2 = null;
                }
                else
                {
                    cspot2 = (string)gridView2.GetRowCellValue(rowHandle, "cspot2");
                }
                if (gridView2.GetRowCellValue(rowHandle, "address") is DBNull || gridView2.GetRowCellValue(rowHandle, "address") == "")
                {
                    address = null;
                }
                else
                {
                    address = (string)gridView2.GetRowCellValue(rowHandle, "address");
                }
                if (gridView2.GetRowCellValue(rowHandle, "ypeni") is DBNull || gridView2.GetRowCellValue(rowHandle, "ypeni") == "")
                {
                    ypeni = 0;
                }
                else
                {
                    ypeni = (double)gridView2.GetRowCellValue(rowHandle, "ypeni");
                }
                if (gridView2.GetRowCellValue(rowHandle, "y0") is DBNull || gridView2.GetRowCellValue(rowHandle, "y0") == "")
                {
                    y0 = 0;
                }
                else
                {
                    y0 = (double)gridView2.GetRowCellValue(rowHandle, "y0");
                }
                if (gridView2.GetRowCellValue(rowHandle, "yakt") is DBNull || gridView2.GetRowCellValue(rowHandle, "yakt") == "")
                {
                    yakt = 0;
                }
                else
                {
                    yakt = (double)gridView2.GetRowCellValue(rowHandle, "yakt");
                }

                if (gridView2.GetRowCellValue(rowHandle, "y1") is DBNull || gridView2.GetRowCellValue(rowHandle, "y1") == "")
                {
                    y1 = 0;
                }
                else
                {
                    y1 = (double)gridView2.GetRowCellValue(rowHandle, "y1");
                }
                if (gridView2.GetRowCellValue(rowHandle, "y2") is DBNull || gridView2.GetRowCellValue(rowHandle, "y2") == "")
                {
                    y2 = 0;
                }
                else
                {
                    y2 = (double)gridView2.GetRowCellValue(rowHandle, "y2");
                }
                if (gridView2.GetRowCellValue(rowHandle, "y3") is DBNull || gridView2.GetRowCellValue(rowHandle, "y3") == "")
                {
                    y3 = 0;
                }
                else
                {
                    y3 = (double)gridView2.GetRowCellValue(rowHandle, "y3");
                }
                if (gridView2.GetRowCellValue(rowHandle, "y4") is DBNull || gridView2.GetRowCellValue(rowHandle, "y4") == "")
                {
                    y4 = 0;
                }
                else
                {
                    y4 = (double)gridView2.GetRowCellValue(rowHandle, "y4");
                }
                if (gridView2.GetRowCellValue(rowHandle, "y5") is DBNull || gridView2.GetRowCellValue(rowHandle, "y5") == "")
                {
                    y5 = 0;
                }
                else
                {
                    y5 = (double)gridView2.GetRowCellValue(rowHandle, "y5");
                }
                if (gridView2.GetRowCellValue(rowHandle, "y6") is DBNull || gridView2.GetRowCellValue(rowHandle, "y6") == "")
                {
                    y6 = 0;
                }
                else
                {
                    y6 = (double)gridView2.GetRowCellValue(rowHandle, "y6");
                }
                if (gridView2.GetRowCellValue(rowHandle, "y7") is DBNull || gridView2.GetRowCellValue(rowHandle, "y7") == "")
                {
                    y7 = 0;
                }
                else
                {
                    y7 = (double)gridView2.GetRowCellValue(rowHandle, "y7");
                }
                if (gridView2.GetRowCellValue(rowHandle, "y8") is DBNull || gridView2.GetRowCellValue(rowHandle, "y8") == "")
                {
                    y8 = 0;
                }
                else
                {
                    y8 = (double)gridView2.GetRowCellValue(rowHandle, "y8");
                }

                if (id < 0)
                {
                    this.deb_promTableAdapter.InsertQuery(cspot, cspot2, address, ypeni, y0, yakt, y1, y2, y3, y4, y5, y6, y7, y8, Globals.prava_mod_spr_res.ToString());
                    if (Globals.id_res == 1)
                    {
                        this.deb_promTableAdapter.FillBySever(this.uristDataSet1.deb_prom);
                    }
                    else if (Globals.id_res == 14)
                    {
                        this.deb_promTableAdapter.FillByTalas(this.uristDataSet1.deb_prom);
                    }
                    else
                    {
                        if (Globals.id_zavis != 1 || Globals.id_zavis != 14)
                        {
                            if (Globals.id_res == 5 || Globals.id_res == 6 || Globals.id_res == 7 || Globals.id_res == 8 || Globals.id_res == 9 || Globals.id_res == 11 || Globals.id_res == 13 || Globals.id_res == 4 || Globals.id_res == 10 || Globals.id_res == 12 || Globals.id_res == 17 ||
                                Globals.id_res == 18 || Globals.id_res == 16 || Globals.id_res == 15 ||
                                Globals.id_res == 19)
                            {
                                this.deb_promTableAdapter.FillByRes1(this.uristDataSet1.deb_prom, Globals.id_res);
                            }
                            else
                            {
                                this.deb_promTableAdapter.FillByRes(this.uristDataSet1.deb_prom, Globals.id_res);
                            }
                        }
                        else
                        {
                            this.deb_promTableAdapter.FillByUchastok(this.uristDataSet1.deb_prom, Globals.id_res.ToString());
                        }
                    }
                }
                else
                {
                    this.deb_promTableAdapter.UpdateQuery2(address, ypeni, y0, yakt, y1, y2, y3, y4, y5, y6, y7, y8, id);
                    if (Globals.id_res == 1)
                    {
                        this.deb_promTableAdapter.FillBySever(this.uristDataSet1.deb_prom);
                    }
                    else if (Globals.id_res == 14)
                    {
                        this.deb_promTableAdapter.FillByTalas(this.uristDataSet1.deb_prom);
                    }
                    else
                    {
                        if (Globals.id_zavis != 1 || Globals.id_zavis != 14)
                        {
                            if (Globals.id_res == 5 || Globals.id_res == 6 || Globals.id_res == 7 || Globals.id_res == 8 || Globals.id_res == 9 || Globals.id_res == 11 || Globals.id_res == 13 || Globals.id_res == 4 || Globals.id_res == 10 || Globals.id_res == 12 || Globals.id_res == 17 ||
                                Globals.id_res == 18 || Globals.id_res == 16 || Globals.id_res == 15 ||
                                Globals.id_res == 19)
                            {
                                this.deb_promTableAdapter.FillByRes1(this.uristDataSet1.deb_prom, Globals.id_res);
                            }
                            else
                            {
                                this.deb_promTableAdapter.FillByRes(this.uristDataSet1.deb_prom, Globals.id_res);
                            }
                        }
                        else
                        {
                            this.deb_promTableAdapter.FillByUchastok(this.uristDataSet1.deb_prom, Globals.id_res.ToString());
                        }
                    }
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.ToString()); }
        }
Exemplo n.º 3
0
 private void gridView2_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
 {
     btnSave.Enabled = true;
 }
Exemplo n.º 4
0
 private void layer_gw_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
 {
     cUS_LAYER_TBTableAdapter.Adapter.Update(layers_ds);
 }
Exemplo n.º 5
0
 private void Pasaporte_gridView_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
 {
     _GlobalDataContext.SubmitChanges();
 }
Exemplo n.º 6
0
 private void gvComPur_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
 {
     daCommPurpose.Update(dsCommPurpose1);
 }
Exemplo n.º 7
0
 private void grdViewItems_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
 {
     RefreshAmounts();
 }
Exemplo n.º 8
0
 //tự dộng cập nhật dữ liệu khi sửa trực tiếp trên Gridcontrol
 private void gv_mathang_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
 {
     MH.sua(this);
 }
 private void gridView1_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
 {
     dbContext.SaveChanges();
 }
Exemplo n.º 10
0
 private void DetailView_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
 {
     cUS_MAP_CHANNEL_TBTableAdapter.Adapter.Update(mapChannelDs);
 }
Exemplo n.º 11
0
 // delivery rates
 private void gridViewDeliveryRates_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
 {
     this.ExportToCSV(gridControlDeliveryRates, deliveryFile);
 }
Exemplo n.º 12
0
 private void gridView1_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
 {
     mySqlDataAdapter1.Update(mySqlDataTable1);
 }
Exemplo n.º 13
0
 private void grdvMethodStandards_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
 {
     SetEditorMode(true);
 }
Exemplo n.º 14
0
 private void gridView1_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
 {
     AGlobalDataContext.SubmitChanges();
     bindingSource1.DataSource = AGlobalDataContext.Agrupacion;
 }
Exemplo n.º 15
0
 private void subchannel_gw_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
 {
     cUS_SUBCHANNEL_DIRECTORY_TBTableAdapter.Adapter.Update(subchannel_ds);
 }
Exemplo n.º 16
0
 private void grdvProductionPrograms_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
 {
     SetEditorMode(true);
 }
Exemplo n.º 17
0
 private void gvLevy_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
 {
     daLevySearch.Update(dsLevySearch1);
 }
Exemplo n.º 18
0
 private void mapBrc_gw_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
 {
     cUS_MAP_BRC_TBTableAdapter.Adapter.Update(mapBrcDs);
 }
Exemplo n.º 19
0
 private void gvDocMerge_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
 {
     daDocMergeLibraryItems.Update(dsDocMergeLibraryItems1);
 }
Exemplo n.º 20
0
 private void graphics_gw_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
 {
     cUS_GRAPHICS_COMPLEX_TBTableAdapter.Adapter.Update(graphics_ds);
 }
Exemplo n.º 21
0
 private void grdvInspectStandards_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
 {
     grdvInspectStandards.BestFitColumns();
     SetEditorMode(true);
 }
Exemplo n.º 22
0
 private void grdViewAddGSM_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
 {
     paperStockManagementDB.SaveChanges();
 }
Exemplo n.º 23
0
 private void gridView1_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
 {
     btn_Luu_Lai.Enabled = true;
     _listUpdate.Add(e.RowHandle);
 }
Exemplo n.º 24
0
 private void CuentasEmpresa_gridView_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
 {
     AGlobalDataContext.SubmitChanges();
 }
Exemplo n.º 25
0
 private void layoutView_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
 {
     Save();
     clientFactory.DataPageRefresh <StaffSchClass>();
 }
Exemplo n.º 26
0
 private void layoutView_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
 {
     Save();
 }
 private void gridView1_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
 {
     //QuantityPerUnit.OptionsColumn.AllowEdit = false;
 }
Exemplo n.º 28
0
        private void gvDetail_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
        {
            DataRow dr = gvDetail.GetDataRow(gvDetail.FocusedRowHandle);

            if (dr != null)
            {
                object oPriID = dr["PRI_ID"];
                if (oPriID == null || oPriID == DBNull.Value)
                {
                    oPriID = "null";
                }
                object olv1ID = dr["lv1ID"];
                if (olv1ID == null || olv1ID == DBNull.Value)
                {
                    olv1ID = "null";
                }
                object olv2ID = dr["lv2ID"];
                if (olv2ID == null || olv2ID == DBNull.Value)
                {
                    olv2ID = "null";
                }
                object olv3ID = dr["lv3ID"];
                if (olv3ID == null || olv3ID == DBNull.Value)
                {
                    olv3ID = "null";
                }
                object olv4ID = dr["lv4ID"];
                if (olv4ID == null || olv4ID == DBNull.Value)
                {
                    olv4ID = "null";
                }
                object oLem = dr["LEM_COMP"];
                if (oLem == null || oLem == DBNull.Value)
                {
                    oLem = "null";
                }
                else
                {
                    oLem = "'" + oLem + "'";
                }
                object oExpense = dr["EXPENSE_TYPE"];
                if (oExpense == null || oExpense == DBNull.Value)
                {
                    oExpense = "null";
                }
                else
                {
                    oExpense = "'" + oExpense + "'";
                }
                object oReference = dr["REFERENCE"];
                if (oReference == null || oReference == DBNull.Value)
                {
                    oReference = "null";
                }
                else
                {
                    oReference = "'" + oReference + "'";
                }

                string sUpdate = "update ap_gl_alloc set " +
                                 "gl_account='" + dr["GL_ACCOUNT"] + "', " +
                                 "pri_id=" + oPriID + ", " +
                                 "lv1id=" + olv1ID + ", " +
                                 "lv2id=" + olv2ID + ", " +
                                 "lv3id=" + olv3ID + ", " +
                                 "lv4id=" + olv4ID + ", " +
                                 "lem_comp=" + oLem + ", " +
                                 "expense_type=" + oExpense + ", " +
                                 "reference=" + oReference + " " +
                                 "where ap_gl_alloc_id=" + dr["AP_GL_ALLOC_ID"];
                Connection.SQLExecutor.ExecuteNonQuery(sUpdate, Connection.TRConnection);
            }
        }
Exemplo n.º 29
0
 private void gridView1_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
 {
 }
Exemplo n.º 30
0
 private void variable_gw_RowUpdated(object sender, DevExpress.XtraGrid.Views.Base.RowObjectEventArgs e)
 {
     cUS_VARIABLE_REFERENCE_TBTableAdapter.Adapter.Update(variable_ds);
 }