void Grid_RowsChanging(object sender, GridViewCollectionChangingEventArgs e)
        {
            if (e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Remove)
            {
                //if (this.CanDelete == false)
                //{
                //    ENUtils.ShowMessage("Permission Denied");
                //    e.Cancel = true;
                //}
                //else
                //{
                objMaster = new DriverBO();

                try
                {
                    objMaster.GetByPrimaryKey(grdLister.CurrentRow.Cells["Id"].Value.ToInt());
                    objMaster.Delete(objMaster.Current);
                }
                catch (Exception ex)
                {
                    if (objMaster.Errors.Count > 0)
                    {
                        ENUtils.ShowMessage(objMaster.ShowErrors());
                    }
                    else
                    {
                        ENUtils.ShowMessage(ex.Message);
                    }
                    e.Cancel = true;
                }
                //}
            }
        }
예제 #2
0
        //void grdLister_CellDoubleClick(object sender, GridViewCellEventArgs e)
        //{

        //    ViewDetailForm(e.Row);
        //}
        //private void ViewDetailForm(GridViewRowInfo row)
        //{
        //    try
        //    {
        //        int? val = row.Cells[COLS.Payment_ID].Value.ToInt();
        //        if (row != null && row is GridViewDataRowInfo && val == 4)
        //        {
        //            ShowPaymetForm(row.Cells["InvoiceId"].Value.ToInt(), row.Cells["InvoiceNo"].Value.ToStr(), row.Cells["InvoiceTotal"].Value.ToStr()); ;
        //        }

        //    }
        //    catch (Exception ex)
        //    {


        //    }
        //}
        //public static void ShowPaymetForm(int id, string InvoiceNo, string Total)
        //{

        //    try
        //    {

        //        //frmInvoicePayment frm = new frmInvoicePayment(id, InvoiceNo, Total);
        //        frmPayment frm = new frmPayment(id, InvoiceNo, Total);
        //        frm.MaximizeBox = false;
        //        frm.ShowDialog();
        //        frm.Dispose();
        //    }
        //    catch (Exception ex)
        //    {
        //        ENUtils.ShowMessage(ex.Message);

        //    }


        //}

        void Grid_RowsChanging(object sender, GridViewCollectionChangingEventArgs e)
        {
            if (e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Remove)
            {
                objMaster = new InvoiceBO();

                try
                {
                    long id = grdLister.CurrentRow.Cells["Id"].Value.ToLong();

                    objMaster.GetByPrimaryKey(id);

                    if (objMaster.Current != null)
                    {
                        objMaster.Current.InvoicePaymentTypeID = Enums.INVOICE_PAYMENTTYPES.UNPAID;

                        objMaster.Save();
                    }
                }
                catch (Exception ex)
                {
                    if (objMaster.Errors.Count > 0)
                    {
                        ENUtils.ShowMessage(objMaster.ShowErrors());
                    }
                    else
                    {
                        ENUtils.ShowMessage(ex.Message);
                    }
                    e.Cancel = true;
                }
            }
        }
예제 #3
0
        void grdSMSTemplets_RowsChanging(object sender, GridViewCollectionChangingEventArgs e)
        {
            try
            {
                if (e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Remove)
                {
                    if (grdSMSTemplets.CurrentRow != null && grdSMSTemplets.CurrentRow is GridViewDataRowInfo)
                    {
                        int id = grdSMSTemplets.CurrentRow.Cells["Id"].Value.ToInt();

                        using (TaxiDataContext db = new TaxiDataContext())
                        {
                            var obj = db.Fleet_DriverTemplets.FirstOrDefault(c => c.Id == id);

                            if (obj != null)
                            {
                                db.Fleet_DriverTemplets.DeleteOnSubmit(obj);
                                db.SubmitChanges();
                            }
                        }
                    }
                }
            }
            catch
            {
            }
        }
예제 #4
0
        void Grid_RowsChanging(object sender, GridViewCollectionChangingEventArgs e)
        {
            if (e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Remove)
            {
                //  objMaster = new Gen_EscortBO();
                this.SetProperties((INavigation)objMaster);


                try
                {
                    objMaster.GetByPrimaryKey(grdLister.CurrentRow.Cells["Id"].Value.ToInt());
                    objMaster.Delete(objMaster.Current);
                }
                catch (Exception ex)
                {
                    if (objMaster.Errors.Count > 0)
                    {
                        ENUtils.ShowMessage(objMaster.ShowErrors());
                    }
                    else
                    {
                        ENUtils.ShowMessage(ex.Message);
                    }
                    e.Cancel = true;
                }
            }
        }
        void Grid_RowsChanging(object sender, GridViewCollectionChangingEventArgs e)
        {
            if (e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Remove)
            {
                objMaster = new BookingGroupBO();

                try
                {
                    objMaster.GetByPrimaryKey(grdLister.CurrentRow.Cells["Id"].Value.ToInt());

                    if (objMaster.Current != null)
                    {
                        objMaster.Delete(objMaster.Current);
                    }
                }
                catch (Exception ex)
                {
                    if (objMaster.Errors.Count > 0)
                    {
                        ENUtils.ShowMessage(objMaster.ShowErrors());
                    }
                    else
                    {
                        ENUtils.ShowMessage(ex.Message);
                    }
                    e.Cancel = true;
                }
            }
        }
예제 #6
0
        void grdLister_RowsChanging(object sender, GridViewCollectionChangingEventArgs e)
        {
            if (e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Remove)
            {
                objMaster = new SubCompanyBO();

                try
                {
                    objMaster.GetByPrimaryKey((e.NewItems[0] as GridViewRowInfo).Cells["Id"].Value.ToInt());
                    objMaster.Delete(objMaster.Current);
                }
                catch (Exception ex)
                {
                    if (objMaster.Errors.Count > 0)
                    {
                        ENUtils.ShowMessage(objMaster.ShowErrors());
                    }
                    else
                    {
                        ENUtils.ShowMessage(ex.Message);
                    }
                    e.Cancel = true;
                }
            }
        }
예제 #7
0
        private void radGridView3_RowsChanging(object sender, GridViewCollectionChangingEventArgs e)
        {
            var commandServer = new CommandServer();
            var commandClient = new CommandClient();

            if (e.Action == NotifyCollectionChangedAction.ItemChanging)
            {
                var line = (GridViewRowInfo)e.NewItems[0];

                if (line.Cells[0].Value != null)
                {
                    _status = true;
                    var parameters = "'" + line.Cells[0].Value.ToString() + "','";
                    if (e.PropertyName == "date_start")
                    {
                        parameters += e.NewValue.ToString() + "',";
                        radGridViewSoc.CurrentRow.Cells[2].Value = e.NewValue;
                    }
                    else
                    {
                        parameters += line.Cells[1].Value.ToString() + "',";
                    }
                    if (e.PropertyName == "date_end")
                    {
                        if (e.NewValue == null)
                        {
                            parameters += "null";
                        }
                        else
                        {
                            parameters += "'" + e.NewValue.ToString() + "'";
                            radGridViewSoc.CurrentRow.Cells[3].Value = e.NewValue;
                        }
                    }
                    else
                    {
                        if (line.Cells[2].Value == null)
                        {
                            parameters += "null";
                        }
                        else
                        {
                            parameters += "'" + line.Cells[2].Value.ToString() + "'";
                        }
                    }

                    var returnSqlServer = commandServer.ExecReturnServer("job_soc_rabotnik_edit", parameters);
                    UpdateLoadJobTime();
                    AlertOperation("job_soc_rabotnik_edit " + line.Cells[1].Value, returnSqlServer);
                    //radGridViewSoc.Invoke(new MethodInvoker(delegate ()
                    //{
                    //    radGridViewSoc.DataSource = _bindingSource_soc;
                    //}));

                    //loadGridSoc();
                    //LoadGridSoc();
                }
            }
        }
예제 #8
0
 private void radGridView1_RowsChanging(object sender, GridViewCollectionChangingEventArgs e)
 {
     if (e.Action == NotifyCollectionChangedAction.Remove)
     {
         BaseService.GetMessage("can not delete project", "error");
         e.Cancel = true;
     }
 }
예제 #9
0
        private void radGridView4_RowsChanging(object sender, GridViewCollectionChangingEventArgs e)
        {
            bool update = false;

            if (e.Action == NotifyCollectionChangedAction.ItemChanging)
            {
                var line = (GridViewRowInfo)e.NewItems[0];

                if (line.Cells[0].Value != null)
                {
                    _status = true;
                    var parameters = "'" + line.Cells[0].Value.ToString() + "','";
                    if (e.PropertyName == "date_start")
                    {
                        parameters += e.NewValue.ToString() + "',";
                        radGridView4.CurrentRow.Cells[2].Value = e.NewValue;
                    }
                    else
                    {
                        parameters += line.Cells[1].Value.ToString() + "',";
                    }
                    if (e.PropertyName == "date_end")
                    {
                        if (e.NewValue == null)
                        {
                            parameters += "null";
                        }
                        else
                        {
                            parameters += "'" + e.NewValue.ToString() + "'";
                            radGridView5.CurrentRow.Cells[3].Value = e.NewValue;
                            update = true;
                        }
                    }
                    else
                    {
                        if (line.Cells[2].Value == null || line.Cells[2].Value.ToString() == "")
                        {
                            parameters += "null";
                        }
                        else
                        {
                            parameters += "'" + line.Cells[2].Value.ToString() + "'";
                        }
                    }

                    var returnSqlServer = new CommandServer().ExecReturnServer("job_spezialist_edit", parameters);
                    AlertOperation("job_spezialist_edit " + line.Cells[1].Value, returnSqlServer);
                    if (update)
                    {
                        LoadGridFio();
                        LoadGridFioOff();
                    }
                }
            }
        }
예제 #10
0
 private void radGridView1_RowsChanging(object sender, GridViewCollectionChangingEventArgs e)
 {
     if (e.Action == NotifyCollectionChangedAction.Remove)
     {
         if (DeleteFromDb() == false)
         {
             e.Cancel = true;
         }
     }
 }
예제 #11
0
        private void radGridView1_RowsChanging(object sender, GridViewCollectionChangingEventArgs e)
        {
            if (e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Remove)
            {
                DialogResult dialogResult = MessageBox.Show("Do you want to delete this product?", "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);

                if (dialogResult != DialogResult.OK)
                {
                    e.Cancel = true;
                }
            }
        }
예제 #12
0
        private void grdAttributes_RowsChanging(object sender, GridViewCollectionChangingEventArgs e)
        {
            if (e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Remove)
            {
                if (this.CanDelete == false)
                {
                    // ENUtils.ShowMessage("Permission Denied");
                    e.Cancel = true;
                }
                else
                {
                    if (grdCompanyGroup.CurrentRow == null)
                    {
                        return;
                    }
                    GroupBO objMaster = new GroupBO();

                    try
                    {
                        objMaster.GetByPrimaryKey(grdCompanyGroup.CurrentRow.Cells["Id"].Value.ToInt());
                        if (objMaster.Current != null)
                        {
                            // string Name = objMaster.Current.Name.ToStr();
                            // string ShortName = objMaster.Current.ShortName.ToStr();
                            // bool IsDefaultCheck = Convert.ToBoolean(ObjMaster.Current.IsDefault);

                            objMaster.Delete(objMaster.Current);

                            OnNew();
                        }
                    }
                    catch (Exception ex)
                    {
                        if (objMaster.Errors.Count > 0)
                        {
                            ENUtils.ShowMessage(objMaster.ShowErrors());
                        }
                        else
                        {
                            ENUtils.ShowMessage(ex.Message);
                        }
                        e.Cancel = true;
                    }
                }
            }
        }
예제 #13
0
        //редактирование
        private void radGridView1_RowsChanging(object sender, GridViewCollectionChangingEventArgs e)
        {
            if (_status)
            {
                _status = false;
                return;
            }
            var commandServer = new CommandServer();
            var commandClient = new CommandClient();

            if (e.Action == NotifyCollectionChangedAction.ItemChanging)
            {
                var line = (GridViewRowInfo)e.NewItems[0];

                if (line.Cells[0].Value != null)
                {
                    if (e.PropertyName == "ФИО")
                    {
                        var    parameters = "'" + line.Cells[1].Value.ToString() + "','";
                        string text       = null;

                        if (e.NewValue.ToString().Split(' ').Length == 3)
                        {
                            text = commandClient.CharTo(e.NewValue.ToString().Split(' ')[0]) + " " +
                                   commandClient.CharTo(e.NewValue.ToString().Split(' ')[1]) + " " +
                                   commandClient.CharTo(e.NewValue.ToString().Split(' ')[2]);
                        }
                        else
                        {
                            text = e.NewValue.ToString();
                        }
                        parameters += text + "'";

                        var returnSqlServer = commandServer.ExecReturnServer("socRabotnik_edit", parameters);
                        if (returnSqlServer[1] == "0")
                        {
                            e.Cancel = true;
                        }
                        //loadGridSoc();
                        //LoadGridSoc();
                        AlertOperation("socRabotnik_edit " + line.Cells[1].Value, returnSqlServer);
                    }
                }
            }
        }
예제 #14
0
        void Grid_RowsChanging(object sender, GridViewCollectionChangingEventArgs e)
        {
            //if (e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Remove)
            //{

            //    objMaster = new DriverCommisionBO();

            //    try
            //    {

            //        objMaster.GetByPrimaryKey(grdLister.CurrentRow.Cells["Id"].Value.ToInt());

            //        string Transaction = grdLister.CurrentRow.Cells["TransNo"].Value.ToStr();
            //        int DriverId = grdLister.CurrentRow.Cells["DriverID"].Value.ToInt();

            //        var query = General.GetQueryable<Fleet_DriverCommision>(c => c.DriverId == DriverId).OrderByDescending(c => c.Id).FirstOrDefault();

            //        if (query != null)
            //        {
            //            string Transno = query.TransNo.ToStr();

            //            if (Transno == Transaction)
            //            {
            //                objMaster.Delete(objMaster.Current);
            //            }
            //            else
            //            {
            //                ENUtils.ShowMessage("You Can not delete a record..");
            //            }
            //        }
            //    }
            //    catch (Exception ex)
            //    {
            //        if (objMaster.Errors.Count > 0)
            //            ENUtils.ShowMessage(objMaster.ShowErrors());
            //        else
            //        {
            //            ENUtils.ShowMessage(ex.Message);

            //        }
            //        e.Cancel = true;

            //    }
            //}
        }
        void Grid_RowsChanging(object sender, GridViewCollectionChangingEventArgs e)
        {
            if (e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Remove)
            {
                objMaster = new ZoneBO();

                try
                {
                    objMaster.GetByPrimaryKey(grdLister.CurrentRow.Cells["Id"].Value.ToInt());

                    if (objMaster.Current != null)
                    {
                        int    id       = objMaster.Current.Id;
                        string zoneName = objMaster.Current.ZoneName;
                        objMaster.Delete(objMaster.Current);

                        //using (PDADataContext db = new PDADataContext())
                        //{

                        //    Zone objZone = db.Zones.FirstOrDefault(c => c.ZoneName == zoneName && c.ClientId==AppVars.objPolicyConfiguration.DefaultClientId);

                        //    if (objZone != null)
                        //    {
                        //        db.Zones.DeleteOnSubmit(objZone);
                        //        db.SubmitChanges();
                        //    }
                        //}
                    }
                }
                catch (Exception ex)
                {
                    if (objMaster.Errors.Count > 0)
                    {
                        ENUtils.ShowMessage(objMaster.ShowErrors());
                    }
                    else
                    {
                        ENUtils.ShowMessage(ex.Message);
                    }
                    e.Cancel = true;
                }
            }
        }
예제 #16
0
        void grdUsers_RowsChanging(object sender, GridViewCollectionChangingEventArgs e)
        {
            if (e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Remove)
            {
                if (this.CanDelete == false)
                {
                    // ENUtils.ShowMessage("Permission Denied");
                    e.Cancel = true;
                }
                else
                {
                    UserBO objMaster = new UserBO();

                    try
                    {
                        objMaster.GetByPrimaryKey(grdUsers.CurrentRow.Cells["Id"].Value.ToInt());
                        if (objMaster.Current != null)
                        {
                            string userName  = objMaster.Current.UserName.ToStr();
                            string password  = objMaster.Current.Passwrd.ToStr();
                            string groupName = objMaster.Current.UM_SecurityGroup != null ? objMaster.Current.UM_SecurityGroup.GroupName : "";

                            objMaster.Delete(objMaster.Current);

                            OnNew();
                        }
                    }
                    catch (Exception ex)
                    {
                        if (objMaster.Errors.Count > 0)
                        {
                            ENUtils.ShowMessage(objMaster.ShowErrors());
                        }
                        else
                        {
                            ENUtils.ShowMessage(ex.Message);
                        }
                        e.Cancel = true;
                    }
                }
            }
        }
예제 #17
0
파일: TypeHelp.cs 프로젝트: Vla00/alone
        private void radGridView1_RowsChanging(object sender, GridViewCollectionChangingEventArgs e)
        {
            if (e.Action == NotifyCollectionChangedAction.ItemChanging)
            {
                var line = (GridViewRowInfo)e.NewItems[0];

                if (line.Cells[0].Value != null)
                {
                    if (e.NewValue != null)
                    {
                        if (string.IsNullOrEmpty(e.NewValue.ToString()))
                        {
                            RadMessageBox.Show("Не заполнено поле. Изменение отменено.", "Ошибка", MessageBoxButtons.OKCancel, RadMessageIcon.Info);
                        }
                        else
                        {
                            new CommandServer().ExecNoReturnServer("TypeHelpEdit", line.Cells[0].Value.ToString() + ",'" + e.NewValue.ToString() + "'");
                        }
                    }
                }
            }
        }
예제 #18
0
        void grdLister_RowsChanging(object sender, GridViewCollectionChangingEventArgs e)
        {
            if (e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Remove)
            {
                AdvanceBookingBO objMaster = new AdvanceBookingBO();

                try
                {
                    objMaster.GetByPrimaryKey(grdLister.CurrentRow.Cells["Id"].Value.ToInt());
                    string customer  = objMaster.Current.CustomerName.ToStr();
                    string from      = objMaster.Current.FromAddress.ToStr();
                    string toAddress = objMaster.Current.ToAddress.ToStr();
                    //  string totalJobs=objMaster.Current.Bookings.Count.ToStr();



                    new TaxiDataContext().stp_DeleteMultiBooking(objMaster.Current.Id, AppVars.LoginObj.UserName.ToStr());


                    // objMaster.Delete(objMaster.Current);



                    //   new TaxiDataContext().stp_AddLog("MULTI BOOKING DELETED :Total bookings : "+totalJobs + " , CUST : " + customer + " , Pickup : " + from + " , Destination : " + toAddress, AppVars.LoginObj.UserName.ToStr(), AppVars.LoginObj.UserName.ToStr());
                }
                catch (Exception ex)
                {
                    if (objMaster.Errors.Count > 0)
                    {
                        ENUtils.ShowMessage(objMaster.ShowErrors());
                    }
                    else
                    {
                        ENUtils.ShowMessage(ex.Message);
                    }
                    e.Cancel = true;
                }
            }
        }
예제 #19
0
        void Grid_RowsChanging(object sender, GridViewCollectionChangingEventArgs e)
        {
            if (e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Remove)
            {
                objMaster = new InvoiceBO();

                try
                {
                    objMaster.GetByPrimaryKey(grdLister.CurrentRow.Cells["Id"].Value.ToInt());

                    int             InvoiceId = grdLister.CurrentRow.Cells["Id"].Value.ToInt();
                    invoice_Payment obj       = General.GetObject <invoice_Payment>(c => c.invoiceId == InvoiceId);
                    if (obj == null)
                    {
                        objMaster.Delete(objMaster.Current);
                    }
                    else
                    {
                        ENUtils.ShowMessage("You Can not delete a record..");
                        return;
                    }
                }
                catch (Exception ex)
                {
                    if (objMaster.Errors.Count > 0)
                    {
                        ENUtils.ShowMessage(objMaster.ShowErrors());
                    }
                    else
                    {
                        ENUtils.ShowMessage(ex.Message);
                    }
                    e.Cancel = true;
                }
            }
        }
예제 #20
0
 private void radGridView1_RowsChanging(object sender, GridViewCollectionChangingEventArgs e)
 {
     Console.WriteLine("Rows changing action:{0}", e.Action);
 }
예제 #21
0
파일: Disability.cs 프로젝트: Vla00/alone
        private void radGridView1_RowsChanging(object sender, GridViewCollectionChangingEventArgs e)
        {
            //изменение
            var commandServer = new CommandServer();
            var commandClient = new CommandClient();

            if (e.Action == NotifyCollectionChangedAction.ItemChanging)
            {
                bool flag = false;
                var  line = (GridViewRowInfo)e.NewItems[0];
                if (line.Cells[0].Value != null)
                {
                    var parameters = line.Cells[0].Value.ToString() + ",'";

                    if (e.PropertyName == "powered")
                    {
                        flag        = true;
                        parameters += e.NewValue.ToString() + "','";
                    }
                    else
                    {
                        parameters += line.Cells[1].Value.ToString() + "','";
                    }

                    if (e.PropertyName == "Дата инв.")
                    {
                        flag = true;
                        if (e.NewValue != null)
                        {
                            parameters += e.NewValue.ToString() + "',";
                        }
                        else
                        {
                            AlertOperation(new string[] { "Не указана дата инвалидности", "0" });
                            e.Cancel = true;
                        }
                    }
                    else
                    {
                        parameters += line.Cells[2].Value.ToString() + "',";
                    }

                    if (e.PropertyName == "Дата переосв.")
                    {
                        if (e.NewValue != null)
                        {
                            parameters += "'" + e.NewValue.ToString() + "','";
                            flag        = true;
                        }
                        else
                        {
                            if (e.OldValue.ToString() != "")
                            {
                                flag        = true;
                                parameters += "null,'";
                            }
                        }
                    }
                    else
                    {
                        if (!string.IsNullOrEmpty(line.Cells[3].Value.ToString()))
                        {
                            parameters += "'" + line.Cells[3].Value.ToString() + "','";
                        }
                        else
                        {
                            parameters += "null,'";
                        }
                    }

                    if (e.PropertyName == "name")
                    {
                        flag        = true;
                        parameters += e.NewValue.ToString() + "'";
                    }
                    else
                    {
                        parameters += line.Cells[4].Value.ToString() + "'";
                    }

                    if (flag)
                    {
                        var resultOperation = commandServer.ExecReturnServer("Disability_edit", parameters);
                        AlertOperation(resultOperation);
                    }
                }
            }
        }