protected void btnAnswer_Click(object sender, EventArgs e) { if (GXGridView1SelectedValue > 0) { DistributionDocument dd = DistributionDocument.Get(GXGridView1SelectedValue); List <DistributionDocumentItem> lstDDI = DistributionDocumentItem.GetByDistributionDocument(dd.ID); if (rblAnswer.SelectedValue == "Accept") { dd.DocumentStatusID = DistributionDocumentStatuse.GetByCode(DistributionDocumentStatuse.PRIMEN).ID; DistributionDocument.Table.Context.SubmitChanges(); foreach (DistributionDocumentItem ddi in lstDDI) { Distribution d = Distribution.Get(ddi.DistributionID); d.DistributionStatusID = DistributionStatuse.GetByCode(DistributionStatuse.POTVRDENA).ID; Distribution.Table.Context.SubmitChanges(); } } else if (rblAnswer.SelectedValue == "Deny") { dd.DocumentStatusID = DistributionDocumentStatuse.GetByCode(DistributionDocumentStatuse.NEPRIFATEN).ID; DistributionDocument.Table.Context.SubmitChanges(); foreach (DistributionDocumentItem ddi in lstDDI) { Distribution d = Distribution.Get(ddi.DistributionID); d.DistributionStatusID = DistributionStatuse.GetByCode(DistributionStatuse.VRATENA).ID; d.BranchID = null; d.UserID = Broker.DataAccess.User.GetFirstSEAdminUser().ID; Distribution.Table.Context.SubmitChanges(); } } viewGrid.DataBind(); mvMain.SetActiveView(viewGrid); } }
protected void btnPrintDocument_Click(object sender, EventArgs e) { if (GXGridView1SelectedValue > 0) { btnPreview.CssClass = "osvezi"; btnReport.CssClass = "izvestaj"; btnSearch.CssClass = "prebaraj"; btnDocumentItems.CssClass = "prikaz"; btnPrintDocument.CssClass = "pecati_Active"; DistributionDocument dd = DistributionDocument.Get(GXGridView1SelectedValue); PrintDistributionDocuments.PrintDistributionDocument(dd); } }
protected void btnChangeStatus_Click(object sender, EventArgs e) { if (GXGridView1SelectedValue > 0) { DistributionDocument dd = DistributionDocument.Get(GXGridView1SelectedValue); if (dd.DistributionDocType.Code == DistributionDocType.ISPRATNICA) { mvMain.SetActiveView(viewChangeStatus); btnPreview.CssClass = "osvezi"; btnReport.CssClass = "izvestaj"; btnSearch.CssClass = "prebaraj"; btnDocumentItems.CssClass = "prikaz"; btnPrintDocument.CssClass = "pecati"; btnChangeStatus.CssClass = "izmeni_Active"; dvChangeStatusDistributionDocumentInfo.DataBind(); } else { RegisterStartupScript("myAlert", "<script>alert('Документот не е испратница!')</script>"); } } }