Esempio n. 1
0
 public string AddModifyUserTicket(ClsTicketDetails ObjTicket)
 {
     using (ClsUser_DAL obj = new ClsUser_DAL())
     {
         return(obj.AddModifyUserTicket(ObjTicket));
     }
 }
Esempio n. 2
0
        public string AddModifyUserTicket(ClsTicketDetails ObjTicket)
        {
            try
            {
                DBParameterCollection ObJParameterCOl = new DBParameterCollection();
                DBParameter           objDBParameter  = new DBParameter("@Ref_User_ID", ObjTicket.Ref_User_ID, DbType.Int64);
                ObJParameterCOl.Add(objDBParameter);
                objDBParameter = new DBParameter("@Ref_Ticket_ID", ObjTicket.Ref_Ticket_ID, DbType.Int64);
                ObJParameterCOl.Add(objDBParameter);
                objDBParameter = new DBParameter("@Ref_TicketType_ID", ObjTicket.Ref_TicketType_ID, DbType.Int64);
                ObJParameterCOl.Add(objDBParameter);
                objDBParameter = new DBParameter("@Subject", ObjTicket.Subject, DbType.String);
                ObJParameterCOl.Add(objDBParameter);
                objDBParameter = new DBParameter("@Description", ObjTicket.Description, DbType.String);
                ObJParameterCOl.Add(objDBParameter);

                DBHelper objDbHelper   = new DBHelper();
                Int64    Ref_Ticket_ID = Convert.ToInt64(objDbHelper.ExecuteScalar(Constant.AddModifyUserTicket, ObJParameterCOl, CommandType.StoredProcedure));

                if (Ref_Ticket_ID > 0)
                {
                    ObjTicket.FileManager.ForEach(File =>
                    {
                        DBParameterCollection ObJParameterCOl1 = new DBParameterCollection();
                        DBParameter objDBParameter1            = new DBParameter("@FileManagerID", File.FileManagerID, DbType.Int64);
                        ObJParameterCOl1.Add(objDBParameter1);
                        objDBParameter1 = new DBParameter("@ModuleID", Ref_Ticket_ID, DbType.Int64);
                        ObJParameterCOl1.Add(objDBParameter1);
                        objDBParameter1 = new DBParameter("@ModuleType", File.ModuleType, DbType.String);
                        ObJParameterCOl1.Add(objDBParameter1);
                        objDBParameter1 = new DBParameter("@FileIdentifier", File.FileIdentifier, DbType.String);
                        ObJParameterCOl1.Add(objDBParameter1);
                        objDBParameter1 = new DBParameter("@FileName", File.FileName, DbType.String);
                        ObJParameterCOl1.Add(objDBParameter1);
                        objDBParameter1 = new DBParameter("@FilePath", File.FilePath, DbType.String);
                        ObJParameterCOl1.Add(objDBParameter1);
                        objDBParameter1 = new DBParameter("@FileExtension", File.FileExtension, DbType.String);
                        ObJParameterCOl1.Add(objDBParameter1);
                        objDBParameter1 = new DBParameter("@FileType", File.FileType, DbType.String);
                        ObJParameterCOl1.Add(objDBParameter1);
                        objDBParameter1 = new DBParameter("@FileSize", File.FileSize, DbType.Int64);
                        ObJParameterCOl1.Add(objDBParameter1);
                        objDBParameter1 = new DBParameter("@FileSequence", File.Sequence, DbType.Int32);
                        ObJParameterCOl1.Add(objDBParameter1);

                        objDbHelper.ExecuteScalar(Constant.SaveModuleFile, ObJParameterCOl1, CommandType.StoredProcedure).ToString();
                    });
                }

                if (Ref_Ticket_ID > 0 && ObjTicket.Ref_Ticket_ID == 0)
                {
                    return("USERTICKETSUCCESS");
                }
                else if (Ref_Ticket_ID > 0 && ObjTicket.Ref_Ticket_ID > 0)
                {
                    return("USERTICKETUPDATED");
                }
                else
                {
                    return("TICKETALREADYEXISTS");
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }