Exemple #1
0
        public override void AlphabetClick(string alpha)
        {
            if (alpha == Constants.ALL_CHARACTERS)
            {
                List <AbstractSearch> searchCriteria = new List <AbstractSearch>();

                List <AttachmentDataView> list = CommonClientRef.GetAccountingAttachmentList(searchCriteria, GridViewSortExpression, GridViewSortDirection);

                ClearFilterForm();
                LoadSearchResult(list);
            }
            else
            {
                ICollection <AbstractSearch> searchCriteria = new List <AbstractSearch>();
                AddCustomSearchCriterias(searchCriteria);
                searchCriteria.Add(new TextSearch
                {
                    Comparator = TextComparators.StartsWith,
                    Property   = "FirstName",
                    SearchTerm = alpha
                });

                List <AttachmentDataView> list = CommonClientRef.GetAccountingAttachmentList(searchCriteria, GridViewSortExpression, GridViewSortDirection);

                LoadSearchResult(list);
            }
        }
Exemple #2
0
        public void LoadAttachmentList()
        {
            ICollection <AbstractSearch> searchCriteria = new List <AbstractSearch>();

            AddCustomSearchCriterias(searchCriteria);
            List <AttachmentDataView> list = CommonClientRef.GetAccountingAttachmentList(searchCriteria, GridViewSortExpression, GridViewSortDirection);

            LoadSearchResult(list);
        }
Exemple #3
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            ICollection <AbstractSearch> searchCriteria = new List <AbstractSearch>();

            AddCustomSearchCriterias(searchCriteria);
            List <AttachmentDataView> list = CommonClientRef.GetAccountingAttachmentList(searchCriteria, GridViewSortExpression, GridViewSortDirection);

            LoadSearchResult(list);
            this.pnlFilterData.Visible = false;
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            string idPerson = this.FormContext.QueryString["idResource"].ToString();

            foreach (GridViewRow row in this.gvUploadedFiles.Rows)
            {
                if (row.RowType == DataControlRowType.DataRow)
                {
                    //ID на прикачени файл
                    HiddenField hdnRowMasterKey = row.FindControl("hdnIdUploadedFile") as HiddenField;

                    //radio button
                    RadioButton rbtn = row.FindControl("rbtnSelectedFile") as RadioButton;

                    //описание за всеки прикачен файл
                    TextBox tbxDescription = row.Cells[0].FindControl("tbxDescription") as TextBox;
                    string  descr          = tbxDescription.Text;

                    //Update на всички редове като записваме само описанието
                    this.currentEntity        = CommonClientRef.GetUploadFileByID(hdnRowMasterKey.Value);
                    currentEntity.Description = descr;

                    CallContext resultContext = new CallContext();
                    resultContext.CurrentConsumerID = this.UserProps.IdUser;
                    resultContext = CommonClientRef.UploadedFileSave(currentEntity, resultContext);

                    //update на снимката на потребителя
                    if (rbtn.Checked)
                    {
                        this.personEntity = this.AdminClientRef.GetPersonByPersonID(idPerson);
                        if (this.personEntity != null)
                        {
                            this.personEntity.ImagePath = this.currentEntity.FilePath.Replace("\\", "/").Replace("C:", string.Empty);

                            CallContext resultPersontContext = new CallContext();
                            resultPersontContext.CurrentConsumerID = this.UserProps.IdUser;
                            resultPersontContext = AdminClientRef.PersonSave(this.personEntity, resultPersontContext);
                        }

                        //refresh Parent form
                        string script = "this.window.opener.location=this.window.opener.location;";
                        if (!ClientScript.IsClientScriptBlockRegistered("REFRESH_PARENT"))
                        {
                            ClientScript.RegisterClientScriptBlock(typeof(string), "REFRESH_PARENT", script, true);
                        }
                    }
                }
            }
        }
Exemple #5
0
        public override void FormLoad()
        {
            base.FormLoad();

            if (!this.FormContext.QueryString.Contains("ModuleSysName"))
            {
                this.ShowMSG("Подадени са грешни параметри на страницата");
                return;
            }
            if (!this.FormContext.QueryString.Contains("AttachmentDocumentType"))
            {
                this.ShowMSG("Подадени са грешни параметри на страницата");
                return;
            }

            string ModuleSysName          = this.FormContext.QueryString["ModuleSysName"].ToString();
            string AttachmentDocumentType = this.FormContext.QueryString["AttachmentDocumentType"].ToString();

            if (ModuleSysName == Constants.MODULE_FINANCE &&
                AttachmentDocumentType == ETEMEnums.FinanceReportTypeEnum.FinanceReport.ToString())
            {
                CheckUserActionPermission(ETEMEnums.SecuritySettings.AttachmentShowList, true);
            }

            string DocKeyTypeIntCode = string.Empty;

            if (this.FormContext.QueryString.Contains("DocKeyTypeIntCode"))
            {
                DocKeyTypeIntCode = this.FormContext.QueryString["DocKeyTypeIntCode"].ToString();
            }

            if (DocKeyTypeIntCode == string.Empty)
            {
                DocKeyTypeIntCode = "AttachmentType";
                this.ddlAttachmentType.KeyTypeIntCode = DocKeyTypeIntCode;
            }
            else
            {
                this.ddlAttachmentType.KeyTypeIntCode = DocKeyTypeIntCode;
            }
            this.ddlAttachmentType.UserControlLoad();

            this.Attachment.ModuleSysName          = ModuleSysName;
            this.Attachment.AttachmentDocumentType = AttachmentDocumentType;
            this.Attachment.DocKeyTypeIntCode      = DocKeyTypeIntCode;

            if (!IsPostBack)
            {
                KeyType ktAttachmentType = this.AdminClientRef.GetKeyTypeByIntCode(DocKeyTypeIntCode);

                if (ktAttachmentType != null)
                {
                    this.AttachmentTypeKeyTypeID = ktAttachmentType.idKeyType;
                }
            }

            ICollection <AbstractSearch> searchCriteria = new List <AbstractSearch>();

            AddCustomSearchCriterias(searchCriteria);

            if (string.IsNullOrEmpty(this.GridViewSortExpression) || this.GridViewSortExpression == Constants.INVALID_ID_STRING)
            {
                this.GridViewSortExpression = "AttachmentDate";
            }

            this.gvAttachment.DataSource = CommonClientRef.GetAccountingAttachmentList(searchCriteria, GridViewSortExpression, GridViewSortDirection);
            if (NewPageIndex.HasValue)
            {
                this.gvAttachment.PageIndex = NewPageIndex.Value;
            }
            this.gvAttachment.DataBind();
        }