Exemple #1
0
 public bool SavePortShip(PortShipping item)
 {
     try
     {
         ctxWrite.PortShips_AddEdit(item.PortShipID, item.PortShipEn, item.PortShipAr, item.PortShipDescEn, item.PortShipDescAr,
                                    item.Priority, item.Active, item.System_Who_Add, item.System_LastAction_IP);
         return(true);
     }
     catch { return(false); }
 }
    private void SavePortShipInformation()
    {
        PortShipping PortShipToSave = new PortShipping();

        try
        {
            if (hfID.Value != "")
            {
                PortShipToSave.PortShipID = Convert.ToInt32(hfID.Value);
            }

            PortShipToSave.PortShipAr = txtNameAr.Text;
            PortShipToSave.PortShipEn = txtNameEn.Text;
            //PortShipToSave.PortShipDescAr = txtShortdescAr.Text;
            //PortShipToSave.PortShipDescEn = txtShortDescEn.Text;
            PortShipToSave.Priority = Convert.ToInt32(txtPriority.Text);
            PortShipToSave.Active   = cbActive.Checked;

            PortShipToSave.System_Add_Date      = DateTime.Now;
            PortShipToSave.System_LastAction_IP = ClientSession.Current.IP;


            // perform saving method.
            if (new PortShipsManager().SavePortShip(PortShipToSave))
            {
                lblError.Text = Resources.AdminResources_en.SuccessSave;
                ResetControls();
                FillPortShipsList(); // refresh data.
            }
            else
            {
                lblError.Text = Resources.AdminResources_en.ErrorSave;
            }
        }
        catch { lblError.Text = Resources.AdminResources_en.ErrorSave; }
    }