Exemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (IsPostBack.IsFalse())
         {
             InitializeCombo();
             InitializeSession();
         }
         else
         {
             Page.ClientScript.GetPostBackEventReference(this, String.Empty);
             String eventTarget = Request["__EVENTTARGET"].IsNullOrEmpty() ? String.Empty : Request["__EVENTTARGET"];
             if (Request["__EVENTTARGET"] == "SearchTransactionType")
             {
                 TransactionTypeList = new CustomList <CmnTransactionType>();
                 CmnTransactionType searchCmnTransactionType = Session[STATIC.StaticInfo.SearchSessionVarName] as CmnTransactionType;
                 TransactionTypeList.Add(searchCmnTransactionType);
                 if (searchCmnTransactionType.IsNotNull())
                 {
                     PopulateTransactionTypeInformation(searchCmnTransactionType);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                CustomList <CmnTransactionType> lstTransactionType = TransactionTypeList;
                if (lstTransactionType.Count == 0)
                {
                    CmnTransactionType newTransctionType = new CmnTransactionType();
                    lstTransactionType.Add(newTransctionType);
                }
                SetDataFromControlToObj(ref lstTransactionType);

                if (!CheckUserAuthentication(lstTransactionType))
                {
                    return;
                }
                _manager.SaveTransactionType(ref lstTransactionType);
                ((PageBase)this.Page).SuccessMessage = (StaticInfo.SavedSuccessfullyMsg);
            }
            catch (SqlException ex)
            {
                ((PageBase)this.Page).ErrorMessage = (ExceptionHelper.getSqlExceptionMessage(ex));
            }
            catch (Exception ex)
            {
                ((PageBase)this.Page).ErrorMessage = (ExceptionHelper.getExceptionMessage(ex));
            }
        }
Exemplo n.º 3
0
 private void SetDataFromControlToObj(ref CustomList <CmnTransactionType> lstTransactionType)
 {
     try
     {
         CmnTransactionType obj = lstTransactionType[0];
         obj.TransTypeName = txtTransactionTypeName.Text;
         obj.CustomCode    = "0";
         obj.DocListID     = ddlDocList.SelectedValue.ToInt();
     }
     catch (Exception ex)
     {
         throw (ex);
     }
 }
Exemplo n.º 4
0
 private void PopulateTransactionTypeInformation(CmnTransactionType TransactionType)
 {
     try
     {
         txtTransactionTypeName.Text = TransactionType.TransTypeName;
         if (TransactionType.DocListID != 0)
         {
             ddlDocList.SelectedValue = TransactionType.DocListID.ToString();
         }
     }
     catch (Exception ex)
     {
         throw (ex);
     }
 }
Exemplo n.º 5
0
 public CustomList <CmnTransactionType> GetAllTransTypeName()
 {
     return(CmnTransactionType.GetAllReferenceType());
 }
Exemplo n.º 6
0
 public CustomList <CmnTransactionType> GetAllReferenceType(Int32 DocListID)
 {
     return(CmnTransactionType.GetAllReferenceType(DocListID));
 }