/// <summary>
    /// Add new ExchangeCompany to db.
    /// </summary>
    private void SaveExchangeCompanyInformation()
    {
        ExchangeCompany ExchangeCompanyToSave = new ExchangeCompany();

        try
        {
            if (hfID.Value != "")
            {
                ExchangeCompanyToSave.ExchangeCompanyID = Convert.ToInt32(hfID.Value);
            }
            ExchangeCompanyToSave.ExchangeCompanyEmail = txtEmail.Text;
            ExchangeCompanyToSave.ExchangeCompanyName  = txtNameS.Text;
            ExchangeCompanyToSave.ExchangeCompanyPhone = txtPhone.Text;
            ExchangeCompanyToSave.ExchangeCompanyDesc  = txtShortdesc.Text;
            ExchangeCompanyToSave.Priority             = Convert.ToInt32(txtPriority.Text);
            ExchangeCompanyToSave.Active = cbActive.Checked;

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


            // perform saving method.
            if (new ExchangeCompaniesManager().SaveCompany(ExchangeCompanyToSave))
            {
                lblError.Text = Resources.AdminResources_en.SuccessSave;
                ResetControls();
                FillExchangeCompaniesList(); // refresh data.
            }
            else
            {
                lblError.Text = Resources.AdminResources_en.ErrorSave;
            }
        }
        catch { lblError.Text = Resources.AdminResources_en.ErrorSave; }
    }
示例#2
0
    public static object SaveExchangeCompany(ExchangeCompany scParam)
    {
        object data = new { };

        ExchangeCompany item = new ExchangeCompany();

        item.ExchangeCompanyID     = scParam.ExchangeCompanyID;
        item.ExchangeCompanyNameEn = scParam.ExchangeCompanyNameEn;
        item.ExchangeCompanyNameAr = scParam.ExchangeCompanyNameAr;
        item.Rate = scParam.Rate;

        bool status = new ExchangeCompaniesManager().SaveExchangeCompany(item);

        if ((item.ExchangeCompanyNameEn != null && item.ExchangeCompanyNameAr != null) || status)
        {
            //HttpContext.Current.Cache.Remove("ExchangeCompanies");
            data = new
            {
                Status  = true,
                Message = Resources.AdminResources_ar.SuccessSave
            };
        }
        else
        {
            data = new { Status = false, Message = Resources.AdminResources_ar.ErrorSave }
        };


        return(data);
    }

    #endregion
}
示例#3
0
 public bool SaveExchangeCompany(ExchangeCompany item)
 {
     try
     {
         ctxWrite.ExchangeCompanies_InsertUpdate(item.ExchangeCompanyID, item.ExchangeCompanyNameEn, item.ExchangeCompanyNameAr, item.Rate);
         return(true);
     }
     catch { return(false); }
 }
 public bool SaveCompany(ExchangeCompany item)
 {
     try
     {
         ctxWrite.ExchangeCompanies_AddEdit(item.ExchangeCompanyID, item.ExchangeCompanyName, item.ExchangeCompanyEmail, item.ExchangeCompanyPhone, item.ExchangeCompanyAddress,
                                            item.ExchangeCompanyDesc, item.Priority, item.Active, item.System_Who_Add, item.System_LastAction_IP);
         return(true);
     }
     catch { return(false); }
 }