Beispiel #1
0
 private void frmPrintContract_Load(object sender, EventArgs e)
 {
     try
     {
         ContractReport report = new ContractReport();
         report.InitData(contract);
         documentViewer1.DocumentSource = report;
         report.CreateDocument();
     }
     catch
     {
     }
 }
Beispiel #2
0
        public ContentResult T_CMS_Master_ContractEvt(int[] ID, string Action)
        {
            // You have your books IDs on the deleteInputs array
            JsonObject obj = new JsonObject();

            switch (Action.ToLower())
            {
            case "delete":

                if (ID != null && ID.Length > 0)
                {
                    int length = ID.Length;
                    T_CMS_Master_Contract objItem;
                    for (int i = 0; i <= length - 1; i++)
                    {
                        objItem = T_CMS_Master_ContractManager.GetById(ID[i]);
                        if (objItem != null)
                        {
                            T_CMS_Master_ContractManager.Delete(objItem);
                        }
                    }
                }
                break;

            case "print":

                if (ID != null && ID.Length > 0)
                {
                    int length = ID.Length;
                    ContractReportCollection objList = new ContractReportCollection();
                    T_CMS_Master_Contract    objItem;
                    ContractReport           objReportItem;

                    for (int i = 0; i <= length - 1; i++)
                    {
                        objItem = T_CMS_Master_ContractManager.GetById(ID[i]);
                        if (objItem.ID != 0)
                        {
                            objItem.StatusID = 3;
                            //objItem.IsActive = true;
                            objItem.ModifiedDate = SystemConfig.CurrentDate;
                            T_CMS_Master_ContractManager.Update(objItem);
                            objReportItem = new ContractReport()
                            {
                                ID           = CommonHelper.EncyptURLString(objItem.ID.ToString()),
                                EntityId     = CommonHelper.EncyptURLString(objItem.CMSOrg.Entity_Id.ToString()),
                                EmployeeCode = CommonHelper.EncyptURLString(objItem.EmployeeCode.ToString()),
                                filepath     = CommonHelper.EncyptURLString("Templates\\Rpt_Contract_RBVH.rdlc"),
                                Mode         = CommonHelper.EncyptURLString("CONTRACT"),
                                filetype     = "PDF"
                            };
                            //objItem.ID = CommonHelper.EncyptURLString(objItem.ID);

                            objList.Add(objReportItem);
                        }
                    }
                    obj.Data = objList;
                }
                break;
            }

            return(Content(JsonConvert.SerializeObject(obj), "application/json"));
        }