private void PopulateDocListFormatInformation(CmnDocListFormat cmnDocListFormat)
        {
            try
            {
                txtCustomCode.Text = cmnDocListFormat.CustomCode;
                txtPrefix.Text = cmnDocListFormat.Prefix;
                txtSufix.Text = cmnDocListFormat.Suffix;
                ddlMenuName.SelectedValue = cmnDocListFormat.DocListId.ToString();
                DocListFormatDetailList = _manager.GetAllDocListFormat_Detail(cmnDocListFormat.DocListFormatID);
            }
            catch (Exception ex)
            {

                throw (ex);
            }
        }
Example #2
0
 public static CustomList<CmnDocListFormat> GetAllDocListFormatFind()
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<CmnDocListFormat> CmnDocListFormatCollection = new CustomList<CmnDocListFormat>();
     IDataReader reader = null;
     const String sql = "SELECT a.DocListFormatID,a.CustomCode,a.DocListId,a.Prefix,a.Suffix,a.PeriodType,a.Project,a.CostCentre,a.CompanyID, a.IsDeleted,a.Transfer, b.Description FROM API.dbo.CmnDocListFormat a inner join  APISysMan.dbo.Menu b  ON a.DocListId=b.MenuID";
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             CmnDocListFormat newCmnDocListFormat = new CmnDocListFormat();
             newCmnDocListFormat.SetData(reader);
             CmnDocListFormatCollection.Add(newCmnDocListFormat);
         }
        // CmnDocListFormatCollection.InsertSpName = "spInsertCmnDocListFormat";
        // CmnDocListFormatCollection.UpdateSpName = "spUpdateCmnDocListFormat";
        // CmnDocListFormatCollection.DeleteSpName = "spDeleteCmnDocListFormat";
         return CmnDocListFormatCollection;
     }
     catch (Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                CustomList<CmnDocListFormat> lstCmnDocListFormat = (CustomList<CmnDocListFormat>)DocListFormatList;
                if (lstCmnDocListFormat.Count == 0)
                {
                    CmnDocListFormat newObj = new CmnDocListFormat();
                    lstCmnDocListFormat.Add(newObj);
                }
                SetDataFromControlToObject(ref lstCmnDocListFormat);
                CustomList<CmnDocListFormatDetail> lstCmnDocListFormatDetail = DocListFormatDetailList;
                if (!CheckUserAuthentication(lstCmnDocListFormat)) return;
                _manager.SaveDocListFormat(ref lstCmnDocListFormat, ref lstCmnDocListFormatDetail);
                this.SuccessMessage = (StaticInfo.SavedSuccessfullyMsg);
            }

            catch (SqlException ex)
            {
                this.ErrorMessage = (ExceptionHelper.getSqlExceptionMessage(ex));
            }
            catch (Exception ex)
            {
                this.ErrorMessage = (ExceptionHelper.getExceptionMessage(ex));
            }
        }
Example #4
0
 public static CustomList<CmnDocListFormat> GetAllCmnDocListFormat()
 {
     ConnectionManager conManager = new ConnectionManager(ConnectionName.HR);
     CustomList<CmnDocListFormat> CmnDocListFormatCollection = new CustomList<CmnDocListFormat>();
     IDataReader reader = null;
     const String sql = "Select DocListFormatID,CustomCode,DocListId,Prefix,Suffix,PeriodType,Project,CostCentre,CompanyID, IsDeleted,Transfer,'' Description from CmnDocListFormat";
     try
     {
         conManager.OpenDataReader(sql, out reader);
         while (reader.Read())
         {
             CmnDocListFormat newCmnDocListFormat = new CmnDocListFormat();
             newCmnDocListFormat.SetData(reader);
             CmnDocListFormatCollection.Add(newCmnDocListFormat);
         }
         return CmnDocListFormatCollection;
     }
     catch(Exception ex)
     {
         throw (ex);
     }
     finally
     {
         if (reader != null && !reader.IsClosed)
             reader.Close();
     }
 }