Esempio n. 1
0
    private string ConvertName(ItemKey key)
    {
        var first  = key.ToString().Substring(0, 1).ToUpper();
        var others = key.ToString().Substring(1);

        return(first + others);
    }
Esempio n. 2
0
        private string ConvertName(ItemKey key)
        {
            string first = key.ToString().Substring(0, 1).ToUpper();
            string other = key.ToString().Substring(1);

            return(first + other);
        }
Esempio n. 3
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append(ItemKey.ToString()).Append(" ").Append(ItemName.ToString()).Append(" ").Append(BarCodeNum.ToString()).Append(" ").Append(RetailPrice.ToString()).Append(" ").Append(ThresholdNum.ToString()).Append(" ").Append(StockLevel.ToString()).Append(" ").Append(SuppliersKey.ToString());
            return(sb.ToString());
        }
Esempio n. 4
0
        public void ToString_EquivalentKeyItemsGenerateSameKeyString()
        {
            //Arrange
            ItemKey testItemKey1 = new ItemKey(_guid1, _path1, _ver1, _mockLanguageWrapperEnglish, _masterDbName);
            ItemKey testItemKey2 = new ItemKey(_guid1Duplicate, _path1Duplicate, _ver1Duplicate, _mockLanguageWrapperEnglishDuplicate, _masterDbNameDuplicate);

            //Act
            string testItemKey1KeyString = testItemKey1.ToString();
            string testItemKey2KeyString = testItemKey2.ToString();

            //Assert
            Assert.AreEqual(testItemKey1KeyString, testItemKey2KeyString);
        }
Esempio n. 5
0
        public void ToString_DiffenretDbNamesGenerateDifferntKeyStrings()
        {
            //Arrange
            ItemKey testItemKey1 = new ItemKey(_guid1, _path1, _ver1, _mockLanguageWrapperEnglish, _masterDbName);
            ItemKey testItemKey2 = new ItemKey(_guid1, _path1, _ver1, _mockLanguageWrapperEnglish, _webDbName);

            //Act
            string testItemKey1KeyString = testItemKey1.ToString();
            string testItemKey2KeyString = testItemKey2.ToString();

            //Assert
            Assert.AreNotEqual(testItemKey1KeyString, testItemKey2KeyString);
        }
Esempio n. 6
0
        // Callback of the CallbackPanel which contains the entire control, to handle attaching and uploading
        protected void callAttach_Callback(object sender, DevExpress.Web.CallbackEventArgsBase e)
        {
            //Select whether this is an attachment of a existing artifact, or an upload AND attachment of new artifact
            switch (e.Parameter)
            {
            //case "bindrepository":
            //    gridRepository.DataSource = rc_services.GetRepository("P", false);
            //    gridRepository.DataBind();
            //    break;
            case "attach":

                //Use class AttachmentList to create a list of artifacts to be attached
                AttachmentList xMultiAttachment = new AttachmentList();

                //go through grid and create an unit for each selected item
                for (int i = 0; i <= gridRepository.VisibleRowCount; i = i + 1)
                {
                    if (gridRepository.Selection.IsRowSelected(i) == true)
                    {
                        //get page ref from text box inside cell template
                        string PageRef   = "";
                        string xRowIndex = Convert.ToString(i);
                        if (paramUpload.Contains("txPage" + xRowIndex))
                        {
                            PageRef = paramUpload["txPage" + xRowIndex].ToString();
                        }
                        //ASPxTextBox txPage = (ASPxTextBox)gridRepository.FindRowCellTemplateControl(i, gridRepository.DataColumns[8], "txPage");

                        string rowlibid = gridRepository.GetRowValues(i, "ArtifactID").ToString();
                        xMultiAttachment.Add(new Attachment()
                        {
                            ProjectID = Session["projectID"].ToString(), ArtifactID = rowlibid, ItemID = ItemKey.ToString(), PageReference = PageRef
                        });
                    }
                }

                //If any selected, call the function in rc_services to attach multiple artifacts
                if (xMultiAttachment.Count > 0)
                {
                    string xMultiAttachResult = rc_services.AttachArtifact(xMultiAttachment);
                    BindGrid();
                    gridRepository.Selection.UnselectAll();
                }

                break;

            //If they are uploading new artifact, first create it, and then attach it, using functions in rc_services
            case "newartifact":

                //Get variables loaded clientside on ASPxHiddenField Control
                xFileName    = (string)paramUpload.Get("xFileName");
                xStorageName = (string)paramUpload.Get("xStorageName");
                xType        = (string)paramUpload.Get("xType");
                xTitle       = (string)paramUpload.Get("xTitle");
                xDesc        = (string)paramUpload.Get("xDesc");
                xFullText    = (string)paramUpload.Get("xFullText");

                //Use NewArtifact from rc_services class to create an object

                string         xNewID      = rc_services.NewArtifact(Session["projectID"].ToString(), xTitle, xType, ArtifactHome, xFileName, xStorageName, xDesc, xFullText, (string)Session["UserID"]);
                AttachmentList xAttachment = new AttachmentList();
                xAttachment.Add(new Attachment()
                {
                    ProjectID = Session["projectID"].ToString(), ArtifactID = xNewID, ItemID = ItemKey
                });

                //Call function that attaches artifact after it has been created in above code
                string xAttachResult = rc_services.AttachArtifact(xAttachment);

                paramUpload.Clear();

                paramUpload.Add("xNewArtifact", xAttachResult);
                BindGrid();

                break;
            }
        }