Пример #1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            DocumentTypes objDocumentTypes = new DocumentTypes();
            objDocumentTypes.DocumentTypeDesc = txtDocumentTypeDesc.Text;
            objDocumentTypes.Status = 1;


            if (!string.IsNullOrEmpty(hfDocumentTypeID.Value.ToString()))
            {
                objDocumentTypes.UpdatedBy = UserAuthentication.GetUserId(this.Page);
                objDocumentTypes.UpdatedDate = DateTime.Now;
                objDocumentTypes.DocumentTypeID = Convert.ToInt32(hfDocumentTypeID.Value);
                objDocumentTypes.DocumentTypeDesc = txtDocumentTypeDesc.Text;
                DocumentTypesBO.UpdateDocumentTypes(objDocumentTypes);

            }
            else
            {
                objDocumentTypes.CreatedBy = UserAuthentication.GetUserId(this.Page);
                objDocumentTypes.CreatedDate = DateTime.Now;
                DocumentTypesBO.InsertDocumentTypes(objDocumentTypes);
            }

            txtDocumentTypeDesc.Text = string.Empty;
            hfDocumentTypeID.Value = string.Empty;
            loadDocumentType();

        }
Пример #2
0
        public int DeleteDocumentTypes(DocumentTypes objDocumentTypes)
        {
            int rowsaffected = -1;
            BeginTransaction();
            try
            {
                String[] UpdateProperties = new String[] { "Status" };
                rowsaffected = Update(objDocumentTypes, UpdateProperties);

                CommitTransaction();
            }
            catch (Exception e)
            {
                RollBackTransaction();
                rowsaffected = -1;
            }
            return rowsaffected;
        }
Пример #3
0
        public int InsertDocumentTypes(DocumentTypes objDocumentTypes)
        {
            objDocumentTypes.DocumentTypeID = 1;
            BeginTransaction();

            try
            {
                objDocumentTypes.DocumentTypeID = Insert(objDocumentTypes);
                CommitTransaction();
            }
            catch (Exception ex)
            {
                RollBackTransaction();
                objDocumentTypes.DocumentTypeID = -1;
            }

            return objDocumentTypes.DocumentTypeID;
        }
Пример #4
0
        protected void gvDocumentType_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            hfDocumentTypeID.Value = e.CommandArgument.ToString();
            DocumentTypes objDocumentTypes = new DocumentTypes();

            if (e.CommandName.Equals("cmdEdit"))
            {
                objDocumentTypes = DocumentTypesBO.GetDocumentTypes(Convert.ToInt32(e.CommandArgument));
                txtDocumentTypeDesc.Text = objDocumentTypes.DocumentTypeDesc;
            }
            else if (e.CommandName.Equals("cmdDelete"))
            {
                int DocumentTypeID = Convert.ToInt32(e.CommandArgument);
                objDocumentTypes.DocumentTypeID = DocumentTypeID;
                objDocumentTypes.Status = 0;
                DocumentTypesBO.DeleteDocumentTypes(objDocumentTypes);
                loadDocumentType();
            }
        }
Пример #5
0
 public static int DeleteDocumentTypes(DocumentTypes objDocumentTypes)
 {
     return new DocumentTypesDAO().DeleteDocumentTypes(objDocumentTypes);
 }
Пример #6
0
 public static int UpdateDocumentTypes(DocumentTypes objDocumentTypes)
 {
     return new DocumentTypesDAO().UpdateDocumentTypes(objDocumentTypes);
 }
Пример #7
0
 public static DocumentTypes GetDocumentTypes(int DocumentTypeID)
 {
     DocumentTypes objDocumentTypes = new DocumentTypes();
     return (DocumentTypes)(new DocumentTypesDAO().FillDTO(objDocumentTypes, "DocumentTypeID=" + DocumentTypeID));
 }
Пример #8
0
 public static int InsertDocumentTypes(DocumentTypes objDocumentTypes)
 {
     return new DocumentTypesDAO().InsertDocumentTypes(objDocumentTypes);
 }