示例#1
0
        private void Changed(object sender, CellValueChangedEventArgs e)
        {
            if (e.Column.Name != "clState")
            {
                if (CurrentModel.Id > 0)
                {
                    PodView.SetRowCellValue(e.RowHandle, PodView.Columns["StateChange"], EnumStateChange.Update);
                }

                if (CurrentModel.Id == 0)
                {
                    PodView.SetRowCellValue(e.RowHandle, PodView.Columns["StateChange"], EnumStateChange.Insert);
                }

                var ds = PodView.DataSource as List <FranchiseCommissionModel>;
                if (ds != null)
                {
                    var checkeds = ds.Where(d => d.Checked.Equals(true)).ToList();

                    tbxTtlPod.Value        = checkeds.Count();
                    tbxTtlPiece.Value      = checkeds.Sum(c => c.TtlPiece);
                    tbxTtlWeight.Value     = checkeds.Sum(c => c.TtlGrossWeight);
                    tbxTtlChargeable.Value = checkeds.Sum(c => c.TtlChargeableWeight);

                    TtlSales         = checkeds.Sum(c => c.TotalSales);
                    TtlPpn           = checkeds.Sum(c => c.PPN);
                    TtlCommission    = checkeds.Sum(c => c.Commission);
                    TtlPph           = checkeds.Sum(c => c.PPH23);
                    TtlNetCommission = checkeds.Sum(c => c.TotalNetCommission);
                    Balance          = checkeds.Sum(c => c.Debs);
                }
            }
        }
示例#2
0
        private void AddRow(object sender, EventArgs e)
        {
            if (tbxPod.Text == string.Empty)
            {
                return;
            }

            var found = false;

            for (var i = 0; i < PodView.RowCount; i++)
            {
                if (PodView.GetRowCellValue(i, PodView.Columns["ShipmentCode"]).ToString() == tbxPod.Text)
                {
                    if (PodView.GetRowCellValue(i, PodView.Columns["StateChange"]).ToString() == EnumStateChange.Idle.ToString())
                    {
                        PodView.SetRowCellValue(i, PodView.Columns["StateChange"], EnumStateChange.Insert);
                    }
                    if (PodView.GetRowCellValue(i, PodView.Columns["StateChange"]).ToString() == EnumStateChange.Select.ToString())
                    {
                        PodView.SetRowCellValue(i, PodView.Columns["StateChange"], EnumStateChange.Update);
                    }

                    PodView.SetRowCellValue(i, PodView.Columns["Checked"], true);
                    found = true;
                }
            }

            if (!found)
            {
                var shipment = new CorporatePickupDetailDataManager().GetShipmentPickup(tbxPod.Text);
                if (shipment != null)
                {
                    var list = PodGrid.DataSource as List <CorporatePickupDetailModel>;

                    if (list == null)
                    {
                        list = new List <CorporatePickupDetailModel>();
                    }

                    list.Add(shipment);

                    PodGrid.DataSource = list;
                    PodView.RefreshData();
                }
                else
                {
                    MessageBox.Show(Resources.no_found_data, Resources.title_information, MessageBoxButtons.OK);
                }
            }

            tbxPod.Clear();
            tbxPod.Focus();

            summary();
        }
示例#3
0
        public override void New()
        {
            base.New();

            ClearForm();
            EnabledForm(true);

            PodGrid.DataSource =
                new FranchiseCommissionDataManager().GetActiveCommission(BaseControl.FranchiseId);
            PodView.RefreshData();

            cbxSetoran.SelectedIndex = 0;
            tbxDate.Focus();
        }
示例#4
0
 private void Changing(object sender, CellValueChangedEventArgs e)
 {
     if (e.Column.Name == "clChecked")
     {
         if (!(bool)PodView.GetRowCellValue(e.RowHandle, PodView.Columns["Checked"]))
         {
             PodView.SetRowCellValue(e.RowHandle, PodView.Columns["Checked"], true);
         }
         else
         {
             PodView.SetRowCellValue(e.RowHandle, PodView.Columns["Checked"], false);
         }
     }
 }
示例#5
0
        public PickupForm()
        {
            InitializeComponent();
            form = this;

            Shown += PickupFormShown;
            DataManager.DefaultParameters = new IListParameter[]
            {
                WhereTerm.Default(BaseControl.FranchiseId, "franchise_id", EnumSqlOperator.Equals)
            };

            PodGrid.DoubleClick += (o, args) =>
            {
                var rows = PodView.GetSelectedRows();

                if (rows.Count() > 0)
                {
                    BaseControl.OpenRelatedForm(new TrackingViewForm(), PodView.GetRowCellValue(rows[0], "ShipmentCode").ToString(), CallingCommand);
                }
            };
        }