示例#1
0
        public ActionResult PickTable(AttributeModel atrmodel)
        {
            if (atrmodel.pomocnicza == null)
            {
                atrmodel.pomocnicza = new List <FlowExtension>();
            }
            FlowExtension flowex = new FlowExtension();

            flow.id_flow = 1072;
            flowdef.id_flowDefinition = 83;
            if (atrmodel.atributechilds == null)
            {
                atrmodel.atributechilds = operation.GetChildsAttribute(atrmodel.Id_attribute);
                atrmodel.Attributeslist = operation.GetTableAttributes(flowdef.id_flowDefinition);
            }
            if (atrmodel.flowextensionlist == null)
            {
                atrmodel.flowextensionlist = new List <FlowExtension>();
                atrmodel.flowextensionlist = operation.flowextensionAttributesTable(1072, atrmodel.atributechilds);
                atrmodel.MaxRow            = atrmodel.flowextensionlist.OrderBy(x => x.RowIndex).Last().RowIndex;
            }
            if (Request.Form["Add"] != null)
            {
                for (int i = 0; i < atrmodel.atributechilds.Count; i++)
                {
                    flowex.id_attribute = atrmodel.atributechilds[i];
                    flowex.id_flow      = flow;
                    flowex.Value        = "";
                    flowex.RowIndex     = atrmodel.MaxRow + 1;
                    operation.AddElement <FlowExtension>(flowex);
                }
                atrmodel.flowextensionlist = operation.flowextensionAttributesTable(1072, atrmodel.atributechilds);

                foreach (var item in atrmodel.atributechilds)
                {
                    atrmodel.flowextensionlist = operation.flowextensionAttributesTable(1072, atrmodel.atributechilds);
                    atrmodel.MaxRow            = atrmodel.flowextensionlist.OrderBy(x => x.RowIndex).Last().RowIndex;
                }
                return(View("Index", atrmodel));
            }
            if (Request.Form["newValue"] != null)
            {
                for (int items = 0; items < atrmodel.pomocnicza.Count; items++)
                {
                    flowex       = operation.Flowextension(atrmodel.pomocnicza[items].id_flowextension);
                    flowex.Value = atrmodel.pomocnicza[items].Value;
                    operation.Update <FlowExtension>(flowex);
                }
            }


            if (Request.Form["Delete"] != null)
            {
            }
            return(View("Index", atrmodel));
        }
示例#2
0
        public void createExtension(Flow id_flow, Attributes id_attr, string value)
        {
            FlowExtension ext = new FlowExtension();

            ext.id_flow      = id_flow;
            ext.id_attribute = id_attr;
            ext.Value        = value;
            NH.NHibernateOperation operation = new NH.NHibernateOperation();
            operation.AddElement <FlowExtension>(ext);
        }
示例#3
0
        public ActionResult Add(flowdefmodellist model)
        {
            ViewBag.message           = model.id_flowDefinition;
            flowdef.id_flowDefinition = model.id_flowDefinition;
            flow.id_flowdefinition    = flowdef;
            flow.id_position          = operation.GetPositionidFlow(model.id_flowDefinition);
            flow.id_user = user;
            flow.Name    = model.name;
            if (flow.id_flowdefinition != null && flow.id_position != null && flow.id_user != null && flow.Name != null)
            {
                operation.AddElement <Flow>(flow);
            }

            return(View());
        }
示例#4
0
        public ActionResult Add(HttpPostedFileBase uploadFile)
        {
            // ViewData["MyFlow"] = flowdefinition;
            Document newDocument = new Document();


            if (uploadFile != null)
            {
                string filePath = uploadFile.FileName;
                newDocument.Name = Path.GetFileName(uploadFile.FileName);
                string ext         = Path.GetExtension(uploadFile.FileName);
                string contenttype = string.Empty;
                switch (ext)
                {
                case ".doc":
                    contenttype = "application/vnd.ms-word";
                    break;

                case ".docx":
                    contenttype = "application/vnd.ms-word";
                    break;

                case ".pdf":
                    contenttype = "application/pdf";
                    break;
                }
                if (contenttype != String.Empty)
                {
                    byte[] bytes;
                    using (BinaryReader br = new BinaryReader(uploadFile.InputStream))
                    {
                        bytes = br.ReadBytes(uploadFile.ContentLength);
                    }
                    newDocument.Data        = bytes;
                    newDocument.ContentType = contenttype;

                    operation.AddElement <Document>(newDocument);
                    return(RedirectToAction("Index", "Account"));
                }
            }
            return(View("Index", "Document"));
        }