Esempio n. 1
0
        public string CreateTeam(string TeamName, string Description, int IssueID, string ImgUrl)
        {
            //if (
            //    (TeamName != "" & TeamName != null) &
            //    (Description != "" & Description != null) &
            //    (IssueID != 0) &
            //    (ImgUrl != "" & ImgUrl != null)
            //    )
            DataTable dtTeamName = BAL.GetIssueTitle(IssueID);

            if (dtTeamName.Rows.Count > 0)
            {
                if (FCommon.CheckEmptyStrings(TeamName, Description, ImgUrl) && FCommon.CheckEmptyInt(IssueID))
                {
                    CFSession CFSess = (CFSession)Session["CFSess"];
                    BAL.TeamID      = 0;
                    BAL.TeamName    = dtTeamName.Rows[0]["Title"].ToString();
                    BAL.Description = Description;
                    BAL.CreatedBy   = Convert.ToInt32(CFSess.ID);
                    BAL.CreatedDate = DateTime.Now;
                    BAL.ImgUrl      = ImgUrl;
                    BAL.IssueID     = IssueID;
                    BAL.StatusID    = 1;
                    BAL.IsActive    = true;
                    DataRow dr = BAL.InsertTeams(BAL);
                    BAL.InsertTeamMember(Convert.ToInt32(dr["TeamID"]), Convert.ToInt32(CFSess.ID), 1, DateTime.Now);
                    return(JsonConvert.SerializeObject(dr));
                }
                else
                {
                    return(JsonConvert.SerializeObject(FCommon.ConvertReturn("Wrong")));
                }
            }
            else
            {
                return(JsonConvert.SerializeObject(FCommon.ConvertReturn("Wrong")));
            }
        }